Skip to content

Commit

Permalink
refactor: wrap for small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopajarino committed Dec 28, 2024
1 parent 68f7ca6 commit 0fe57ac
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions apps/dashboard/src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { shortenAddress } from "@bandada/utils"
import { Button, Container, Heading, HStack, Image } from "@chakra-ui/react"
import {
Button,
Container,
Heading,
HStack,
Image,
useMediaQuery
} from "@chakra-ui/react"
import { useAccountModal, useConnectModal } from "@rainbow-me/rainbowkit"
import { useCallback, useContext } from "react"
import { useAccount } from "wagmi"
Expand All @@ -25,10 +32,13 @@ export default function NavBar(): JSX.Element {
[address, admin]
)

const [isWideScreen] = useMediaQuery("(min-width: 426px)")

return (
<Container maxWidth="container.xl">
<HStack
pt="80px"
wrap="wrap"
pb="40px"
align="center"
justify="space-between"
Expand Down Expand Up @@ -74,9 +84,7 @@ export default function NavBar(): JSX.Element {
{!isLoggedInAdmin()
? "Unconnected account"
: `${
window.screen.availWidth > 375
? "Connected as"
: ""
isWideScreen ? "Connected as" : ""
} ${shortenAddress(address as string)}`}
</Button>
</HStack>
Expand Down

0 comments on commit 0fe57ac

Please sign in to comment.