Skip to content

Commit

Permalink
refactored project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee348 committed Dec 10, 2024
1 parent 7865797 commit 3492ec5
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Image, Text } from '@0xsequence/design-system'
import { Box, Image, Text } from '@0xsequence/design-system'
import { motion } from 'framer-motion'

import { useStore } from '~/stores'
Expand Down Expand Up @@ -57,38 +57,38 @@ export const MobileDrawerContent = () => {
borderLeftColor="backgroundBackdrop"
style={{ width: '75%' }}
>
<Box
// flexDirection="row"
// alignItems="center"
// background="buttonGlass"
// borderRadius="sm"
gap="2"
// style={{ cursor: 'pointer', padding: '8px 16px 8px 8px' }}
onClick={() => window.open('https://docs.sequence.xyz/')}
>
<Image src={externalArrowIcon} height="5" />
<Text variant="normal" fontWeight="bold" color="text50">
Docs
</Text>
</Box>
<Box
// flexDirection="row"
// alignItems="center"
// background="buttonGlass"
// borderRadius="sm"
gap="2"
// style={{ cursor: 'pointer', padding: '8px 16px 8px 8px' }}
onClick={() => window.open('https://docs.sequence.xyz/')}
>
<Image src={externalArrowIcon} height="5" />
<Text variant="normal" fontWeight="bold" color="text50">
Docs
</Text>
</Box>

<Box
// flexDirection="row"
// alignItems="center"
// background="buttonGlass"
// borderRadius="sm"
gap="2"
// style={{ cursor: 'pointer', padding: '8px 16px 8px 8px' }}
onClick={() => {
openNetworkModal()
toggleNavDrawer(false)
}}
>
<Image src={networkIcon} height="5" />
<Text variant="normal" fontWeight="bold" color="text50">
Networks
</Text>
</Box>
<Box
// flexDirection="row"
// alignItems="center"
// background="buttonGlass"
// borderRadius="sm"
gap="2"
// style={{ cursor: 'pointer', padding: '8px 16px 8px 8px' }}
onClick={() => {
openNetworkModal()
toggleNavDrawer(false)
}}
>
<Image src={networkIcon} height="5" />
<Text variant="normal" fontWeight="bold" color="text50">
Networks
</Text>
</Box>
</Box>
</Box>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useObservable, useStore } from '~/stores'
import { AuthStore } from '~/stores/AuthStore'
import { WalletStore } from '~/stores/WalletStore'

import SettingsDropdownMenu from '~/components/wallet/WalletDropdownMenu'
import SettingsDropdownMenu from '~/components/header/WalletDropdownMenu'

import networkIcon from '~/assets/icons/chain.svg'
import externalArrowIcon from '~/assets/icons/external-link-arrow.svg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { truncateMiddle } from '~/utils/truncatemiddle'
import { useObservable, useStore } from '~/stores'
import { AuthStore } from '~/stores/AuthStore'

import ConfirmSignOut from './ConfirmSignOut'
import ConfirmSignOut from '~/components/wallet/ConfirmSignOut'

export default function SettingsDropdownMenu() {
const authStore = useStore(AuthStore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const navDrawer = style([
left: '0',

width: 'vw',
height: 'vh',
}),
height: 'vh'
})
])
2 changes: 1 addition & 1 deletion src/components/wallet/PendingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useObservable } from 'micro-observables'
import { useStore } from '~/stores'
import { WalletStore } from '~/stores/WalletStore'

import PendingTxn from '~/components/PendingTxn'
import PendingTxn from '~/components/wallet/PendingTxn'

export default function PendingIndicator({ ...rest }: BoxProps) {
const walletStore = useStore(WalletStore)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Spinner, Text } from '@0xsequence/design-system'

import NetworkTag from './network/NetworkTag'
import NetworkTag from '~/components/network/NetworkTag'

