From 7a4460e9b9be68bd09d1f2a9a52cc11b654d5fa7 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 22 Feb 2023 20:52:00 +0300 Subject: [PATCH 1/5] Include Creator Income Dashboard link on the sidebar --- components/IncomeDashboardDisclaimer.tsx | 79 ++++++++++++++++++++++++ components/Sidebar.tsx | 70 ++++++++++++++------- 2 files changed, 127 insertions(+), 22 deletions(-) create mode 100644 components/IncomeDashboardDisclaimer.tsx diff --git a/components/IncomeDashboardDisclaimer.tsx b/components/IncomeDashboardDisclaimer.tsx new file mode 100644 index 0000000..5ecd53c --- /dev/null +++ b/components/IncomeDashboardDisclaimer.tsx @@ -0,0 +1,79 @@ +import { useRef, useState } from 'react' + +import { Button } from './Button' + +export interface IncomeDashboardDisclaimerProps { + creatorAddress: string +} +export const IncomeDashboardDisclaimer = (props: IncomeDashboardDisclaimerProps) => { + const [isChecked, setIsChecked] = useState(false) + const checkBoxRef = useRef(null) + + const handleCheckBox = () => { + checkBoxRef.current?.click() + } + + return ( +
+ + +
+ ) +} diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 5e44882..c479f64 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -1,3 +1,5 @@ +/* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable no-nested-ternary */ import clsx from 'clsx' import { Anchor } from 'components/Anchor' import { useWallet } from 'contexts/wallet' @@ -5,7 +7,8 @@ import { useRouter } from 'next/router' // import BrandText from 'public/brand/brand-text.svg' import { footerLinks, socialsLinks } from 'utils/links' -import { BASE_FACTORY_ADDRESS } from '../utils/constants' +import { BASE_FACTORY_ADDRESS, NETWORK } from '../utils/constants' +import { IncomeDashboardDisclaimer } from './IncomeDashboardDisclaimer' import { SidebarLayout } from './SidebarLayout' import { WalletLoader } from './WalletLoader' @@ -14,6 +17,7 @@ const routes = [ { text: 'Create a Collection', href: `/collections/create/`, isChild: true }, { text: 'My Collections', href: `/collections/myCollections/`, isChild: true }, { text: 'Collection Actions', href: `/collections/actions/`, isChild: true }, + { text: 'Creator Income Dashboard', href: `/collections/actions/`, isChild: true }, { text: 'Contract Dashboards', href: `/contracts/`, isChild: false }, { text: 'Base Minter Contract', href: `/contracts/baseMinter/`, isChild: true }, { text: 'Vending Minter Contract', href: `/contracts/vendingMinter/`, isChild: true }, @@ -40,27 +44,49 @@ export const Sidebar = () => { {/* wallet button */} {/* main navigation routes */} - {tempRoutes.map(({ text, href, isChild }) => ( - - {text} - - ))} + {tempRoutes.map(({ text, href, isChild }) => + text !== 'Creator Income Dashboard' ? ( + + {text === 'Creator Income Dashboard' &&
{text}
} + {text} +
+ ) : NETWORK === 'mainnet' ? ( + + ) : null, + )} + +
From e8175c3da2f0aded8a63cc40f7a5132759efed17 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 22 Feb 2023 20:57:51 +0300 Subject: [PATCH 2/5] Update disclaimer modal ID --- components/IncomeDashboardDisclaimer.tsx | 6 +++--- components/Sidebar.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/IncomeDashboardDisclaimer.tsx b/components/IncomeDashboardDisclaimer.tsx index 5ecd53c..d45754d 100644 --- a/components/IncomeDashboardDisclaimer.tsx +++ b/components/IncomeDashboardDisclaimer.tsx @@ -15,8 +15,8 @@ export const IncomeDashboardDisclaimer = (props: IncomeDashboardDisclaimerProps) return (
- -