From 9a4d68e836e11d5c1d326252f7b7ba873f3d061a Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Mon, 6 Nov 2023 21:31:25 +0100 Subject: [PATCH 1/3] add mobile nav --- components/ConnectButton.tsx | 116 +++++++++++++++++++++- components/hyperboard/ownership-table.tsx | 8 +- components/layout/header.tsx | 105 +++++++++++++++++++- fonts.tsx | 4 +- package.json | 1 + theme.ts | 28 ++++-- yarn.lock | 5 + 7 files changed, 250 insertions(+), 17 deletions(-) diff --git a/components/ConnectButton.tsx b/components/ConnectButton.tsx index ee3ce3b..044db6e 100644 --- a/components/ConnectButton.tsx +++ b/components/ConnectButton.tsx @@ -1,4 +1,114 @@ -import { ConnectButton as RainbowKitConnectButton } from "@rainbow-me/rainbowkit"; -export const ConnectButton = () => { - return ; +import { ConnectButton as ConnectButtonInternal } from "@rainbow-me/rainbowkit"; +import { Button, ButtonProps } from "@chakra-ui/react"; + +export const ConnectButton = ({ ...buttonProps }: ButtonProps) => { + return ( + + {({ + account, + chain, + openAccountModal, + openChainModal, + openConnectModal, + authenticationStatus, + mounted, + }) => { + // Note: If your app doesn't use authentication, you + // can remove all 'authenticationStatus' checks + const ready = mounted && authenticationStatus !== "loading"; + const connected = + ready && + account && + chain && + (!authenticationStatus || authenticationStatus === "authenticated"); + + return ( +
+ {(() => { + if (!connected) { + return ( + + ); + } + + if (chain.unsupported) { + return ( + + ); + } + + return ( +
+ + + +
+ ); + })()} +
+ ); + }} +
+ ); }; diff --git a/components/hyperboard/ownership-table.tsx b/components/hyperboard/ownership-table.tsx index ce274f4..372a85b 100644 --- a/components/hyperboard/ownership-table.tsx +++ b/components/hyperboard/ownership-table.tsx @@ -124,7 +124,7 @@ export const OwnershipTable = ({ py={10} > - hyperboard ownership + {selectedClaim ? "hypercert ownership" : "hyperboard ownership"} )} @@ -139,6 +139,7 @@ export const OwnershipTable = ({ border={"1px solid black"} borderRight={"none"} overflowY={"auto"} + className={"custom-scrollbar"} > {data.map((registry, index) => { const isRegistrySelected = @@ -213,6 +214,7 @@ export const OwnershipTable = ({ border={"1px solid black"} borderLeft={"none"} overflowY={"auto"} + className={"custom-scrollbar"} > @@ -243,9 +245,11 @@ const RegistryRow = ({ }) => { return ( { return ( { width={"100%"} height={headerHeight} alignItems={"center"} - paddingX={"40px"} + paddingX={[0, 0, "40px"]} backgroundColor={"grey.300"} borderBottom={"1px solid"} > @@ -30,15 +34,106 @@ export const Header = () => { Hyperboards - + + + - - - + + + + + + + + + + + + ); +}; + +const MobileMenuButton = () => { + const [isOpen, setOpen] = React.useState(true); + return ( + + setOpen(toggled)} toggled={isOpen} /> + {isOpen && ( + + setOpen(false)} /> + + )} ); }; +const MobileMenuContent = ({ + onClickOutside, +}: { + onClickOutside: () => void; +}) => { + return ( + { + e.stopPropagation(); + onClickOutside(); + }} + minHeight={`calc(100vh - ${headerHeight})`} + backgroundColor={"rgba(0, 0, 0, 0.2)"} + position={"relative"} + top={0} + zIndex={1} + > + + + + + + + + + + + ); +}; + +const MobileMenuLink = ({ href, text }: { href: string; text: string }) => { + return ( + + + {text} + + + ); +}; + const BrowseMenu = () => { const width = "250px"; return ( diff --git a/fonts.tsx b/fonts.tsx index db0454d..cd43172 100644 --- a/fonts.tsx +++ b/fonts.tsx @@ -7,7 +7,7 @@ const Fonts = () => ( font-style: normal; font-weight: 100 900; font-display: optional; - src: url(./fonts/Director-Regular.woff2) format("woff2"); + src: url(/fonts/Director-Regular.woff2) format("woff2"); } @font-face { @@ -15,7 +15,7 @@ const Fonts = () => ( font-style: normal; font-weight: 100 900; font-display: optional; - src: url(./fonts/Director-Variable.woff2) format("woff2"); + src: url(/fonts/Director-Variable.woff2) format("woff2"); } `} /> diff --git a/package.json b/package.json index df8d950..ebc3072 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "eslint": "8.48.0", "eslint-config-next": "13.4.19", "framer-motion": "^10.16.2", + "hamburger-react": "^2.5.0", "html2canvas": "^1.4.1", "jsonwebtoken": "^9.0.2", "lodash": "^4.17.21", diff --git a/theme.ts b/theme.ts index 06ff844..e5a3dc5 100644 --- a/theme.ts +++ b/theme.ts @@ -1,9 +1,29 @@ -import { extendTheme, ThemeOverride } from "@chakra-ui/react"; +import { + defineStyleConfig, + extendTheme, + ThemeOverride, +} from "@chakra-ui/react"; export const colors = { background: "#F1F1F1", }; +const Button = defineStyleConfig({ + baseStyle: { + borderRadius: "0", + color: "white", + background: "none", + }, + variants: { + blackAndWhite: { + color: "white", + background: "black", + borderRadius: 16, + }, + }, + defaultProps: {}, +}); + export const theme: ThemeOverride = extendTheme({ fonts: { heading: `'Director-Variable', sans-serif`, @@ -25,11 +45,7 @@ export const theme: ThemeOverride = extendTheme({ }, lineHeights: {}, components: { - Button: { - baseStyle: { - borderRadius: "0", - }, - }, + Button, Input: { baseStyle: { field: { diff --git a/yarn.lock b/yarn.lock index 6c9977c..d8295d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10216,6 +10216,11 @@ graphql@^16.6.0: resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.0.tgz#374478b7f27b2dc6153c8f42c1b80157f79d79d4" integrity sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg== +hamburger-react@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hamburger-react/-/hamburger-react-2.5.0.tgz#7c0148af8f02f3b693564d69e590d02db8ffc221" + integrity sha512-5GSXe+ucxTPJ0SkhIsPQ/PRDweZPIKya1lfahAuExx31SdheeUA4uOPfQIAirbKona8hvo79VDr5LJQzPXsdpw== + hamt-sharding@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/hamt-sharding/-/hamt-sharding-2.0.1.tgz#f45686d0339e74b03b233bee1bde9587727129b6" From 4b1fb68b4274f65a3f061701383720d954dadc88 Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Mon, 6 Nov 2023 21:49:58 +0100 Subject: [PATCH 2/3] add profile info --- components/ConnectButton.tsx | 2 +- components/layout/header.tsx | 52 ++++++++++++++++++++++++++++++++++-- theme.ts | 6 +++++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/components/ConnectButton.tsx b/components/ConnectButton.tsx index 044db6e..6793ebe 100644 --- a/components/ConnectButton.tsx +++ b/components/ConnectButton.tsx @@ -64,7 +64,7 @@ export const ConnectButton = ({ ...buttonProps }: ButtonProps) => {