export default function PendingTxn({
symbol,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useEffect, useState } from 'react'
import { useStore } from '~/stores'
import { WalletStore } from '~/stores/WalletStore'

import SelectProvider from '~/components/SelectProvider'
import SelectProvider from '~/components/wallet/externalprovider/SelectProvider'
import { ButtonWithIcon } from '~/components/helpers/ButtonWithIcon'
import { ExternalIcon } from '~/components/helpers/ExternalIcon'

Expand Down
File renamed without changes.
12 changes: 8 additions & 4 deletions src/components/wallet/tokens/ImportToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,13 @@ export default function ImportToken({ onClose }: { onClose: () => void }) {
<Text variant="normal" fontWeight="bold" color="text80">
Balance:
</Text>
<Text variant="normal" fontWeight="bold" color="text80">
{selectedTokens?.filter(t => t.address.includes(token.address))[0].info?.balance}
</Text>
{selectedTokens?.filter(t => t.address.includes(token.address))[0].info?.balance ? (
<Text variant="normal" fontWeight="bold" color="text80">
{selectedTokens?.filter(t => t.address.includes(token.address))[0].info?.balance}
</Text>
) : (
<Spinner size="md" marginRight="1" />
)}
</>
)}
<FilledRoundCheckBox
Expand Down Expand Up @@ -233,7 +237,7 @@ export default function ImportToken({ onClose }: { onClose: () => void }) {
</Box>
)}

{isFetchingTokenInfo ? (
{isFetchingTokenInfo && tokenManualAddress ? (
<Box alignItems="center" marginBottom="6" justifyContent="center">
<Spinner size="lg" />
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { AuthStore } from '~/stores/AuthStore'
import { NetworkStore } from '~/stores/NetworkStore'
import { WalletStore } from '~/stores/WalletStore'

import RecoveryHeader from '~/components/header/RecoveryHeader'
import { FilledCheckBox } from '~/components/helpers'
import Networks from '~/components/network/Networks'
import RecoveryHeader from '~/components/recovery/RecoveryHeader'
import WalletList from '~/components/recovery/WalletList'

import { WALLET_WIDTH } from './Wallet'
Expand Down
8 changes: 4 additions & 4 deletions src/routes/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { TokenStore } from '~/stores/TokenStore'
import { WalletConnectSignClientStore } from '~/stores/WalletConnectSignClientStore'
import { WalletStore } from '~/stores/WalletStore'

import RecoveryHeader from '~/components/header/RecoveryHeader'
import Networks from '~/components/network/Networks'
import RecoveryHeader from '~/components/recovery/RecoveryHeader'
import SignClientTransactionConfirm from '~/components/signing/SignClientTransactionConfirm'
import SignClientTransactionRelay from '~/components/signing/SignClientTransactionRelay'
import DappList from '~/components/wallet/DappList'
import ExternalWallet from '~/components/wallet/ExternalWallet'
import DappList from '~/components/wallet/dapps/DappList'
import ExternalWallet from '~/components/wallet/externalprovider/ExternalWallet'
import PendingIndicator from '~/components/wallet/PendingIndicator'
import CollectibleList from '~/components/wallet/collectibles/CollectibleList'
import SendCollectible from '~/components/wallet/collectibles/SendCollectible'
Expand Down Expand Up @@ -307,7 +307,7 @@ function Wallet() {
<Box>
<RecoveryHeader />

<Box flexDirection="column" alignItems="center" >
<Box flexDirection="column" alignItems="center">
<Box
flexDirection="column"
padding="5"
Expand Down
2 changes: 1 addition & 1 deletion src/stores/WalletStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { EIP1193Provider } from '~/hooks/useSyncProviders'

import { observable, useStore } from '~/stores'

import { ProviderDetail, ProviderInfo } from '~/components/SelectProvider'
import { ProviderDetail, ProviderInfo } from '~/components/wallet/externalprovider/SelectProvider'

import { Store } from '.'
import { AuthStore } from './AuthStore'
Expand Down
6 changes: 3 additions & 3 deletions src/utils/indexeddb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const getIndexedDB = async (objectStoreKey: IndexedDBKey): Promise<idb.ID
try {
// Open the database without specifying a version to get the current version
db = await idb.openDB(DB_NAME)

if (db.objectStoreNames.contains(objectStoreKey)) {
// If the object store exists, return the db without closing it
return db
Expand All @@ -25,7 +25,7 @@ export const getIndexedDB = async (objectStoreKey: IndexedDBKey): Promise<idb.ID
if (!upgradeDb.objectStoreNames.contains(objectStoreKey)) {
upgradeDb.createObjectStore(objectStoreKey)
}
},
}
})

return db
Expand Down Expand Up @@ -54,4 +54,4 @@ export const clearIndexedDB = async (objectStoreKey: IndexedDBKey): Promise<void
db.close()
}
}
}
}

0 comments on commit 3492ec5

Please sign in to comment.