This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
generated from nickytonline/web3-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d99ed9a
commit 8e4ff26
Showing
39 changed files
with
2,691 additions
and
1,698 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -121,6 +121,7 @@ dist | |
.pnp.* | ||
|
||
.vercel | ||
.netlify | ||
|
||
# macOS files to ignore | ||
.DS_Store | ||
|
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 +1 @@ | ||
v14.18.0 | ||
v16.13.1 |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>; | ||
|
||
export const Button: React.FC<ButtonProps> = ({ | ||
children, | ||
onClick, | ||
type = 'button', | ||
}) => { | ||
return ( | ||
<button | ||
type={type} | ||
sx={{ | ||
backgroundColor: 'accent', | ||
color: '#fff', | ||
borderRadius: '32px', | ||
border: 'none', | ||
padding: '0.25rem 0.5rem', | ||
cursor: 'pointer', | ||
}} | ||
onClick={onClick} | ||
> | ||
{children} | ||
</button> | ||
); | ||
}; |
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,41 @@ | ||
import Image from 'next/image'; | ||
|
||
export const EtherscanLink: React.FC<{ | ||
address: string; | ||
domainName: string | null; | ||
avatar: string; | ||
}> = ({ address, domainName, avatar }) => { | ||
return ( | ||
<a | ||
sx={{ | ||
backgroundColor: '#fff', | ||
color: 'accent', | ||
borderRadius: '32px', | ||
textOverflow: 'ellipsis', | ||
overflow: 'hidden', | ||
whiteSpace: 'nowrap', | ||
display: 'flex', | ||
padding: '0.25rem', | ||
'& img': { | ||
borderRadius: '50%', | ||
border: '1px solid #000000 !important', | ||
}, | ||
}} | ||
href={`https://rinkeby.etherscan.io/address/${address}`} | ||
title={`User with wallet address ${address} on etherscan.io`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<Image src={avatar} alt="" width="24" height="24" /> | ||
<span | ||
sx={{ | ||
marginLeft: '0.5rem', | ||
marginRight: '0.25rem', | ||
display: ['none', 'inherit'], | ||
}} | ||
> | ||
{domainName ?? address} | ||
</span> | ||
</a> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Maybe } from '@metamask/providers/dist/utils'; | ||
import { EtherscanLink } from '@components/EtherscanLink'; | ||
import { Button } from '@components/Button'; | ||
import Image from 'next/image'; | ||
|
||
export const Wallet: React.FC<{ | ||
account: Maybe<string>; | ||
domainName: string | null; | ||
avatar: string; | ||
connectWallet: () => void; | ||
}> = ({ account, domainName, connectWallet, avatar }) => { | ||
return ( | ||
<div> | ||
{account ? ( | ||
<EtherscanLink | ||
address={account} | ||
domainName={domainName} | ||
avatar={avatar} | ||
/> | ||
) : ( | ||
<Button onClick={connectWallet}>Connect Wallet</Button> | ||
)} | ||
</div> | ||
); | ||
}; |
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,13 +1,13 @@ | ||
import { Meta } from '@storybook/react'; | ||
import { ExampleHeader } from '@components/Header'; | ||
import { Header } from '@components/Header'; | ||
|
||
const meta: Meta = { | ||
title: 'Components/Example Header', | ||
component: ExampleHeader, | ||
component: Header, | ||
argTypes: {}, | ||
}; | ||
export default meta; | ||
|
||
export const Default: React.VFC = () => { | ||
return <ExampleHeader />; | ||
return <Header />; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.