-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the use of
VStack
, HStack
and Flex
The Stack component and the Flex component have their children spaced out evenly but the key difference is that the Stack won't span the entire width of the container whereas the Flex will. Let's use the Stack component when it is a simple row or column of items. If we need to customize the items let's use Flex. More info: https://chakra-ui.com/docs/components/stack#notes-on-stack-vs-flex
- Loading branch information
1 parent
0abcd5d
commit fc4bd5b
Showing
4 changed files
with
20 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import React from "react" | ||
import { Box, Button, HStack, Icon, Switch } from "@chakra-ui/react" | ||
import { Button, Flex, Icon, Switch } from "@chakra-ui/react" | ||
import ConnectWallet from "./ConnectWallet" | ||
import { ChevronRight } from "../../static/icons" | ||
import { USD } from "../../constants" | ||
|
||
export default function Navbar() { | ||
return ( | ||
<Box mb={4}> | ||
<HStack justifyContent="end"> | ||
<Flex gap={4} direction="column"> | ||
<Flex justifyContent="end"> | ||
<ConnectWallet /> | ||
</HStack> | ||
<HStack mt={8} justifyContent="space-between"> | ||
</Flex> | ||
<Flex justifyContent="space-between"> | ||
{/* TODO: Handle click actions */} | ||
<Switch size="sm">Show values in {USD.symbol}</Switch> | ||
<Button variant="link" rightIcon={<Icon as={ChevronRight} />}> | ||
Read documentation | ||
</Button> | ||
</HStack> | ||
</Box> | ||
</Flex> | ||
</Flex> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters