-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: show sample dapps to connect (only once)
- Loading branch information
Showing
7 changed files
with
62 additions
and
24 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,3 @@ | |
top: var(--space-3); | ||
right: var(--space-3); | ||
} | ||
|
||
.divider { | ||
margin: 0 calc(-1 * var(--space-4)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.icon { | ||
color: #3a99fb; | ||
width: 40px; | ||
font-size: 50px; | ||
} | ||
|
||
.errorBadge { | ||
|
46 changes: 46 additions & 0 deletions
46
src/components/walletconnect/WcSessionList/WcNoSessions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import ExternalLink from '@/components/common/ExternalLink' | ||
import useLocalStorage from '@/services/local-storage/useLocalStorage' | ||
import { Typography } from '@mui/material' | ||
import { useEffect } from 'react' | ||
|
||
const SAMPLE_DAPPS = [ | ||
{ name: 'Zerion', icon: '/images/common/nft-zerion.svg', url: 'https://app.zerion.io/connect-wallet' }, | ||
{ name: 'Zapper', icon: '/images/common/nft-zapper.svg', url: 'https://zapper.xyz/' }, | ||
{ name: 'OpenSea', icon: '/images/common/nft-opensea.svg', url: 'https://opensea.io/' }, | ||
] | ||
|
||
const LS_KEY = 'native_wc_dapps' | ||
|
||
const WcNoSessions = () => { | ||
const [showDapps = true, setShowDapps] = useLocalStorage<boolean>(LS_KEY) | ||
|
||
// Only show the sample dApps list once | ||
useEffect(() => { | ||
return () => { | ||
setShowDapps(false) | ||
} | ||
}, [setShowDapps]) | ||
|
||
return ( | ||
<> | ||
<Typography variant="body2" textAlign="center" color="text.secondary"> | ||
No dApps are connected yet.{showDapps ? ' Try one of these:' : ''} | ||
</Typography> | ||
|
||
{showDapps && ( | ||
<Typography variant="body2" display="flex" justifyContent="space-between" alignItems="center" mt={3}> | ||
{SAMPLE_DAPPS.map((item) => ( | ||
<ExternalLink href={item.url} key={item.url} noIcon px={1}> | ||
<img src={item.icon} alt={item.name} width={32} height={32} /> | ||
<Typography variant="body2" ml={1}> | ||
{item.name} | ||
</Typography> | ||
</ExternalLink> | ||
))} | ||
</Typography> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
export default WcNoSessions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters