Commit 124e2e47 authored by isstuev's avatar isstuev

redesign fixes 2

parent ffb25aa1
...@@ -18,7 +18,7 @@ export const watchlist = [ ...@@ -18,7 +18,7 @@ export const watchlist = [
notification: false, notification: false,
}, },
{ {
address: '0x8c461F78760988c4135e363a87dd736f8b671ff1', address: '0x930F381E649c84579Ef58117E923714964C55D16',
tokenBalance: 200.2, tokenBalance: 200.2,
tokenBalanceUSD: 202.4, tokenBalanceUSD: 202.4,
totalUSD: 3000.5, totalUSD: 3000.5,
......
...@@ -31,6 +31,38 @@ const Button: ComponentStyleConfig = { ...@@ -31,6 +31,38 @@ const Button: ComponentStyleConfig = {
opacity: 0.2, opacity: 0.2,
}, },
}, },
iconBlue: {
color: 'blue.600',
_hover: {
color: 'blue.400',
},
},
},
sizes: {
lg: {
h: 12,
minW: 'unset',
fontSize: 'lg',
px: 6,
},
md: {
h: 10,
minW: 'unset',
fontSize: 'md',
px: 4,
},
sm: {
h: 8,
minW: 'unset',
fontSize: 'sm',
px: 3,
},
xs: {
h: 6,
minW: 'unset',
fontSize: 'xs',
px: 2,
},
}, },
} }
......
...@@ -14,7 +14,6 @@ const getActiveInputStyles = (theme: Dict, fc: string) => ({ ...@@ -14,7 +14,6 @@ const getActiveInputStyles = (theme: Dict, fc: string) => ({
paddingTop: '30px', paddingTop: '30px',
paddingBottom: '10px', paddingBottom: '10px',
borderColor: getColor(theme, fc), borderColor: getColor(theme, fc),
boxShadow: 'none',
}) })
const variantFloating: PartsStyleFunction<typeof parts> = (props: StyleFunctionProps) => { const variantFloating: PartsStyleFunction<typeof parts> = (props: StyleFunctionProps) => {
......
...@@ -42,7 +42,7 @@ const variantOutline: PartsStyleFunction<typeof parts> = (props) => { ...@@ -42,7 +42,7 @@ const variantOutline: PartsStyleFunction<typeof parts> = (props) => {
_focusVisible: { _focusVisible: {
zIndex: 1, zIndex: 1,
borderColor: getColor(theme, fc), borderColor: getColor(theme, fc),
boxShadow: `none`, boxShadow: '0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)',
}, },
}, },
addon: { addon: {
......
...@@ -18,6 +18,7 @@ const Modal: ComponentMultiStyleConfig = { ...@@ -18,6 +18,7 @@ const Modal: ComponentMultiStyleConfig = {
padding: 0, padding: 0,
marginBottom: 8, marginBottom: 8,
fontSize: '2xl', fontSize: '2xl',
lineHeight: 10,
}, },
body: { body: {
padding: 0, padding: 0,
...@@ -25,11 +26,16 @@ const Modal: ComponentMultiStyleConfig = { ...@@ -25,11 +26,16 @@ const Modal: ComponentMultiStyleConfig = {
}, },
footer: { footer: {
padding: 0, padding: 0,
justifyContent: 'flex-start',
}, },
closeButton: { closeButton: {
top: '40px', top: 8,
right: '40px', right: 8,
color: 'blue.500', height: 10,
width: 10,
color: 'gray.700',
_hover: { color: 'blue.400' },
_active: { bg: 'none' },
}, },
}, },
} }
......
...@@ -8,6 +8,7 @@ const Table: ComponentMultiStyleConfig = { ...@@ -8,6 +8,7 @@ const Table: ComponentMultiStyleConfig = {
}, },
th: { th: {
textTransform: 'none', textTransform: 'none',
fontFamily: 'body',
fontWeight: 'normal', fontWeight: 'normal',
overflow: 'hidden', overflow: 'hidden',
color: 'gray.500', color: 'gray.500',
......
import type { ComponentStyleConfig } from '@chakra-ui/theme';
const Tooltip: ComponentStyleConfig = {
baseStyle: {
maxWidth: 'unset',
},
}
export default Tooltip;
...@@ -4,6 +4,7 @@ import Table from './Table'; ...@@ -4,6 +4,7 @@ import Table from './Table';
import Form from './Form'; import Form from './Form';
import Input from './Input'; import Input from './Input';
import Tag from './Tag'; import Tag from './Tag';
import Tooltip from './Tooltip';
const components = { const components = {
Button, Button,
...@@ -12,6 +13,7 @@ const components = { ...@@ -12,6 +13,7 @@ const components = {
Input, Input,
Form, Form,
Tag, Tag,
Tooltip,
} }
export default components; export default components;
import { extendTheme } from '@chakra-ui/react'; import { extendTheme, Tooltip } from '@chakra-ui/react';
import typography from './foundations/typography'; import typography from './foundations/typography';
import borders from './foundations/borders'; import borders from './foundations/borders';
...@@ -12,4 +12,6 @@ const overrides = { ...@@ -12,4 +12,6 @@ const overrides = {
components, components,
} }
Tooltip.defaultProps = { ...Tooltip.defaultProps, hasArrow: true }
export default extendTheme(overrides); export default extendTheme(overrides);
...@@ -75,16 +75,18 @@ const AddressModal: React.FC<Props> = ({ data }) => { ...@@ -75,16 +75,18 @@ const AddressModal: React.FC<Props> = ({ data }) => {
render={ renderAddressInput } render={ renderAddressInput }
/> />
</Box> </Box>
<Controller <Box marginBottom={ 8 }>
name="tag" <Controller
control={ control } name="tag"
rules={{ control={ control }
maxLength: TAG_MAX_LENGTH, rules={{
}} maxLength: TAG_MAX_LENGTH,
render={ renderTagInput } }}
/> render={ renderTagInput }
<Text color="gray.500" fontSize="sm" marginBottom={ 8 }> />
Please select what types of notifications you will receive: </Box>
<Text color="gray.500" fontSize="sm" marginBottom={ 5 }>
Please select what types of notifications you will receive
</Text> </Text>
<Box marginBottom={ 8 }> <Box marginBottom={ 8 }>
{ /* add them to the form later */ } { /* add them to the form later */ }
...@@ -100,7 +102,7 @@ const AddressModal: React.FC<Props> = ({ data }) => { ...@@ -100,7 +102,7 @@ const AddressModal: React.FC<Props> = ({ data }) => {
}) } }) }
</Grid> </Grid>
</Box> </Box>
<Text color="gray.500" fontSize="sm" marginBottom={ 5 }>Notification methods:</Text> <Text color="gray.500" fontSize="sm" marginBottom={ 5 }>Notification methods</Text>
<Controller <Controller
name="notification" name="notification"
control={ control } control={ control }
...@@ -108,6 +110,7 @@ const AddressModal: React.FC<Props> = ({ data }) => { ...@@ -108,6 +110,7 @@ const AddressModal: React.FC<Props> = ({ data }) => {
/> />
<Box marginTop={ 8 }> <Box marginTop={ 8 }>
<Button <Button
size="lg"
variant="primary" variant="primary"
onClick={ handleSubmit(onSubmit) } onClick={ handleSubmit(onSubmit) }
disabled={ Object.keys(errors).length > 0 } disabled={ Object.keys(errors).length > 0 }
......
...@@ -21,7 +21,7 @@ type Props = { ...@@ -21,7 +21,7 @@ type Props = {
} }
const AddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => { const AddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
const title = data ? 'Edit watchlist address' : 'New Address to Watchlist'; const title = data ? 'Edit watch list address' : 'New address to watch list';
return ( return (
<Modal isOpen={ isOpen } onClose={ onClose } size="md"> <Modal isOpen={ isOpen } onClose={ onClose } size="md">
...@@ -29,10 +29,10 @@ const AddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => { ...@@ -29,10 +29,10 @@ const AddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
<ModalContent> <ModalContent>
<ModalHeader fontWeight="500" textStyle="h3">{ title }</ModalHeader> <ModalHeader fontWeight="500" textStyle="h3">{ title }</ModalHeader>
<ModalCloseButton/> <ModalCloseButton/>
<ModalBody> <ModalBody mb={ 0 }>
{ !data && ( { !data && (
<Text lineHeight="30px" marginBottom={ 12 }> <Text lineHeight="30px" marginBottom={ 12 }>
An Email notification can be sent to you when an address on your watch list sends or receives any transactions. An email notification can be sent to you when an address on your watch list sends or receives any transactions.
</Text> </Text>
) } ) }
<AddressForm data={ data }/> <AddressForm data={ data }/>
......
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
ModalOverlay, ModalOverlay,
ModalContent, ModalContent,
ModalFooter, ModalFooter,
ModalHeader,
ModalBody, ModalBody,
ModalCloseButton, ModalCloseButton,
} from '@chakra-ui/react'; } from '@chakra-ui/react';
...@@ -28,15 +29,14 @@ const DeleteModal: React.FC<Props> = ({ isOpen, onClose, address }) => { ...@@ -28,15 +29,14 @@ const DeleteModal: React.FC<Props> = ({ isOpen, onClose, address }) => {
<Modal isOpen={ isOpen } onClose={ onClose } size="md"> <Modal isOpen={ isOpen } onClose={ onClose } size="md">
<ModalOverlay/> <ModalOverlay/>
<ModalContent> <ModalContent>
<ModalHeader fontWeight="500" textStyle="h3">Remove address from watch list</ModalHeader>
<ModalCloseButton/> <ModalCloseButton/>
<ModalBody> <ModalBody>
{ `Delete ${ address || 'address' } from watchlist?` } { `Address ${ address || 'address' } will be deleted` }
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button variant="secondary" onClick={ onDeleteClick }>Yes</Button> <Button variant="primary" size="lg" onClick={ onDeleteClick }>
<Button variant="primary" ml={ 3 } onClick={ onClose }> Delete
No
</Button> </Button>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent>
......
...@@ -16,7 +16,7 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => { ...@@ -16,7 +16,7 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => {
return ( return (
<HStack spacing={ 3 } align="top"> <HStack spacing={ 3 } align="top">
<Box width="24px">{ image }</Box> <Box width="24px">{ image }</Box>
<VStack spacing={ 2 } align="stretch" overflow="hidden"> <VStack spacing={ 2 } align="stretch" overflow="hidden" fontWeight={ 500 } color="gray.700">
<HStack spacing={ 2 } alignContent="center"> <HStack spacing={ 2 } alignContent="center">
<Link <Link
href="#" href="#"
...@@ -24,9 +24,11 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => { ...@@ -24,9 +24,11 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => {
overflow="hidden" overflow="hidden"
fontWeight={ 600 } fontWeight={ 600 }
lineHeight="24px" lineHeight="24px"
// need theme
_hover={{ color: 'blue.400' }}
> >
<Tooltip hasArrow label={ item.address }> <Tooltip label={ item.address }>
<AddressWithDots address={ item.address }/> <Box overflow="hidden"><AddressWithDots address={ item.address }/></Box>
</Tooltip> </Tooltip>
</Link> </Link>
<CopyToClipboard text={ item.address }/> <CopyToClipboard text={ item.address }/>
...@@ -34,22 +36,22 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => { ...@@ -34,22 +36,22 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => {
{ item.tokenBalance && ( { item.tokenBalance && (
<HStack spacing={ 0 } fontSize="sm" h={ 6 }> <HStack spacing={ 0 } fontSize="sm" h={ 6 }>
<Image src="./xdai.png" alt="chain-logo" marginRight="10px" w="16px" h="16px"/> <Image src="./xdai.png" alt="chain-logo" marginRight="10px" w="16px" h="16px"/>
<Text>{ item.tokenBalance + ' xDAI' }</Text> <Text>{ `xDAI balance:${ nbsp }` + item.tokenBalance }</Text>
<Text color="gray.500">{ `${ nbsp }($${ item.tokenBalanceUSD } USD)` }</Text> <Text color="gray.500">{ `${ nbsp }($${ item.tokenBalanceUSD } USD)` }</Text>
</HStack> </HStack>
) } ) }
{ item.tokensAmount && ( { item.tokensAmount && (
<HStack spacing={ 0 } fontSize="sm"> <HStack spacing={ 0 } fontSize="sm" h={ 6 }>
<Icon as={ TokensIcon } marginRight="10px" w="17px" h="16px"/> <Icon as={ TokensIcon } marginRight="10px" w="17px" h="16px"/>
<Text>{ item.tokensAmount + ' tokens' }</Text> <Text>{ `Tokens:${ nbsp }` + item.tokensAmount }</Text>
<Text color="gray.500">{ `${ nbsp }($${ item.tokensUSD } USD)` }</Text> <Text color="gray.500">{ `${ nbsp }($${ item.tokensUSD } USD)` }</Text>
</HStack> </HStack>
) } ) }
{ item.totalUSD && ( { item.totalUSD && (
<HStack spacing={ 0 } fontSize="sm"> <HStack spacing={ 0 } fontSize="sm" h={ 6 }>
<Icon as={ WalletIcon } marginRight="10px" w="16px" h="16px"/> <Icon as={ WalletIcon } marginRight="10px" w="16px" h="16px"/>
<Text>{ `Total balance:${ nbsp }` }</Text> <Text>{ `Net worth:${ nbsp }` }</Text>
<Link href="#" color="blue.500">{ `$${ item.totalUSD } USD` }</Link> <Link href="#" color="blue.500" _hover={{ color: 'blue.400' }}>{ `$${ item.totalUSD } USD` }</Link>
</HStack> </HStack>
) } ) }
</VStack> </VStack>
......
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
Td, Td,
Switch, Switch,
Icon, Icon,
IconButton,
HStack, HStack,
Tooltip, Tooltip,
} from '@chakra-ui/react' } from '@chakra-ui/react'
...@@ -36,7 +37,7 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => { ...@@ -36,7 +37,7 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
<Tr alignItems="top" key={ item.address }> <Tr alignItems="top" key={ item.address }>
<Td><WatchListAddressItem item={ item }/></Td> <Td><WatchListAddressItem item={ item }/></Td>
<Td> <Td>
<Tooltip hasArrow label={ item.tag }> <Tooltip label={ item.tag }>
<Tag variant="gray" lineHeight="24px"> <Tag variant="gray" lineHeight="24px">
{ item.tag } { item.tag }
</Tag> </Tag>
...@@ -45,8 +46,26 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => { ...@@ -45,8 +46,26 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
<Td><Switch colorScheme="blue" size="md" isChecked={ item.notification }/></Td> <Td><Switch colorScheme="blue" size="md" isChecked={ item.notification }/></Td>
<Td> <Td>
<HStack spacing={ 6 }> <HStack spacing={ 6 }>
<Icon as={ EditIcon } w="20px" h="20px" cursor="pointer" color="blue.600" onClick={ onItemEditClick }/> <Tooltip label="Edit">
<Icon as={ DeleteIcon } w="20px" h="20px" cursor="pointer" color="blue.600" onClick={ onItemDeleteClick }/> <IconButton
aria-label="edit"
variant="iconBlue"
w="30px"
h="30px"
onClick={ onItemEditClick }
icon={ <Icon as={ EditIcon } w="20px" h="20px"/> }
/>
</Tooltip>
<Tooltip label="Delete">
<IconButton
aria-label="delete"
variant="iconBlue"
w="30px"
h="30px"
onClick={ onItemDeleteClick }
icon={ <Icon as={ DeleteIcon } w="20px" h="20px"/> }
/>
</Tooltip>
</HStack> </HStack>
</Td> </Td>
</Tr> </Tr>
......
...@@ -23,7 +23,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => { ...@@ -23,7 +23,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => {
py={ 2.5 } py={ 2.5 }
color={ isActive ? 'blue.600' : 'gray.600' } color={ isActive ? 'blue.600' : 'gray.600' }
bgColor={ isActive ? 'blue.50' : 'transparent' } bgColor={ isActive ? 'blue.50' : 'transparent' }
_hover={{ color: 'blue.600' }} _hover={{ color: 'blue.400' }}
borderRadius="base" borderRadius="base"
> >
<HStack spacing={ 3 }> <HStack spacing={ 3 }>
......
...@@ -25,7 +25,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => { ...@@ -25,7 +25,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => {
color={ isActive ? 'blue.600' : 'gray.600' } color={ isActive ? 'blue.600' : 'gray.600' }
bgColor={ isActive ? 'blue.50' : 'transparent' } bgColor={ isActive ? 'blue.50' : 'transparent' }
borderRadius="base" borderRadius="base"
_hover={{ color: 'blue.600' }} _hover={{ color: 'blue.400' }}
> >
<HStack justifyContent="space-between"> <HStack justifyContent="space-between">
<HStack spacing={ 3 }> <HStack spacing={ 3 }>
......
...@@ -19,7 +19,7 @@ const Navigation = () => { ...@@ -19,7 +19,7 @@ const Navigation = () => {
py={ 12 } py={ 12 }
width="300px" width="300px"
> >
<HStack as="header" justifyContent="space-between" w="100%" padding={ 4 }> <HStack as="header" justifyContent="space-between" w="100%" px={ 4 } mb={ 2 } h={ 10 } alignItems="center">
<Icon as={ logoIcon } width="142px" height="26px" color="blue.600"/> <Icon as={ logoIcon } width="142px" height="26px" color="blue.600"/>
<Icon as={ networksIcon } width="20px" height="20px"/> <Icon as={ networksIcon } width="20px" height="20px"/>
</HStack> </HStack>
......
...@@ -42,7 +42,7 @@ const WatchList: React.FC = () => { ...@@ -42,7 +42,7 @@ const WatchList: React.FC = () => {
<Page> <Page>
<Box h="100%"> <Box h="100%">
<Box as="h1" textStyle="h2" marginBottom={ 8 }>Watch list</Box> <Box as="h1" textStyle="h2" marginBottom={ 8 }>Watch list</Box>
<Text marginBottom={ 12 }>An Email notification can be sent to you when an address on your watch list sends or receives any transactions.</Text> <Text marginBottom={ 12 }>An email notification can be sent to you when an address on your watch list sends or receives any transactions.</Text>
{ Boolean(watchlist.length) && ( { Boolean(watchlist.length) && (
<WatchlistTable <WatchlistTable
data={ watchlist } data={ watchlist }
...@@ -53,6 +53,7 @@ const WatchList: React.FC = () => { ...@@ -53,6 +53,7 @@ const WatchList: React.FC = () => {
<Box marginTop={ 8 }> <Box marginTop={ 8 }>
<Button <Button
variant="primary" variant="primary"
size="lg"
onClick={ addressModalProps.onOpen } onClick={ addressModalProps.onOpen }
> >
Add address Add address
......
import React, { useCallback, useEffect } from 'react'; import React, { useEffect, useState } from 'react';
import { Icon, useClipboard, useToast } from '@chakra-ui/react'; import { IconButton, Tooltip, useClipboard } from '@chakra-ui/react';
import CopyIcon from '../../icons/copy.svg'; import CopyIcon from '../../icons/copy.svg';
const CopyToClipboard = ({ text }: {text: string}) => { const CopyToClipboard = ({ text }: {text: string}) => {
const { hasCopied, onCopy } = useClipboard(text); const { hasCopied, onCopy } = useClipboard(text, 3000);
const toast = useToast(); const [ copied, setCopied ] = useState(false);
useEffect(() => { useEffect(() => {
if (hasCopied) { if (hasCopied) {
toast({ setCopied(true);
description: 'Copied', } else {
status: 'success', setCopied(false);
duration: 3000,
})
} }
}, [ toast, hasCopied ]); }, [ hasCopied ]);
const copyToClipboardCallback = useCallback(() => onCopy(), [ onCopy ]); return (
return <Icon as={ CopyIcon } w="20px" h="20px" color="blue.500" cursor="pointer" onClick={ copyToClipboardCallback }/>; <Tooltip label={ copied ? 'Copied' : 'Copy to clipboard' } closeOnClick={ false }>
<IconButton
aria-label="copy"
icon={ <CopyIcon/> }
w="20px"
h="20px"
variant="iconBlue"
onClick={ onCopy }
/>
</Tooltip>
);
} }
export default CopyToClipboard; export default CopyToClipboard;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment