forked from aptos-labs/aptos-core
-
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.
Adding error states for transfer, account page
Closes: aptos-labs#750
- Loading branch information
Showing
14 changed files
with
583 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) Aptos | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { chakra } from '@chakra-ui/react' | ||
import { Link } from 'react-router-dom' | ||
|
||
const ChakraLink = chakra(Link) | ||
|
||
export default ChakraLink |
43 changes: 43 additions & 0 deletions
43
ecosystem/web-wallet/src/components/CreateWalletHeader.tsx
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,43 @@ | ||
// Copyright (c) Aptos | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { ChevronLeftIcon } from '@chakra-ui/icons' | ||
import { Center, Grid, IconButton, Text, useColorMode } from '@chakra-ui/react' | ||
import React from 'react' | ||
import ChakraLink from './ChakraLink' | ||
|
||
const secondaryHeaderBgColor = { | ||
light: 'gray.200', | ||
dark: 'gray.700' | ||
} | ||
|
||
export const seconaryAddressFontColor = { | ||
light: 'gray.500', | ||
dark: 'gray.400' | ||
} | ||
|
||
export default function CreateWalletHeader () { | ||
const { colorMode } = useColorMode() | ||
|
||
return ( | ||
<Center | ||
maxW="100%" | ||
width="100%" | ||
py={2} | ||
bgColor={secondaryHeaderBgColor[colorMode]} | ||
> | ||
<Grid templateColumns="32px 1fr 32px" px={4} width="100%" gap={4}> | ||
<ChakraLink to="/"> | ||
<IconButton size="xs" borderRadius="full" aria-label="go back" icon={<ChevronLeftIcon fontSize="md" />} /> | ||
</ChakraLink> | ||
<Text | ||
fontSize="md" | ||
textAlign="center" | ||
> | ||
Create Wallet | ||
</Text> | ||
<></> | ||
</Grid> | ||
</Center> | ||
) | ||
} |
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,42 @@ | ||
// Copyright (c) Aptos | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { ChevronLeftIcon } from '@chakra-ui/icons' | ||
import { Center, Grid, IconButton, Text, useColorMode } from '@chakra-ui/react' | ||
import React from 'react' | ||
import ChakraLink from './ChakraLink' | ||
|
||
const secondaryHeaderBgColor = { | ||
light: 'gray.200', | ||
dark: 'gray.700' | ||
} | ||
|
||
export const seconaryAddressFontColor = { | ||
light: 'gray.500', | ||
dark: 'gray.400' | ||
} | ||
|
||
export default function HelpHeader () { | ||
const { colorMode } = useColorMode() | ||
|
||
return ( | ||
<Center | ||
maxW="100%" | ||
width="100%" | ||
py={2} | ||
bgColor={secondaryHeaderBgColor[colorMode]} | ||
> | ||
<Grid templateColumns="32px 1fr 32px" px={4} width="100%" gap={4}> | ||
<ChakraLink to="/"> | ||
<IconButton size="xs" borderRadius="full" aria-label="go back" icon={<ChevronLeftIcon fontSize="md" />} /> | ||
</ChakraLink> | ||
<Text | ||
fontSize="md" | ||
textAlign="center" | ||
> | ||
Help | ||
</Text> | ||
</Grid> | ||
</Center> | ||
) | ||
} |
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,63 @@ | ||
|
||
// Copyright (c) Aptos | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Center, IconButton, SimpleGrid, useColorMode } from '@chakra-ui/react' | ||
import { IoIosPerson } from 'react-icons/io' | ||
import { RiCopperCoinFill } from 'react-icons/ri' | ||
import React from 'react' | ||
import ChakraLink from './ChakraLink' | ||
import { useLocation } from 'react-router-dom' | ||
|
||
const secondaryHeaderBgColor = { | ||
light: 'gray.200', | ||
dark: 'gray.700' | ||
} | ||
|
||
const secondaryIconColor = { | ||
light: 'gray.800', | ||
dark: 'white' | ||
} | ||
|
||
export default function WalletFooter () { | ||
const { colorMode } = useColorMode() | ||
const { pathname } = useLocation() | ||
|
||
return ( | ||
<Center | ||
maxW="100%" | ||
width="100%" | ||
py={2} | ||
bgColor={secondaryHeaderBgColor[colorMode]} | ||
> | ||
<SimpleGrid width="100%" gap={4} columns={2}> | ||
<Center width="100%"> | ||
<ChakraLink to="/wallet"> | ||
<IconButton | ||
color={(pathname === '/wallet') ? 'blue.400' : secondaryIconColor[colorMode] } | ||
variant="unstyled" | ||
size="md" | ||
aria-label="" | ||
fontSize="xl" | ||
icon={<RiCopperCoinFill />} | ||
display="flex" | ||
/> | ||
</ChakraLink> | ||
</Center> | ||
<Center width="100%"> | ||
<ChakraLink to="/account"> | ||
<IconButton | ||
color={(pathname === '/account') ? 'blue.400' : secondaryIconColor[colorMode] } | ||
variant="unstyled" | ||
size="md" | ||
aria-label="go back" | ||
icon={<IoIosPerson />} | ||
fontSize="xl" | ||
display="flex" | ||
/> | ||
</ChakraLink> | ||
</Center> | ||
</SimpleGrid> | ||
</Center> | ||
) | ||
} |
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
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
Oops, something went wrong.