Skip to content

Commit

Permalink
Merge pull request #152 from CudoVentures/cudos-dev
Browse files Browse the repository at this point in the history
Cudos dev
  • Loading branch information
mlukanova authored Jun 1, 2023
2 parents f034a96 + ed4997b commit 52ca121
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
26 changes: 3 additions & 23 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Routes, Route, useLocation, Navigate } from 'react-router-dom'
import { updateUser } from 'store/profile'
import { updateUserTransactions } from 'store/userTransactions'
import NotificationPopup from 'components/NotificationPopup'
import { switchLedgerType } from 'ledgers/utils'
import { connectUser } from './utils/projectUtils'
import { useApollo } from './graphql/client'
import Layout from './components/Layout'
Expand All @@ -35,30 +34,11 @@ const App = () => {
const themeColor = useSelector((state: RootState) => state.settings.theme)
const newApolloClient = useApollo(null)
const isMainnet = CHAIN_DETAILS.CHAIN_ID === 'cudos-1'

const {
lastLoggedAddress,
connectedLedger,
loadingState
} = useSelector((state: RootState) => state.profile)

const state = useSelector((state: RootState) => state.userTransactions)
const dispatch = useDispatch()

const connectAccount = useCallback(async (walletName: SUPPORTED_WALLET) => {
try {

const { address } = await switchLedgerType(walletName)
if (address !== lastLoggedAddress || lastLoggedAddress === '') {
dispatch(
updateUserTransactions({
offsetCount: 0,
data: [],
hasActivity: false,
loading: true
})
)
}

const connectedUser = await connectUser(walletName)
dispatch(updateUser(connectedUser))

Expand Down Expand Up @@ -112,8 +92,8 @@ const App = () => {
)}
{location.pathname === '/' ? null : (
<Layout>
{loadingState ? <NetworkChangingLoading /> : null}
<Box style={loadingState ? networkLoadingStyles.hidden : networkLoadingStyles.visible}>
{state.loading ? <NetworkChangingLoading /> : null}
<Box style={state.loading ? networkLoadingStyles.hidden : networkLoadingStyles.visible}>
<Routes>
<Route element={<RequireLedger />}>
<Route path="dashboard">
Expand Down
7 changes: 6 additions & 1 deletion src/components/Dialog/components/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { CircularProgress, Typography } from '@mui/material'
import { ModalContainer } from './styles'
import { useSelector } from 'react-redux'
import { RootState } from 'store'

const Loading: React.FC = () => {

const { connectedLedger } = useSelector((state: RootState) => state.profile)

return (
<ModalContainer sx={{ minWidth: '600px', padding: '4rem' }}>
<CircularProgress thickness={5} sx={{ borderRadius: '20px' }} />
<Typography variant="h4" fontWeight={900} letterSpacing={2}>
Processing...
</Typography>
<Typography color="primary.main" fontWeight={900} letterSpacing={1}>
Check details in your Keplr Wallet
{`Check details in your ${connectedLedger} Wallet`}
</Typography>
</ModalContainer>
)
Expand Down

0 comments on commit 52ca121

Please sign in to comment.