Commit f2b9e4d0 authored by isstuev's avatar isstuev

fixes

parent f3fc1267
...@@ -39,6 +39,9 @@ const baseStyleCloseButton: SystemStyleFunction = (props) => { ...@@ -39,6 +39,9 @@ const baseStyleCloseButton: SystemStyleFunction = (props) => {
_active: { bg: 'none' }, _active: { bg: 'none' },
} }
} }
const baseStyleOverlay = {
bg: 'blackAlpha.800',
}
const baseStyle: PartsStyleFunction<typeof parts> = (props) => ({ const baseStyle: PartsStyleFunction<typeof parts> = (props) => ({
dialog: baseStyleDialog(props), dialog: baseStyleDialog(props),
...@@ -46,6 +49,7 @@ const baseStyle: PartsStyleFunction<typeof parts> = (props) => ({ ...@@ -46,6 +49,7 @@ const baseStyle: PartsStyleFunction<typeof parts> = (props) => ({
body: baseStyleBody, body: baseStyleBody,
footer: baseStyleFooter, footer: baseStyleFooter,
closeButton: baseStyleCloseButton(props), closeButton: baseStyleCloseButton(props),
overlay: baseStyleOverlay,
}) })
const sizes = { const sizes = {
...@@ -62,4 +66,6 @@ const Modal: ComponentMultiStyleConfig = { ...@@ -62,4 +66,6 @@ const Modal: ComponentMultiStyleConfig = {
baseStyle, baseStyle,
} }
Modal.defaultProps = { isCentered: true };
export default Modal; export default Modal;
...@@ -30,6 +30,7 @@ const Table: ComponentMultiStyleConfig = { ...@@ -30,6 +30,7 @@ const Table: ComponentMultiStyleConfig = {
fontWeight: 'normal', fontWeight: 'normal',
overflow: 'hidden', overflow: 'hidden',
color: 'gray.500', color: 'gray.500',
letterSpacing: 'none',
}, },
td: { td: {
fontSize: 'md', fontSize: 'md',
......
...@@ -42,7 +42,6 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => { ...@@ -42,7 +42,6 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
</Td> </Td>
<Td> <Td>
<HStack spacing={ 6 }> <HStack spacing={ 6 }>
icons
<EditButton onClick={ onItemEditClick }/> <EditButton onClick={ onItemEditClick }/>
<DeleteButton onClick={ onItemDeleteClick }/> <DeleteButton onClick={ onItemDeleteClick }/>
</HStack> </HStack>
......
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { Text } from '@chakra-ui/react';
import DeleteModal from '../shared/DeleteModal' import DeleteModal from '../shared/DeleteModal'
type Props = { type Props = {
...@@ -13,13 +13,19 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, name }) => { ...@@ -13,13 +13,19 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, name }) => {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('delete', name); console.log('delete', name);
}, [ name ]); }, [ name ]);
const renderText = useCallback(() => {
return (
<Text display="flex">API key for<Text fontWeight="600" whiteSpace="pre">{ ` "${ name || 'name' }" ` }</Text>will be deleted</Text>
)
}, [ name ]);
return ( return (
<DeleteModal <DeleteModal
isOpen={ isOpen } isOpen={ isOpen }
onClose={ onClose } onClose={ onClose }
onDelete={ onDelete } onDelete={ onDelete }
title="Remove API key" title="Remove API key"
text={ `API key for "${ name || 'name' }" will be deleted` } renderText={ renderText }
/> />
) )
} }
......
.identicon { .identicon {
max-width: 40px; max-width: 48px;
max-height: 40px; max-height: 48px;
} }
\ No newline at end of file
...@@ -23,12 +23,12 @@ const Header = () => { ...@@ -23,12 +23,12 @@ const Header = () => {
<InputLeftElement w={ 6 } ml="132px" mr={ 2.5 }> <InputLeftElement w={ 6 } ml="132px" mr={ 2.5 }>
<SearchIcon w={ 5 } h={ 5 } color="gray.500"/> <SearchIcon w={ 5 } h={ 5 } color="gray.500"/>
</InputLeftElement> </InputLeftElement>
<Input paddingInlineStart="50px" placeholder="Search by addresses / transactions /block/ token ... "/> <Input paddingInlineStart="50px" placeholder="Search by addresses / transactions / block / token... "/>
</InputGroup> </InputGroup>
<Switch size="lg" onChange={ toggleColorMode }/> <Switch size="lg" onChange={ toggleColorMode }/>
<Center minWidth="50px" width="50px" height="50px" bg={ useColorModeValue('blackAlpha.100', 'white') } borderRadius="50%" overflow="hidden"> <Center minWidth="50px" width="50px" height="50px" bg={ useColorModeValue('blackAlpha.100', 'white') } borderRadius="50%" overflow="hidden">
{ /* the displayed size is 40px, but we need to generate x2 for retina displays */ } { /* the displayed size is 48px, but we need to generate x2 for retina displays */ }
<Identicon className={ styles.identicon } string="randomness" size={ 80 }/> <Identicon className={ styles.identicon } string="randomness" size={ 96 }/>
</Center> </Center>
</HStack> </HStack>
) )
......
...@@ -26,7 +26,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => { ...@@ -26,7 +26,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => {
py={ 2.5 } py={ 2.5 }
color={ isActive ? colors.text.active : colors.text.default } color={ isActive ? colors.text.active : colors.text.default }
bgColor={ isActive ? colors.bg.active : colors.bg.default } bgColor={ isActive ? colors.bg.active : colors.bg.default }
_hover={{ color: colors.text.hover }} _hover={{ color: isActive ? colors.text.active : colors.text.hover }}
borderRadius="base" borderRadius="base"
> >
<HStack spacing={ 3 }> <HStack spacing={ 3 }>
......
...@@ -27,7 +27,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => { ...@@ -27,7 +27,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => {
py={ 2.5 } py={ 2.5 }
color={ isActive ? colors.text.active : colors.text.default } color={ isActive ? colors.text.active : colors.text.default }
bgColor={ isActive ? colors.bg.active : colors.bg.default } bgColor={ isActive ? colors.bg.active : colors.bg.default }
_hover={{ color: colors.text.hover }} _hover={{ color: isActive ? colors.text.active : colors.text.hover }}
borderRadius="base" borderRadius="base"
> >
<HStack justifyContent="space-between"> <HStack justifyContent="space-between">
......
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { Text } from '@chakra-ui/react';
import DeleteModal from '../shared/DeleteModal' import DeleteModal from '../shared/DeleteModal'
type Props = { type Props = {
...@@ -13,13 +13,20 @@ const DeletePrivateTagModal: React.FC<Props> = ({ isOpen, onClose, tag }) => { ...@@ -13,13 +13,20 @@ const DeletePrivateTagModal: React.FC<Props> = ({ isOpen, onClose, tag }) => {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('delete', tag); console.log('delete', tag);
}, [ tag ]); }, [ tag ]);
const renderText = useCallback(() => {
return (
<Text display="flex">Tag<Text fontWeight="600" whiteSpace="pre">{ ` "${ tag || 'address' }" ` }</Text>will be deleted</Text>
)
}, [ tag ]);
return ( return (
<DeleteModal <DeleteModal
isOpen={ isOpen } isOpen={ isOpen }
onClose={ onClose } onClose={ onClose }
onDelete={ onDelete } onDelete={ onDelete }
title="Removal of private tag" title="Removal of private tag"
text={ `Tag "${ tag || 'address' }" will be removed` } renderText={ renderText }
/> />
) )
} }
......
...@@ -16,10 +16,10 @@ type Props = { ...@@ -16,10 +16,10 @@ type Props = {
onClose: () => void; onClose: () => void;
onDelete: () => void; onDelete: () => void;
title: string; title: string;
text: string; renderText: () => JSX.Element;
} }
const DeleteModal: React.FC<Props> = ({ isOpen, onClose, onDelete, title, text }) => { const DeleteModal: React.FC<Props> = ({ isOpen, onClose, onDelete, title, renderText }) => {
const onDeleteClick = useCallback(() => { const onDeleteClick = useCallback(() => {
onDelete(); onDelete();
...@@ -33,7 +33,7 @@ const DeleteModal: React.FC<Props> = ({ isOpen, onClose, onDelete, title, text } ...@@ -33,7 +33,7 @@ const DeleteModal: React.FC<Props> = ({ isOpen, onClose, onDelete, title, text }
<ModalHeader fontWeight="500" textStyle="h3">{ title }</ModalHeader> <ModalHeader fontWeight="500" textStyle="h3">{ title }</ModalHeader>
<ModalCloseButton/> <ModalCloseButton/>
<ModalBody> <ModalBody>
{ text } { renderText() }
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button variant="primary" size="lg" onClick={ onDeleteClick }> <Button variant="primary" size="lg" onClick={ onDeleteClick }>
......
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { Text } from '@chakra-ui/react';
import DeleteModal from '../shared/DeleteModal' import DeleteModal from '../shared/DeleteModal'
type Props = { type Props = {
...@@ -13,13 +13,20 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, address }) => { ...@@ -13,13 +13,20 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, address }) => {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('delete', address); console.log('delete', address);
}, [ address ]); }, [ address ]);
const renderText = useCallback(() => {
return (
<Text display="flex">Address <Text fontWeight="600" whiteSpace="pre"> { address || 'address' } </Text> will be deleted</Text>
)
}, [ address ]);
return ( return (
<DeleteModal <DeleteModal
isOpen={ isOpen } isOpen={ isOpen }
onClose={ onClose } onClose={ onClose }
onDelete={ onDelete } onDelete={ onDelete }
title="Remove address from watch list" title="Remove address from watch list"
text={ `Address ${ address || 'address' } will be deleted` } renderText={ renderText }
/> />
) )
} }
......
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