-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work on the create pool page, and refine the UI
- Loading branch information
1 parent
231b5dc
commit 9059316
Showing
22 changed files
with
460 additions
and
148 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import CreatePools from "./src/assets/CreatePools.png"; | ||
import SupplyLiquidity from "./src/assets/SupplyLiquidity.png"; | ||
import Swap from "./src/assets/Swap.png"; | ||
import BAT from "./src/assets/supportedTokens/BAT.png"; | ||
import LINK from "./src/assets/supportedTokens/LINK.png"; | ||
import USDC from "./src/assets/supportedTokens/USDC.png"; | ||
import WETH from "./src/assets/supportedTokens/WETH.png"; | ||
import TokenAvatar from "./src/components/TokenAvatar"; | ||
|
||
const supportedTokens = { | ||
weth: { name: "WETH", avatar: <TokenAvatar icon={WETH} /> }, | ||
link: { name: "LINK", avatar: <TokenAvatar icon={LINK} /> }, | ||
bat: { name: "BAT", avatar: <TokenAvatar icon={BAT} /> }, | ||
usdc: { name: "USDC", avatar: <TokenAvatar icon={USDC} /> }, | ||
}; | ||
|
||
const features = [ | ||
{ | ||
img: SupplyLiquidity, | ||
title: "Supply Pools with Liquidity", | ||
description: | ||
"Effortlessly supply liquidity to existing liquidity pools and receive LP tokens which earn attractive fees in active markets", | ||
linkTo: "/supplyLiquidity", | ||
text: "supply", | ||
}, | ||
{ | ||
img: Swap, | ||
title: "Swap or Flash Swap Tokens", | ||
description: | ||
"Swap one token for another in any of the available liquidity pools for a very minimal fee. Additionally, Thunder Swap users can leverage flash swaps and use hooks to fine tune their trading strategy", | ||
linkTo: "/swap", | ||
text: "swap", | ||
}, | ||
{ | ||
img: CreatePools, | ||
title: "Create New Pools", | ||
description: | ||
"Permissionlessly create new liquidity pools for supported tokens if one does not exist already", | ||
linkTo: "/createPool", | ||
text: "create pool", | ||
}, | ||
]; | ||
|
||
export { supportedTokens, features }; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ArrowForwardIcon } from "@chakra-ui/icons"; | ||
import { Box, Link as ChakraLink, Heading, Image, Text, VStack } from "@chakra-ui/react"; | ||
import { Link } from "react-router-dom"; | ||
|
||
import ButtonVariant from "./buttons/ButtonVariant"; | ||
|
||
export default function Feature({ img, title, description, linkTo, text }) { | ||
return ( | ||
<Box maxW="70ch" mx="auto" px={8} pt={24}> | ||
<VStack color="gray.900" textAlign="center"> | ||
<Image maxW={300} mb={3} src={img} /> | ||
<Heading as="h2" fontSize={28} letterSpacing="-0.1px" mb={3}> | ||
{title} | ||
</Heading> | ||
<Text mb={5}>{description}</Text> | ||
<ChakraLink as={Link} to={linkTo}> | ||
<ButtonVariant | ||
colorScheme="pink" | ||
IconType={ArrowForwardIcon} | ||
onButtonClicked={() => {}} | ||
text={text} | ||
variant="outline" | ||
/> | ||
</ChakraLink> | ||
</VStack> | ||
</Box> | ||
); | ||
} |
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,54 +1,54 @@ | ||
import { Flex, Heading, Hide } from "@chakra-ui/react"; | ||
import { Box, Flex, HStack, Heading, Hide } from "@chakra-ui/react"; | ||
|
||
import Button from "./Button"; | ||
import ThunderSwap from "../../public/thunder-swap.png"; | ||
import shortenAddress from "../utils/shortenAddress"; | ||
import InfoChip from "./InfoChip"; | ||
import NavBar from "./NavBar"; | ||
import SmallScreenMenu from "./SmallScreenMenu"; | ||
import TokenAvatar from "./TokenAvatar"; | ||
import Button from "./buttons/Button"; | ||
import NavBar from "./nav/NavBar"; | ||
|
||
export default function Header({ account, onMetaMaskConnect, onMetaMaskDisconnect }) { | ||
const accountPrefixLength = 5; | ||
const accountSuffixLength = 3; | ||
const text = account | ||
? account.substr(0, accountPrefixLength) + | ||
"..." + | ||
account.substr(account.length - 1 - accountSuffixLength, accountSuffixLength) | ||
: "Not Connected"; | ||
let connectDisconnectButton; | ||
|
||
if (!account) | ||
connectDisconnectButton = ( | ||
<Button | ||
colorScheme="pink" | ||
onButtonClicked={onMetaMaskConnect} | ||
text="Connect" | ||
variant="solid" | ||
/> | ||
); | ||
else | ||
connectDisconnectButton = ( | ||
<Button | ||
colorScheme="pink" | ||
onButtonClicked={onMetaMaskDisconnect} | ||
text="Disconnect" | ||
variant="outline" | ||
/> | ||
); | ||
const text = account ? shortenAddress(account) : "Not Connected"; | ||
|
||
return ( | ||
<Flex alignItems="center" gap={6} maxWidth="1270px" mx="auto" px={8} py={8}> | ||
<Heading as="h1" color="gray.800" letterSpacing="-0.1px" size="lg"> | ||
Thunder Swap | ||
</Heading> | ||
<NavBar /> | ||
<Flex alignItems="center" gap={3} ml={{ sm: "auto", md: "auto", lg: "0", xl: "0" }}> | ||
<Hide below="lg"> | ||
<InfoChip text={text} actualText={account} /> | ||
</Hide> | ||
{connectDisconnectButton} | ||
<Hide above="lg"> | ||
<SmallScreenMenu account={account} /> | ||
</Hide> | ||
<Box> | ||
<Flex alignItems="center" gap={6} maxWidth="1270px" mx="auto" px={8} py={8}> | ||
<HStack spacing={1}> | ||
<TokenAvatar icon={ThunderSwap} /> | ||
<Heading as="h1" color="gray.800" letterSpacing="-0.1px" size="lg"> | ||
Thunder Swap | ||
</Heading> | ||
</HStack> | ||
<NavBar /> | ||
<Flex | ||
alignItems="center" | ||
gap={3} | ||
ml={{ base: "auto", sm: "auto", md: "auto", lg: "0", xl: "0", "2xl": "0" }} | ||
> | ||
<Hide below="lg"> | ||
<InfoChip text={text} actualText={account} /> | ||
</Hide> | ||
{account ? ( | ||
<Button | ||
colorScheme="pink" | ||
onButtonClicked={onMetaMaskDisconnect} | ||
text="Disconnect" | ||
variant="outline" | ||
/> | ||
) : ( | ||
<Button | ||
colorScheme="pink" | ||
onButtonClicked={onMetaMaskConnect} | ||
text="Connect" | ||
variant="solid" | ||
/> | ||
)} | ||
<Hide above="lg"> | ||
<SmallScreenMenu account={account} /> | ||
</Hide> | ||
</Flex> | ||
</Flex> | ||
</Flex> | ||
</Box> | ||
); | ||
} |
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,5 +1,5 @@ | ||
import { Avatar } from "@chakra-ui/react"; | ||
import { Image } from "@chakra-ui/react"; | ||
|
||
export default function TokenAvatar({ icon }) { | ||
return <Avatar size="md" src={icon} />; | ||
return <Image src={icon} maxW={8} />; | ||
} |
6 changes: 4 additions & 2 deletions
6
client/src/components/Button.jsx → client/src/components/buttons/Button.jsx
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Button } from "@chakra-ui/react"; | ||
|
||
export default function ButtonVariant({ colorScheme, IconType, onButtonClicked, text, variant }) { | ||
return ( | ||
<Button | ||
colorScheme={colorScheme} | ||
onClick={() => onButtonClicked()} | ||
py={{ base: "20px" }} | ||
rightIcon={<IconType />} | ||
size={{ base: "sm", sm: "md", md: "lg", lg: "lg", xl: "lg", "2xl": "lg" }} | ||
textTransform="uppercase" | ||
variant={variant} | ||
> | ||
{text} | ||
</Button> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Button as ChakraButton } from "@chakra-ui/react"; | ||
|
||
export default function Button({ colorScheme, onButtonClicked, text, variant }) { | ||
return ( | ||
<ChakraButton | ||
colorScheme={colorScheme} | ||
onClick={() => onButtonClicked()} | ||
py={{ base: "20px" }} | ||
size={{ base: "sm", sm: "md", md: "lg", lg: "lg", xl: "lg", "2xl": "lg" }} | ||
textTransform="uppercase" | ||
variant={variant} | ||
w="full" | ||
> | ||
{text} | ||
</ChakraButton> | ||
); | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
* { | ||
font-family: RobotoRegular; | ||
} | ||
} |
Oops, something went wrong.