From 75563ca8723c976ac72d40e7ba87019159d66e9a Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Fri, 18 Mar 2022 00:25:37 -0700 Subject: [PATCH] Insert a right sidebar on folds & contracts --- web/components/page.tsx | 9 +++--- web/pages/[username]/[contractSlug].tsx | 26 +++++++---------- web/pages/fold/[...slugs]/index.tsx | 37 ++++++++++++++----------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/web/components/page.tsx b/web/components/page.tsx index c8b44494..bda0ddd7 100644 --- a/web/components/page.tsx +++ b/web/components/page.tsx @@ -6,9 +6,10 @@ export function Page(props: { wide?: boolean margin?: boolean assertUser?: 'signed-in' | 'signed-out' + rightSidebar?: React.ReactNode children?: any }) { - const { wide, margin, assertUser, children } = props + const { wide, margin, assertUser, children, rightSidebar } = props return (
@@ -16,7 +17,7 @@ export function Page(props: {
-
{children}
+
{children}
diff --git a/web/pages/[username]/[contractSlug].tsx b/web/pages/[username]/[contractSlug].tsx index 1c321abc..3c0d0263 100644 --- a/web/pages/[username]/[contractSlug].tsx +++ b/web/pages/[username]/[contractSlug].tsx @@ -121,8 +121,17 @@ export default function ContractPage(props: { const ogCardProps = getOpenGraphProps(contract) + const rightSidebar = hasSidePanel ? ( + + {allowTrade && ( + + )} + {allowResolve && } + + ) : null + return ( - + {ogCardProps && ( - - {hasSidePanel && ( - <> -
- - - {allowTrade && ( - - )} - {allowResolve && ( - - )} - - - )} ) diff --git a/web/pages/fold/[...slugs]/index.tsx b/web/pages/fold/[...slugs]/index.tsx index c7ac014a..01c4a471 100644 --- a/web/pages/fold/[...slugs]/index.tsx +++ b/web/pages/fold/[...slugs]/index.tsx @@ -159,8 +159,28 @@ export default function FoldPage(props: { return } + const rightSidebar = ( + + + {isCurator ? ( + + ) : ( + + )} + + + + + ) + return ( - + - {isCurator ? ( - <EditFoldButton className="ml-1" fold={fold} /> - ) : ( - <FollowFoldButton className="ml-1" fold={fold} /> - )} </Row> <Col className="mb-6 gap-2 text-gray-500 md:hidden"> @@ -259,16 +274,6 @@ export default function FoldPage(props: { <SearchableGrid contracts={contracts} /> )} </Col> - <Col className="hidden w-full max-w-xs gap-12 md:flex"> - <FoldOverview fold={fold} curator={curator} /> - <FoldLeaderboards - traderScores={traderScores} - creatorScores={creatorScores} - topTraders={topTraders} - topCreators={topCreators} - user={user} - /> - </Col> </Row> )}