generated from NomicFoundation/hardhat-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from gnosisguild/ui-updates
lite UI overhaul
- Loading branch information
Showing
45 changed files
with
2,097 additions
and
1,510 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,12 @@ | |
"version": "1.0.0", | ||
"private": true, | ||
"devDependencies": { | ||
"0xsequence": "^1.6.2", | ||
"@rainbow-me/rainbowkit": "^1.3.3", | ||
"@types/react": "^18.2.21", | ||
"@types/react-dom": "^18.2.7", | ||
"@walletconnect/core": "^2.10.2", | ||
"@walletconnect/utils": "^2.10.2", | ||
"@walletconnect/web3wallet": "^1.9.2", | ||
"@web3modal/ethereum": "^2.7.1", | ||
"@web3modal/react": "^2.7.1", | ||
"@web3modal/standalone": "^2.4.3", | ||
"buffer": "^6.0.3", | ||
"clsx": "^1.2.1", | ||
"copy-to-clipboard": "^3.3.3", | ||
|
@@ -25,8 +22,8 @@ | |
"react-scripts": "5.0.1", | ||
"typescript": "^5.2.2", | ||
"typescript-plugin-css-modules": "^5.0.1", | ||
"viem": "^1.16.5", | ||
"wagmi": "^1.4.3" | ||
"viem": "^1.21.4", | ||
"wagmi": "^1.4.13" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
|
@@ -49,5 +46,8 @@ | |
"last 1 safari version" | ||
] | ||
}, | ||
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@tanstack/react-query": "^5.17.15" | ||
} | ||
} |
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,54 +1,17 @@ | ||
import { | ||
mainnet, | ||
goerli, | ||
avalanche, | ||
arbitrum, | ||
bsc, | ||
polygon, | ||
polygonMumbai, | ||
gnosis, | ||
} from "wagmi/chains" | ||
import { mainnet, polygon, gnosis } from "wagmi/chains" | ||
|
||
export const CHAINS = { | ||
import { Chain } from "viem/chains" | ||
|
||
type ChainInfo = { | ||
[key: number]: { prefix: string } & Chain | ||
} | ||
|
||
export const CHAINS: ChainInfo = { | ||
[mainnet.id]: { ...mainnet, prefix: "eth" }, | ||
[goerli.id]: { ...goerli, prefix: "gor" }, | ||
// [avalanche.id]: { ...avalanche, prefix: "avax" }, | ||
// [arbitrum.id]: { ...arbitrum, prefix: "arb1" }, | ||
// [bsc.id]: { ...bsc, prefix: "bnb" }, | ||
[polygon.id]: { ...polygon, prefix: "matic" }, | ||
[polygonMumbai.id]: { ...polygonMumbai, prefix: "maticmum" }, | ||
[gnosis.id]: { ...gnosis, prefix: "gno" }, | ||
} | ||
|
||
export type ChainId = keyof typeof CHAINS | ||
|
||
export const DEFAULT_CHAIN = CHAINS[5] | ||
|
||
export enum SequenceIndexerServices { | ||
MAINNET = "https://mainnet-indexer.sequence.app", | ||
|
||
POLYGON = "https://polygon-indexer.sequence.app", | ||
POLYGON_MUMBAI = "https://mumbai-indexer.sequence.app", | ||
|
||
POLYGON_ZKEVM = "https://polygon-zkevm-indexer.sequence.app", | ||
|
||
ARBITRUM = "https://arbitrum-indexer.sequence.app", | ||
ARBITRUM_NOVA = "https://arbitrum-nova-indexer.sequence.app", | ||
|
||
OPTIMISM = "https://optimism-indexer.sequence.app", | ||
AVALANCHE = "https://avalanche-indexer.sequence.app", | ||
GNOSIS = "https://gnosis-indexer.sequence.app", | ||
|
||
BSC = "https://bsc-indexer.sequence.app", | ||
BSC_TESTNET = "https://bsc-testnet-indexer.sequence.app", | ||
|
||
GOERLI = "https://goerli-indexer.sequence.app", | ||
} | ||
|
||
export const SEQUENCER_ENDPOINTS: Record<ChainId, SequenceIndexerServices> = { | ||
1: SequenceIndexerServices.MAINNET, | ||
5: SequenceIndexerServices.GOERLI, | ||
100: SequenceIndexerServices.GNOSIS, | ||
137: SequenceIndexerServices.POLYGON, | ||
80001: SequenceIndexerServices.POLYGON_MUMBAI, | ||
} | ||
export const DEFAULT_CHAIN = CHAINS[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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.container { | ||
overflow: hidden; | ||
border-radius: 50%; | ||
aspect-ratio: 1; | ||
} | ||
|
||
.container img { | ||
|
82 changes: 82 additions & 0 deletions
82
frontend/src/components/ChainSelect/ChainSelect.module.css
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,8 +1,90 @@ | ||
.button { | ||
height: 40px; | ||
padding: 5px 10px; | ||
border: none; | ||
background: none; | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
box-shadow: none; | ||
} | ||
|
||
.button:hover { | ||
background-color: var(--button-bg); | ||
filter: none; | ||
} | ||
|
||
.chevronDown { | ||
stroke: var(--text-color); | ||
width: 1em; | ||
padding-top: 3px; | ||
} | ||
.chevronDown.up { | ||
transform: rotate(180deg); | ||
} | ||
|
||
.icon { | ||
height: 100%; | ||
} | ||
|
||
.dropdownIcon { | ||
height: 100%; | ||
width: 15px; | ||
} | ||
|
||
.container { | ||
position: relative; | ||
} | ||
|
||
.dropdown { | ||
position: absolute; | ||
top: 50px; | ||
right: 0; | ||
background: rgb(248 212 226); | ||
border-radius: 10px; | ||
padding: 6px; | ||
min-width: 200px; | ||
z-index: 100; | ||
border: 2px solid var(--button-bg); | ||
box-shadow: 2px 2px 10px 0px rgba(150, 203, 0, 0.44); | ||
} | ||
|
||
.dropdown ul { | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
|
||
.dropdownItem { | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 8px; | ||
cursor: pointer; | ||
background: none; | ||
border: none; | ||
color: var(--text-color); | ||
padding: 10px 8px; | ||
border-radius: 10px; | ||
} | ||
|
||
.dropdownItem:hover { | ||
background-color: var(--button-bg); | ||
} | ||
|
||
.chain { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
} | ||
|
||
.checkmark { | ||
background-color: var(--box-bg); | ||
padding: 2px 4px; | ||
border-radius: 100px; | ||
stroke: var(--text-color); | ||
} |
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
23 changes: 23 additions & 0 deletions
23
frontend/src/components/ConnectButton/ConnectButton.module.css
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,23 @@ | ||
.container { | ||
position: relative; | ||
z-index: 100; | ||
} | ||
|
||
.blockie { | ||
height: 1.5em; | ||
} | ||
|
||
.button { | ||
height: 40px; | ||
padding: 0 10px; | ||
} | ||
.connectedButton { | ||
padding: 5px 10px 5px 5px; | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
} | ||
|
||
.connectedButton p { | ||
font-family: monospace; | ||
} |
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,61 @@ | ||
import { ConnectButton as RKConnectButton } from "@rainbow-me/rainbowkit" | ||
import clsx from "clsx" | ||
import Button from "../Button" | ||
import { shortenAddress } from "../../utils/shortenAddress" | ||
import Blockie from "../Blockie" | ||
import classes from "./ConnectButton.module.css" | ||
|
||
export const ConnectButton = () => { | ||
return ( | ||
<RKConnectButton.Custom> | ||
{({ account, chain, openAccountModal, openConnectModal, mounted }) => { | ||
const ready = mounted | ||
const connected = ready && account && chain | ||
|
||
return ( | ||
<div | ||
{...(!ready && { | ||
"aria-hidden": true, | ||
style: { | ||
opacity: 0, | ||
pointerEvents: "none", | ||
userSelect: "none", | ||
}, | ||
})} | ||
className={classes.container} | ||
> | ||
{(() => { | ||
if (!connected) { | ||
return ( | ||
<Button | ||
onClick={openConnectModal} | ||
secondary | ||
className={clsx(classes.button)} | ||
> | ||
Connect Wallet | ||
</Button> | ||
) | ||
} | ||
|
||
return ( | ||
<Button | ||
onClick={openAccountModal} | ||
secondary | ||
className={clsx(classes.button, classes.connectedButton)} | ||
> | ||
<Blockie | ||
address={account.address} | ||
className={classes.blockie} | ||
/> | ||
<p>{shortenAddress(account.address)}</p> | ||
</Button> | ||
) | ||
})()} | ||
</div> | ||
) | ||
}} | ||
</RKConnectButton.Custom> | ||
) | ||
} | ||
|
||
export default ConnectButton |
Oops, something went wrong.
00e9520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mech – ./
mech-gnosis-guild.vercel.app
mech-git-main-gnosis-guild.vercel.app
mech-omega.vercel.app
mech.mom
www.mech.mom