Skip to content

Commit dabfa13

Browse files
authored
Put HotWallet infos in new page (#117)
* Put HotWallet infos in new page
1 parent 444fe8b commit dabfa13

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

components/NavBar.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
1+
import useQueryContext from '@hooks/useQueryContext';
2+
import useRealm from '@hooks/useRealm';
3+
import { useRouter } from 'next/router';
14
import ConnectWalletButton from './ConnectWalletButton';
25

36
const NavBar = () => {
7+
const { symbol } = useRealm();
8+
const { fmtUrlWithCluster } = useQueryContext();
9+
10+
const router = useRouter();
11+
12+
const isDashboardPage = router.pathname.includes('dashboard');
13+
414
return (
515
<div className="grid grid-cols-12 mb-3">
616
<div className="col-span-12 xl:col-start-2 xl:col-span-10 flex h-20 items-center justify-between px-4 md:px-8 xl:px-4">
717
<div className="flex items-center">
818
<img src="/img/solana-logo.svg" className="h-8 mr-3" />
919
</div>
1020

21+
<div className="flex flex-wrap justify-center items-center">
22+
<button
23+
className={`"ml-4 mr-4 mt-1.5 mb-1.5 text-white pl-4 pt pr-4 pb ${
24+
isDashboardPage ? '' : 'border border-fgd-3'
25+
}"`}
26+
onClick={() => {
27+
router.push(fmtUrlWithCluster(`/dao/${symbol}`));
28+
}}
29+
>
30+
Vote
31+
</button>
32+
33+
<button
34+
className={`"ml-4 mr-4 mt-1.5 mb-1.5 text-white pl-4 pt pr-4 pb ${
35+
isDashboardPage ? 'border border-fgd-3' : ''
36+
}"`}
37+
onClick={() => {
38+
router.push(fmtUrlWithCluster(`/dao/${symbol}/dashboard`));
39+
}}
40+
>
41+
Dashboard
42+
</button>
43+
</div>
44+
1145
<ConnectWalletButton />
1246
</div>
1347
</div>

pages/dao/[symbol]/dashboard.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import useRealm from 'hooks/useRealm';
2+
import React from 'react';
3+
import HotWallet from '@components/HotWallet/HotWallet';
4+
5+
const Dashboard = () => {
6+
const { realm } = useRealm();
7+
8+
if (!realm) {
9+
return null;
10+
}
11+
12+
return <HotWallet />;
13+
};
14+
15+
export default Dashboard;

pages/dao/[symbol]/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import TokenBalanceCardWrapper from '@components/TokenBalance/TokenBalanceCardWr
1717
import dynamic from 'next/dynamic';
1818
import Loading from '@components/Loading';
1919
import PaginationComponent from '@components/Pagination';
20-
import HotWallet from '@components/HotWallet/HotWallet';
2120
import SearchInput from '@components/SearchInput';
2221
const AccountsCompactWrapper = dynamic(
2322
() => import('@components/TreasuryAccount/AccountsCompactWrapper'),
@@ -256,8 +255,6 @@ const REALM = () => {
256255
<>
257256
{connected && <TokenBalanceCardWrapper />}
258257

259-
<HotWallet />
260-
261258
<NFTSCompactWrapper />
262259

263260
{!realm?.account.config.useCommunityVoterWeightAddin && (

pages/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ const Index = () => {
44
const router = useRouter();
55

66
useEffect(() => {
7-
const { REALM } = process.env;
8-
const mainUrl = REALM ? `/dao/${REALM}` : '/realms';
9-
router.replace(mainUrl);
7+
// Default page
8+
router.replace('/dao/UXP');
109
}, []);
1110

1211
return null;

0 commit comments

Comments
 (0)