Skip to content

Commit

Permalink
fix: sepolia balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
TTNguyenDev committed Jan 31, 2024
1 parent 9ef3bd1 commit 02c5929
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
28 changes: 13 additions & 15 deletions ui/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const navigation = [
},
{
name: 'Buy $NATION',
href: `${balancerDomain}/#/ethereum/swap/ether/${nationToken}`,
href: `${balancerDomain}/swap/ether/${nationToken}`,
icon: <PlusIcon className="h-5 w-5" />,
},
{
Expand All @@ -78,7 +78,7 @@ export default function Layout({ children }: any) {
const router = useRouter()
const { connectors, connect, error: connectError, data: connectData } = useConnect()
const { address } = useAccount()

const { data: ensName } = useEnsName({ address: address ?? '' })
const { disconnect } = useDisconnect()
const [nav, setNav] = useState(navigation)
Expand Down Expand Up @@ -165,9 +165,8 @@ export default function Layout({ children }: any) {
{item.href.charAt(0) === '/' ? (
<Link href={item.href}>
<a
className={`py-4 ${
router.pathname == item.href ? 'active' : ''
}`}
className={`py-4 ${router.pathname == item.href ? 'active' : ''
}`}
>
{item.icon}
{item.name}
Expand All @@ -176,9 +175,8 @@ export default function Layout({ children }: any) {
</Link>
) : (
<a
className={`py-4 ${
router.pathname == item.href ? 'active' : ''
}`}
className={`py-4 ${router.pathname == item.href ? 'active' : ''
}`}
href={item.href}
target="_blank"
rel="noopener noreferrer"
Expand All @@ -201,9 +199,9 @@ export default function Layout({ children }: any) {
{ensName
? ensName
: `${((address as string) ?? '').substring(
0,
6
)}...${address.slice(-4)}`}
0,
6
)}...${address.slice(-4)}`}
<ChevronDownIcon className="h-5 w-5 absolute right-4 opacity-50" />
</label>
</li>
Expand Down Expand Up @@ -251,9 +249,9 @@ export default function Layout({ children }: any) {
{ensName
? ensName
: `${((address as string) ?? '').substring(
0,
6
)}...${((address as string) ?? '').slice(-4)}`}
0,
6
)}...${((address as string) ?? '').slice(-4)}`}
</a>
</li>

Expand Down Expand Up @@ -288,7 +286,7 @@ export default function Layout({ children }: any) {
<li key={connector.id}>
<button
disabled={!connector.ready}
onClick={() => connect({connector})}
onClick={() => connect({ connector })}
>
{(connectorIcons as Indexable)[connector.name] ? (
<div className="h-5 w-5">
Expand Down
7 changes: 4 additions & 3 deletions ui/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ interface Config {
nationPassportRequiredBalance: number
}


const chain = process.env.NEXT_PUBLIC_CHAIN || "goerli";
const defaultConfig = require(`../../contracts/deployments/${chain}.json`) as DeploymentConfig
const config: Config = {
nationToken: defaultConfig.nationToken || zeroAddress,
veNationToken: defaultConfig.veNationToken || zeroAddress,
balancerDomain: chain === 'goerli' ? 'https://goerli.balancer.fi' : 'https://app.balancer.fi',
balancerDomain: chain === 'mainnet' ? 'https://app.balancer.fi/#/ethereum' : `https://app.balancer.fi/#/${chain}`,
balancerVault: defaultConfig.balancerVault || zeroAddress,
balancerPoolId: defaultConfig.balancerPoolId || zeroAddress,
balancerLPToken: defaultConfig.balancerLPToken || zeroAddress,
etherscanDomain: chain === 'goerli' ? 'https://goerli.etherscan.io' : 'https://etherscan.io',
etherscanDomain: chain === 'mainnet' ? 'https://etherscan.io' : `https://${chain}.etherscan.io`,
lpRewardsContract: defaultConfig.lpRewardsContract || zeroAddress,
mobilePassportDomain: chain === 'goerli' ? 'https://mobile-passport-goerli.vercel.app' : 'https://passports.nation3.org',
mobilePassportDomain: chain === 'mainnet' ? 'https://passports.nation3.org' : `https://mobile-passport-${chain}.vercel.app`,
nationPassportNFT: defaultConfig.nationPassportNFT || zeroAddress,
nationPassportNFTIssuer: defaultConfig.nationPassportNFTIssuer || zeroAddress,
nationPassportAgreementStatement: defaultConfig.nationPassportAgreementStatement || "",
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function Index() {
</HomeCard>

<HomeCard
href={`${balancerDomain}/#/trade/ether/${nationToken}`}
href={`${balancerDomain}/trade/ether/${nationToken}`}
icon={<PlusIcon className="h-5 w-5 absolute right-8 text-n3blue" />}
title="Buy more $NATION"
linkText="Buy $NATION"
Expand Down

0 comments on commit 02c5929

Please sign in to comment.