Commit ff73835e authored by tom's avatar tom

horizontal navigation refactoring

parent 3dc0d87d
...@@ -23,7 +23,7 @@ const variantSimple = definePartsStyle((props) => { ...@@ -23,7 +23,7 @@ const variantSimple = definePartsStyle((props) => {
...transitionProps, ...transitionProps,
}, },
td: { td: {
borderColor: 'divider', borderColor: 'border.divider',
...transitionProps, ...transitionProps,
}, },
}; };
......
// TODO @tom2drum remove this
export default function getDefaultTransitionProps(props?: { transitionProperty: string }) { export default function getDefaultTransitionProps(props?: { transitionProperty: string }) {
return { return {
transitionProperty: `background-color, color, border-color${ props?.transitionProperty ? ', ' + props.transitionProperty : '' }`, transitionProperty: `background-color, color, border-color${ props?.transitionProperty ? ', ' + props.transitionProperty : '' }`,
......
...@@ -15,15 +15,17 @@ interface ButtonLoadingProps { ...@@ -15,15 +15,17 @@ interface ButtonLoadingProps {
export interface ButtonProps extends ChakraButtonProps, ButtonLoadingProps { export interface ButtonProps extends ChakraButtonProps, ButtonLoadingProps {
active?: boolean; active?: boolean;
selected?: boolean; selected?: boolean;
highlighted?: boolean;
} }
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
function Button(props, ref) { function Button(props, ref) {
const { loading, disabled, loadingText, children, active, selected, ...rest } = props; const { loading, disabled, loadingText, children, active, selected, highlighted, ...rest } = props;
return ( return (
<ChakraButton <ChakraButton
{ ...(active ? { 'data-active': true } : {}) } { ...(active ? { 'data-active': true } : {}) }
{ ...(selected ? { 'data-selected': true } : {}) } { ...(selected ? { 'data-selected': true } : {}) }
{ ...(highlighted ? { 'data-highlighted': true } : {}) }
disabled={ loading || disabled } disabled={ loading || disabled }
ref={ ref } ref={ ref }
{ ...rest } { ...rest }
......
...@@ -51,10 +51,33 @@ export const PopoverCloseTrigger = React.forwardRef< ...@@ -51,10 +51,33 @@ export const PopoverCloseTrigger = React.forwardRef<
); );
}); });
export const PopoverRoot = (props: ChakraPopover.RootProps) => {
const positioning = {
...props.positioning,
offset: {
mainAxis: 4,
...props.positioning?.offset,
},
};
return (
<ChakraPopover.Root
autoFocus={ false }
{ ...props }
positioning={ positioning }
/>
);
};
export const PopoverTrigger = React.forwardRef<
HTMLButtonElement,
ChakraPopover.TriggerProps
>(function PopoverTrigger(props, ref) {
return <ChakraPopover.Trigger as="div" asChild ref={ ref } { ...props }/>;
});
export const PopoverTitle = ChakraPopover.Title; export const PopoverTitle = ChakraPopover.Title;
export const PopoverDescription = ChakraPopover.Description; export const PopoverDescription = ChakraPopover.Description;
export const PopoverFooter = ChakraPopover.Footer; export const PopoverFooter = ChakraPopover.Footer;
export const PopoverHeader = ChakraPopover.Header; export const PopoverHeader = ChakraPopover.Header;
export const PopoverRoot = ChakraPopover.Root;
export const PopoverBody = ChakraPopover.Body; export const PopoverBody = ChakraPopover.Body;
export const PopoverTrigger = ChakraPopover.Trigger;
...@@ -63,6 +63,7 @@ export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>( ...@@ -63,6 +63,7 @@ export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(
> >
<ChakraTooltip.Trigger <ChakraTooltip.Trigger
ref={ triggerRef } ref={ triggerRef }
as="div"
asChild asChild
onClick={ isMobile ? handleTriggerClick : undefined } onClick={ isMobile ? handleTriggerClick : undefined }
> >
......
...@@ -9,9 +9,6 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -9,9 +9,6 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
fg: { fg: {
DEFAULT: { value: { base: '{colors.blue.600}', _dark: '{colors.blue.300}' } }, DEFAULT: { value: { base: '{colors.blue.600}', _dark: '{colors.blue.300}' } },
}, },
hover: {
DEFAULT: { value: '{colors.blue.400}' },
},
}, },
dropdown: { dropdown: {
fg: { fg: {
...@@ -22,8 +19,19 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -22,8 +19,19 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
DEFAULT: { value: { base: '{colors.gray.200}', _dark: '{colors.gray.600}' } }, DEFAULT: { value: { base: '{colors.gray.200}', _dark: '{colors.gray.600}' } },
selected: { value: { base: '{colors.blue.50}', _dark: '{colors.gray.600}' } }, selected: { value: { base: '{colors.blue.50}', _dark: '{colors.gray.600}' } },
}, },
hover: { },
DEFAULT: { value: '{colors.blue.400}' }, header: {
fg: {
DEFAULT: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.gray.400}' } },
selected: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } },
highlighted: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } },
},
bg: {
selected: { value: { base: '{colors.blackAlpha.50}', _dark: '{colors.whiteAlpha.100}' } },
highlighted: { value: { base: '{colors.orange.100}', _dark: '{colors.orange.900}' } },
},
border: {
DEFAULT: { value: { base: '{colors.gray.300}', _dark: '{colors.gray.600}' } },
}, },
}, },
}, },
...@@ -39,6 +47,22 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -39,6 +47,22 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
DEFAULT: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.gray.400}' } }, DEFAULT: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.gray.400}' } },
hover: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.gray.400}' } }, hover: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.gray.400}' } },
}, },
navigation: {
fg: {
DEFAULT: { value: { base: '{colors.gray.600}', _dark: '{colors.gray.400}' } },
selected: { value: { base: '{colors.blue.700}', _dark: '{colors.gray.50}' } },
hover: { value: { base: '{colors.link.primary.hover}' } },
active: { value: { base: '{colors.link.primary.hover}' } },
},
bg: {
DEFAULT: { value: 'transparent' },
selected: { value: { base: '{colors.blue.50}', _dark: '{colors.gray.800}' } },
},
border: {
DEFAULT: { value: '{colors.border.divider}' },
selected: { value: { base: '{colors.blue.50}', _dark: '{colors.gray.800}' } },
},
},
}, },
tooltip: { tooltip: {
DEFAULT: { DEFAULT: {
...@@ -53,10 +77,19 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -53,10 +77,19 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
}, },
}, },
}, },
popover: {
DEFAULT: {
bg: { value: { base: '{colors.white}', _dark: '{colors.gray.900}' } },
shadow: { value: { base: '{colors.blackAlpha.200}', _dark: '{colors.whiteAlpha.300}' } },
},
},
text: { text: {
primary: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } }, primary: { value: { base: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } },
secondary: { value: { base: '{colors.gray.500}', _dark: '{colors.gray.400}' } }, secondary: { value: { base: '{colors.gray.500}', _dark: '{colors.gray.400}' } },
}, },
border: {
divider: { value: { base: '{colors.blackAlpha.200}', _dark: '{colors.whiteAlpha.200}' } },
},
global: { global: {
body: { body: {
bg: { value: { base: '{colors.white}', _dark: '{colors.black}' } }, bg: { value: { base: '{colors.white}', _dark: '{colors.black}' } },
...@@ -68,7 +101,6 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -68,7 +101,6 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
}, },
// OLD TOKENS // OLD TOKENS
divider: { value: { base: '{colors.blackAlpha.200}', _dark: '{colors.whiteAlpha.200}' } },
// text: { // text: {
// DEFAULT: { value: '{colors.blackAlpha.800}' }, // DEFAULT: { value: '{colors.blackAlpha.800}' },
// _dark: { value: '{colors.whiteAlpha.800}' }, // _dark: { value: '{colors.whiteAlpha.800}' },
...@@ -101,6 +133,14 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -101,6 +133,14 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
_dark: { value: '{colors.gray.900}' }, _dark: { value: '{colors.gray.900}' },
}, },
}, },
shadows: {
popover: {
DEFAULT: { value: {
base: '{shadows.size.2xl}',
_dark: '0px 15px 40px 0px rgba(0, 0, 0, 0.4), 0px 5px 10px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 1px rgba(0, 0, 0, 0.1)',
} },
},
},
}; };
export default semanticTokens; export default semanticTokens;
import type { TokenDefinition } from '@chakra-ui/react/dist/types/styled-system/types'; import type { ThemingConfig } from '@chakra-ui/react';
const shadows: TokenDefinition['shadows'] = { import type { ExcludeUndefined } from 'types/utils';
const shadows: ExcludeUndefined<ThemingConfig['tokens']>['shadows'] = {
action_bar: { value: '0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)' }, action_bar: { value: '0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)' },
size: {
xs: { value: '0px 0px 0px 1px rgba(0, 0, 0, 0.05)' },
sm: { value: '0px 1px 2px 0px rgba(0, 0, 0, 0.05)' },
base: { value: '0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 1px 3px 0px rgba(0, 0, 0, 0.1)' },
md: { value: '0px 2px 4px -1px rgba(0, 0, 0, 0.06), 0px 4px 6px -1px rgba(0, 0, 0, 0.1)' },
lg: { value: '0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1)' },
xl: { value: '0px 10px 10px -5px rgba(0, 0, 0, 0.04), 0px 20px 25px -5px rgba(0, 0, 0, 0.1)' },
'2xl': { value: '0px 15px 50px -12px rgba(0, 0, 0, 0.25)' },
},
}; };
export default shadows; export default shadows;
...@@ -28,8 +28,8 @@ export const recipe = defineRecipe({ ...@@ -28,8 +28,8 @@ export const recipe = defineRecipe({
borderColor: 'button.outline.fg', borderColor: 'button.outline.fg',
_hover: { _hover: {
bg: 'transparent', bg: 'transparent',
color: 'button.outline.hover', color: 'blue.400',
borderColor: 'button.outline.hover', borderColor: 'blue.400',
}, },
}, },
dropdown: { dropdown: {
...@@ -40,14 +40,14 @@ export const recipe = defineRecipe({ ...@@ -40,14 +40,14 @@ export const recipe = defineRecipe({
borderColor: 'button.dropdown.border', borderColor: 'button.dropdown.border',
_hover: { _hover: {
bg: 'transparent', bg: 'transparent',
color: 'button.dropdown.hover', color: 'blue.400',
borderColor: 'button.dropdown.hover', borderColor: 'blue.400',
}, },
// When the dropdown is open, the button should be active // When the dropdown is open, the button should be active
_active: { _active: {
bg: 'transparent', bg: 'transparent',
color: 'button.dropdown.hover', color: 'blue.400',
borderColor: 'button.dropdown.hover', borderColor: 'blue.400',
}, },
// We have a special state for this button variant that serves as a popover trigger. // We have a special state for this button variant that serves as a popover trigger.
// When any items (filters) are selected in the popover, the button should change its background and text color. // When any items (filters) are selected in the popover, the button should change its background and text color.
...@@ -63,6 +63,38 @@ export const recipe = defineRecipe({ ...@@ -63,6 +63,38 @@ export const recipe = defineRecipe({
}, },
}, },
}, },
header: {
bg: 'transparent',
color: 'button.header.fg',
borderColor: 'button.header.border',
borderWidth: '2px',
borderStyle: 'solid',
_hover: {
bg: 'transparent',
color: 'blue.400',
borderColor: 'blue.400',
},
_selected: {
bg: 'button.header.bg.selected',
color: 'button.header.fg.selected',
borderColor: 'transparent',
borderWidth: '0px',
_hover: {
bg: 'button.header.bg.selected',
color: 'button.header.fg.selected',
},
_highlighted: {
bg: 'button.header.bg.highlighted',
color: 'button.header.fg.highlighted',
borderColor: 'transparent',
borderWidth: '0px',
_hover: {
bg: 'button.header.bg.highlighted',
color: 'button.header.fg.highlighted',
},
},
},
},
}, },
size: { size: {
xs: { px: 2, h: 6, fontSize: '12px' }, xs: { px: 2, h: 6, fontSize: '12px' },
......
import { recipe as button } from './button.recipe'; import { recipe as button } from './button.recipe';
import { recipe as link } from './link.recipe'; import { recipe as link } from './link.recipe';
import { recipe as popover } from './popover.recipe';
import { recipe as tooltip } from './tooltip.recipe'; import { recipe as tooltip } from './tooltip.recipe';
export const recipes = { export const recipes = {
...@@ -9,4 +10,5 @@ export const recipes = { ...@@ -9,4 +10,5 @@ export const recipes = {
export const slotRecipes = { export const slotRecipes = {
tooltip, tooltip,
popover,
}; };
import { defineRecipe } from '@chakra-ui/react'; import { defineRecipe } from '@chakra-ui/react';
export const recipe = defineRecipe({ export const recipe = defineRecipe({
base: {
gap: 0,
},
variants: { variants: {
visual: { visual: {
primary: { primary: {
...@@ -24,6 +27,23 @@ export const recipe = defineRecipe({ ...@@ -24,6 +27,23 @@ export const recipe = defineRecipe({
textDecorationColor: 'link.subtle.hover', textDecorationColor: 'link.subtle.hover',
}, },
}, },
navigation: {
color: 'link.navigation.fg',
bg: 'link.navigation.bg',
border: 'link.navigation.border',
_hover: {
color: 'link.navigation.fg.hover',
textDecoration: 'none',
},
_selected: {
color: 'link.navigation.fg.selected',
bg: 'link.navigation.bg.selected',
border: 'link.navigation.border.selected',
},
_active: {
color: 'link.navigation.fg.active',
},
},
}, },
}, },
defaultVariants: { defaultVariants: {
......
import { defineSlotRecipe } from '@chakra-ui/react';
export const recipe = defineSlotRecipe({
className: 'chakra-popover',
slots: [ 'content', 'header', 'body', 'footer', 'arrow', 'arrowTip' ],
base: {
content: {
position: 'relative',
display: 'flex',
flexDirection: 'column',
textStyle: 'sm',
'--popover-bg': 'colors.popover.bg',
bg: 'var(--popover-bg)',
boxShadow: 'popover',
boxShadowColor: 'colors.popover.shadow',
'--popover-mobile-size': 'calc(100dvw - 1rem)',
width: {
base: 'min(var(--popover-mobile-size), var(--popover-size))',
lg: 'fit-content',
},
borderWidth: '0',
borderRadius: 'md',
'--popover-z-index': 'zIndex.popover',
zIndex: 'calc(var(--popover-z-index) + var(--layer-index, 0))',
outline: '0',
transformOrigin: 'var(--transform-origin)',
_open: {
animationStyle: 'scale-fade-in',
animationDuration: 'fast',
},
_closed: {
animationStyle: 'scale-fade-out',
animationDuration: 'faster',
},
},
header: {
paddingInline: 'var(--popover-padding)',
paddingTop: 'var(--popover-padding)',
},
body: {
padding: 'var(--popover-padding)',
flex: '1',
},
footer: {
display: 'flex',
alignItems: 'center',
paddingInline: 'var(--popover-padding)',
paddingBottom: 'var(--popover-padding)',
},
arrow: {
'--arrow-size': 'sizes.3',
'--arrow-background': 'var(--popover-bg)',
},
arrowTip: {
borderTopWidth: '1px',
borderInlineStartWidth: '1px',
},
},
variants: {
size: {
sm: {
content: {
'--popover-padding': 'spacing.4',
},
},
},
},
defaultVariants: {
size: 'sm',
},
});
...@@ -9,7 +9,7 @@ export const recipe = defineSlotRecipe({ ...@@ -9,7 +9,7 @@ export const recipe = defineSlotRecipe({
borderRadius: 'sm', borderRadius: 'sm',
fontWeight: '500', fontWeight: '500',
textStyle: 'sm', textStyle: 'sm',
boxShadow: 'md', boxShadow: 'size.md',
zIndex: 'tooltip', zIndex: 'tooltip',
maxW: '320px', maxW: '320px',
transformOrigin: 'var(--transform-origin)', transformOrigin: 'var(--transform-origin)',
......
...@@ -84,7 +84,7 @@ const ContractExternalLibraries = ({ className, data, isLoading }: Props) => { ...@@ -84,7 +84,7 @@ const ContractExternalLibraries = ({ className, data, isLoading }: Props) => {
Check the source code at the library address (if any) if you want to be sure in case if there is any library linked Check the source code at the library address (if any) if you want to be sure in case if there is any library linked
</Alert> </Alert>
<VStack <VStack
divider={ <StackDivider borderColor="divider"/> } divider={ <StackDivider borderColor="border.divider"/> }
spacing={ 2 } spacing={ 2 }
mt={ 4 } mt={ 4 }
maxH={{ lg: '50vh' }} maxH={{ lg: '50vh' }}
......
...@@ -74,7 +74,7 @@ const AddressSaveOnGas = ({ gasUsed, address }: Props) => { ...@@ -74,7 +74,7 @@ const AddressSaveOnGas = ({ gasUsed, address }: Props) => {
return ( return (
<> <>
<TextSeparator color="divider"/> <TextSeparator color="border.divider"/>
<Skeleton isLoaded={ !query.isPlaceholderData } display="flex" alignItems="center" columnGap={ 2 }> <Skeleton isLoaded={ !query.isPlaceholderData } display="flex" alignItems="center" columnGap={ 2 }>
<Image src="/static/gas_hawk_logo.svg" w="15px" h="20px" alt="GasHawk logo"/> <Image src="/static/gas_hawk_logo.svg" w="15px" h="20px" alt="GasHawk logo"/>
<LinkExternal href="https://www.gashawk.io?utm_source=blockscout&utm_medium=address" fontSize="sm"> <LinkExternal href="https://www.gashawk.io?utm_source=blockscout&utm_medium=address" fontSize="sm">
......
...@@ -77,7 +77,7 @@ const TokenSelectItem = ({ data }: Props) => { ...@@ -77,7 +77,7 @@ const TokenSelectItem = ({ data }: Props) => {
display="flex" display="flex"
flexDir="column" flexDir="column"
rowGap={ 2 } rowGap={ 2 }
borderColor="divider" borderColor="border.divider"
borderBottomWidth="1px" borderBottomWidth="1px"
_hover={{ _hover={{
bgColor: useColorModeValue('blue.50', 'gray.800'), bgColor: useColorModeValue('blue.50', 'gray.800'),
......
...@@ -30,7 +30,7 @@ const NeverShowInfoPlugin = () => { ...@@ -30,7 +30,7 @@ const NeverShowInfoPlugin = () => {
const SwaggerUI = () => { const SwaggerUI = () => {
const mainColor = useColorModeValue('blackAlpha.800', 'whiteAlpha.800'); const mainColor = useColorModeValue('blackAlpha.800', 'whiteAlpha.800');
const borderColor = useToken('colors', 'divider'); const borderColor = useToken('colors', 'border.divider');
const mainBgColor = useColorModeValue('blackAlpha.100', 'whiteAlpha.200'); const mainBgColor = useColorModeValue('blackAlpha.100', 'whiteAlpha.200');
const swaggerStyle: SystemStyleObject = { const swaggerStyle: SystemStyleObject = {
......
...@@ -29,7 +29,7 @@ const BlockEpochElectionRewardsListItem = ({ data, isLoading, type }: Props) => ...@@ -29,7 +29,7 @@ const BlockEpochElectionRewardsListItem = ({ data, isLoading, type }: Props) =>
<Box <Box
py={ 3 } py={ 3 }
borderBottomWidth="1px" borderBottomWidth="1px"
borderColor="divider" borderColor="border.divider"
fontSize="sm" fontSize="sm"
onClick={ isLoading || !data.count ? undefined : section.onToggle } onClick={ isLoading || !data.count ? undefined : section.onToggle }
cursor={ isLoading || !data.count ? undefined : 'pointer' } cursor={ isLoading || !data.count ? undefined : 'pointer' }
......
...@@ -25,7 +25,7 @@ const BlockEpochElectionRewardsTableItem = ({ isLoading, data, type }: Props) => ...@@ -25,7 +25,7 @@ const BlockEpochElectionRewardsTableItem = ({ isLoading, data, type }: Props) =>
decimals: data.token.decimals, decimals: data.token.decimals,
}); });
const mainRowBorderColor = section.isOpen ? 'transparent' : 'divider'; const mainRowBorderColor = section.isOpen ? 'transparent' : 'border.divider';
return ( return (
<> <>
......
...@@ -42,7 +42,7 @@ const BlockCountdownTimer = ({ value: initialValue, onFinish }: Props) => { ...@@ -42,7 +42,7 @@ const BlockCountdownTimer = ({ value: initialValue, onFinish }: Props) => {
mt={{ base: 6, lg: 8 }} mt={{ base: 6, lg: 8 }}
p={{ base: 3, lg: 4 }} p={{ base: 3, lg: 4 }}
borderRadius="base" borderRadius="base"
divider={ <StackDivider borderColor="divider"/> } divider={ <StackDivider borderColor="border.divider"/> }
> >
<BlockCountdownTimerItem label="Days" value={ periods.days }/> <BlockCountdownTimerItem label="Days" value={ periods.days }/>
<BlockCountdownTimerItem label="Hours" value={ periods.hours }/> <BlockCountdownTimerItem label="Hours" value={ periods.hours }/>
......
...@@ -35,7 +35,7 @@ const LatestBlocksItem = ({ block, isLoading }: Props) => { ...@@ -35,7 +35,7 @@ const LatestBlocksItem = ({ block, isLoading }: Props) => {
transitionTimingFunction="linear" transitionTimingFunction="linear"
borderRadius="md" borderRadius="md"
border="1px solid" border="1px solid"
borderColor="divider" borderColor="border.divider"
p={ 3 } p={ 3 }
> >
<Flex alignItems="center" overflow="hidden" w="100%" mb={ 3 }> <Flex alignItems="center" overflow="hidden" w="100%" mb={ 3 }>
......
...@@ -41,9 +41,9 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => { ...@@ -41,9 +41,9 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
width="100%" width="100%"
minW="700px" minW="700px"
borderTop="1px solid" borderTop="1px solid"
borderColor="divider" borderColor="border.divider"
p={ 4 } p={ 4 }
_last={{ borderBottom: '1px solid', borderColor: 'divider' }} _last={{ borderBottom: '1px solid', borderColor: 'border.divider' }}
display={{ base: 'none', lg: 'grid' }} display={{ base: 'none', lg: 'grid' }}
> >
<Flex overflow="hidden" w="100%"> <Flex overflow="hidden" w="100%">
......
...@@ -33,9 +33,9 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => { ...@@ -33,9 +33,9 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
<Box <Box
width="100%" width="100%"
borderTop="1px solid" borderTop="1px solid"
borderColor="divider" borderColor="border.divider"
py={ 4 } py={ 4 }
_last={{ borderBottom: '1px solid', borderColor: 'divider' }} _last={{ borderBottom: '1px solid', borderColor: 'border.divider' }}
display={{ base: 'block', lg: 'none' }} display={{ base: 'block', lg: 'none' }}
> >
<Flex justifyContent="space-between"> <Flex justifyContent="space-between">
......
...@@ -31,7 +31,7 @@ const LatestBatchItem = ({ number, timestamp, txCount, status, isLoading }: Prop ...@@ -31,7 +31,7 @@ const LatestBatchItem = ({ number, timestamp, txCount, status, isLoading }: Prop
transitionTimingFunction="linear" transitionTimingFunction="linear"
borderRadius="md" borderRadius="md"
border="1px solid" border="1px solid"
borderColor="divider" borderColor="border.divider"
p={ 3 } p={ 3 }
> >
<Flex alignItems="center" overflow="hidden" w="100%" mb={ 3 }> <Flex alignItems="center" overflow="hidden" w="100%" mb={ 3 }>
......
...@@ -144,10 +144,10 @@ const LatestDepositsItem = ({ item, isLoading }: ItemProps) => { ...@@ -144,10 +144,10 @@ const LatestDepositsItem = ({ item, isLoading }: ItemProps) => {
<Box <Box
width="100%" width="100%"
borderTop="1px solid" borderTop="1px solid"
borderColor="divider" borderColor="border.divider"
py={ 4 } py={ 4 }
px={{ base: 0, lg: 4 }} px={{ base: 0, lg: 4 }}
_last={{ borderBottom: '1px solid', borderColor: 'divider' }} _last={{ borderBottom: '1px solid', borderColor: 'border.divider' }}
fontSize="sm" fontSize="sm"
lineHeight={ 5 } lineHeight={ 5 }
> >
......
...@@ -106,10 +106,10 @@ const LatestDepositsItem = ({ l1BlockNumber, l1TxHash, l2TxHash, timestamp, isLo ...@@ -106,10 +106,10 @@ const LatestDepositsItem = ({ l1BlockNumber, l1TxHash, l2TxHash, timestamp, isLo
<Box <Box
width="100%" width="100%"
borderTop="1px solid" borderTop="1px solid"
borderColor="divider" borderColor="border.divider"
py={ 4 } py={ 4 }
px={{ base: 0, lg: 4 }} px={{ base: 0, lg: 4 }}
_last={{ borderBottom: '1px solid', borderColor: 'divider' }} _last={{ borderBottom: '1px solid', borderColor: 'border.divider' }}
fontSize="sm" fontSize="sm"
lineHeight={ 5 } lineHeight={ 5 }
> >
......
...@@ -63,7 +63,7 @@ const NameDomainsActionBar = ({ ...@@ -63,7 +63,7 @@ const NameDomainsActionBar = ({
onProtocolsFilterChange([]); onProtocolsFilterChange([]);
}, [ onProtocolsFilterChange ]); }, [ onProtocolsFilterChange ]);
const filterGroupDivider = <Box w="100%" borderBottomWidth="1px" borderBottomColor="divider" my={ 4 }/>; const filterGroupDivider = <Box w="100%" borderBottomWidth="1px" borderBottomColor="border.divider" my={ 4 }/>;
const appliedFiltersNum = filterValue.length + (protocolsData && protocolsData.length > 1 ? protocolsFilterValue.length : 0); const appliedFiltersNum = filterValue.length + (protocolsData && protocolsData.length > 1 ? protocolsFilterValue.length : 0);
......
...@@ -25,6 +25,9 @@ const ChakraShowcases = () => { ...@@ -25,6 +25,9 @@ const ChakraShowcases = () => {
<Button visual="outline">Outline</Button> <Button visual="outline">Outline</Button>
<Button visual="dropdown">Dropdown</Button> <Button visual="dropdown">Dropdown</Button>
<Button visual="dropdown" selected>Dropdown selected</Button> <Button visual="dropdown" selected>Dropdown selected</Button>
<Button visual="header">Header</Button>
<Button visual="header" selected>Header selected</Button>
<Button visual="header" selected highlighted>Header highlighted</Button>
</HStack> </HStack>
</section> </section>
...@@ -43,7 +46,7 @@ const ChakraShowcases = () => { ...@@ -43,7 +46,7 @@ const ChakraShowcases = () => {
<Tooltip content="Tooltip content"> <Tooltip content="Tooltip content">
<span>Default</span> <span>Default</span>
</Tooltip> </Tooltip>
<Tooltip content="Tooltip content" visual="navigation" selected open> <Tooltip content="Tooltip content" visual="navigation">
<span>Navigation</span> <span>Navigation</span>
</Tooltip> </Tooltip>
</HStack> </HStack>
......
...@@ -14,6 +14,8 @@ type Props = { ...@@ -14,6 +14,8 @@ type Props = {
variant?: ButtonProps['variant']; variant?: ButtonProps['variant'];
}; };
// TODO @tom2drum chekc this component
const RewardsButton = ({ variant = 'header', size }: Props) => { const RewardsButton = ({ variant = 'header', size }: Props) => {
const { isInitialized, apiToken, openLoginModal, dailyRewardQuery, balancesQuery } = useRewardsContext(); const { isInitialized, apiToken, openLoginModal, dailyRewardQuery, balancesQuery } = useRewardsContext();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
......
...@@ -107,7 +107,7 @@ const LoginStepContent = ({ goNext, closeModal, openAuthModal }: Props) => { ...@@ -107,7 +107,7 @@ const LoginStepContent = ({ goNext, closeModal, openAuthModal }: Props) => {
</Box> </Box>
{ isSignUp && isLoggedIntoAccountWithWallet && ( { isSignUp && isLoggedIntoAccountWithWallet && (
<Box mb={ 6 }> <Box mb={ 6 }>
<Divider bgColor="divider" mb={ 6 }/> <Divider bgColor="border.divider" mb={ 6 }/>
<Flex w="full" alignItems="center" justifyContent="space-between"> <Flex w="full" alignItems="center" justifyContent="space-between">
I have a referral code I have a referral code
<Switch <Switch
......
...@@ -17,7 +17,7 @@ const DetailsInfoItemDivider = ({ className, id, colSpan }: Props) => { ...@@ -17,7 +17,7 @@ const DetailsInfoItemDivider = ({ className, id, colSpan }: Props) => {
mt={{ base: 2, lg: 3 }} mt={{ base: 2, lg: 3 }}
mb={{ base: 0, lg: 3 }} mb={{ base: 0, lg: 3 }}
borderBottom="1px solid" borderBottom="1px solid"
borderColor="divider" borderColor="border.divider"
/> />
); );
}; };
......
...@@ -20,7 +20,7 @@ const ListItemMobile = ({ children, className, isAnimated }: Props) => { ...@@ -20,7 +20,7 @@ const ListItemMobile = ({ children, className, isAnimated }: Props) => {
alignItems="flex-start" alignItems="flex-start"
flexDirection="column" flexDirection="column"
paddingY={ 6 } paddingY={ 6 }
borderColor="divider" borderColor="border.divider"
borderTopWidth="1px" borderTopWidth="1px"
_last={{ _last={{
borderBottomWidth: '1px', borderBottomWidth: '1px',
......
...@@ -22,7 +22,7 @@ const Container = chakra(({ isAnimated, children, className }: ContainerProps) = ...@@ -22,7 +22,7 @@ const Container = chakra(({ isAnimated, children, className }: ContainerProps) =
gridTemplateColumns="86px auto" gridTemplateColumns="86px auto"
alignItems="start" alignItems="start"
paddingY={ 4 } paddingY={ 4 }
borderColor="divider" borderColor="border.divider"
borderTopWidth="1px" borderTopWidth="1px"
_last={{ _last={{
borderBottomWidth: '1px', borderBottomWidth: '1px',
......
...@@ -45,7 +45,7 @@ const TokenTransferFilter = ({ ...@@ -45,7 +45,7 @@ const TokenTransferFilter = ({
defaultValue={ defaultAddressFilter || 'all' } defaultValue={ defaultAddressFilter || 'all' }
paddingBottom={ 4 } paddingBottom={ 4 }
borderBottom="1px solid" borderBottom="1px solid"
borderColor="divider" borderColor="border.divider"
> >
<Stack spacing={ 4 }> <Stack spacing={ 4 }>
<Radio value="all"><Text fontSize="md">All</Text></Radio> <Radio value="all"><Text fontSize="md">All</Text></Radio>
......
...@@ -13,7 +13,7 @@ interface Props extends Omit<React.SVGProps<SVGGElement>, 'scale'> { ...@@ -13,7 +13,7 @@ interface Props extends Omit<React.SVGProps<SVGGElement>, 'scale'> {
const ChartGridLine = ({ type, scale, ticks, size, noAnimation, ...props }: Props) => { const ChartGridLine = ({ type, scale, ticks, size, noAnimation, ...props }: Props) => {
const ref = React.useRef<SVGGElement>(null); const ref = React.useRef<SVGGElement>(null);
const strokeColor = useToken('colors', 'divider'); const strokeColor = useToken('colors', 'border.divider');
React.useEffect(() => { React.useEffect(() => {
if (!ref.current) { if (!ref.current) {
......
...@@ -14,8 +14,8 @@ const LayoutDefault = ({ children }: Props) => { ...@@ -14,8 +14,8 @@ const LayoutDefault = ({ children }: Props) => {
return ( return (
<Layout.Container> <Layout.Container>
{ /* <Layout.TopRow/> */ } { /* <Layout.TopRow/> */ }
{ /* <Layout.NavBar/> <Layout.NavBar/>
<HeaderMobile/> */ } { /* <HeaderMobile/> */ }
<Layout.MainArea> <Layout.MainArea>
{ /* <Layout.SideBar/> */ } { /* <Layout.SideBar/> */ }
<Layout.MainColumn> <Layout.MainColumn>
......
...@@ -13,11 +13,12 @@ interface Props { ...@@ -13,11 +13,12 @@ interface Props {
children: React.ReactNode; children: React.ReactNode;
isLoading?: boolean; isLoading?: boolean;
variant?: Variants; variant?: Variants;
visual?: LinkProps['visual'];
iconColor?: LinkProps['color']; iconColor?: LinkProps['color'];
onClick?: LinkProps['onClick']; onClick?: LinkProps['onClick'];
} }
const LinkExternal = ({ href, children, className, isLoading, variant, iconColor, onClick }: Props) => { const LinkExternal = ({ href, children, className, isLoading, variant, visual, iconColor, onClick }: Props) => {
const commonProps = { const commonProps = {
display: 'inline-block', display: 'inline-block',
alignItems: 'center', alignItems: 'center',
...@@ -44,7 +45,7 @@ const LinkExternal = ({ href, children, className, isLoading, variant, iconColor ...@@ -44,7 +45,7 @@ const LinkExternal = ({ href, children, className, isLoading, variant, iconColor
} }
return ( return (
<Link className={ className } { ...styleProps } target="_blank" href={ href } onClick={ onClick }> <Link className={ className } { ...styleProps } target="_blank" href={ href } onClick={ onClick } visual={ visual }>
{ children } { children }
<IconSvg name="link_external" boxSize={ 3 } verticalAlign="middle" color={ iconColor ?? 'icon_link_external' } flexShrink={ 0 }/> <IconSvg name="link_external" boxSize={ 3 } verticalAlign="middle" color={ iconColor ?? 'icon_link_external' } flexShrink={ 0 }/>
</Link> </Link>
......
import type { ChakraProps } from '@chakra-ui/react'; import type { ChakraProps } from '@chakra-ui/react';
import { useColorModeValue } from '@chakra-ui/react';
import { useColorModeValue } from 'toolkit/chakra/color-mode';
export type Variants = 'subtle'; export type Variants = 'subtle';
// TODO @tom2drum remove this
export function useLinkStyles(commonProps: ChakraProps, variant?: Variants) { export function useLinkStyles(commonProps: ChakraProps, variant?: Variants) {
const subtleLinkBg = useColorModeValue('gray.100', 'gray.700'); const subtleLinkBg = useColorModeValue('gray.100', 'gray.700');
......
import { Modal, ModalBody, ModalCloseButton, ModalContent, ModalHeader, ModalOverlay } from '@chakra-ui/react';
import { useQueryClient } from '@tanstack/react-query'; import { useQueryClient } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
...@@ -9,6 +8,7 @@ import config from 'configs/app'; ...@@ -9,6 +8,7 @@ import config from 'configs/app';
import { getResourceKey } from 'lib/api/useApiQuery'; import { getResourceKey } from 'lib/api/useApiQuery';
import useGetCsrfToken from 'lib/hooks/useGetCsrfToken'; import useGetCsrfToken from 'lib/hooks/useGetCsrfToken';
import * as mixpanel from 'lib/mixpanel'; import * as mixpanel from 'lib/mixpanel';
import { DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogHeader, DialogRoot } from 'toolkit/chakra/dialog';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import AuthModalScreenConnectWallet from './screens/AuthModalScreenConnectWallet'; import AuthModalScreenConnectWallet from './screens/AuthModalScreenConnectWallet';
...@@ -18,6 +18,7 @@ import AuthModalScreenSelectMethod from './screens/AuthModalScreenSelectMethod'; ...@@ -18,6 +18,7 @@ import AuthModalScreenSelectMethod from './screens/AuthModalScreenSelectMethod';
import AuthModalScreenSuccessEmail from './screens/AuthModalScreenSuccessEmail'; import AuthModalScreenSuccessEmail from './screens/AuthModalScreenSuccessEmail';
import AuthModalScreenSuccessWallet from './screens/AuthModalScreenSuccessWallet'; import AuthModalScreenSuccessWallet from './screens/AuthModalScreenSuccessWallet';
// TODO @tom2drum fix auth modal
const feature = config.features.account; const feature = config.features.account;
interface Props { interface Props {
...@@ -94,6 +95,10 @@ const AuthModal = ({ initialScreen, onClose, mixpanelConfig, closeOnError }: Pro ...@@ -94,6 +95,10 @@ const AuthModal = ({ initialScreen, onClose, mixpanelConfig, closeOnError }: Pro
onClose(isSuccess); onClose(isSuccess);
}, [ isSuccess, onClose ]); }, [ isSuccess, onClose ]);
const onModalOpenChange = React.useCallback(({ open }: { open: boolean }) => {
open && onClose();
}, [ onClose ]);
const header = (() => { const header = (() => {
const currentStep = steps[steps.length - 1]; const currentStep = steps[steps.length - 1];
switch (currentStep.type) { switch (currentStep.type) {
...@@ -163,10 +168,10 @@ const AuthModal = ({ initialScreen, onClose, mixpanelConfig, closeOnError }: Pro ...@@ -163,10 +168,10 @@ const AuthModal = ({ initialScreen, onClose, mixpanelConfig, closeOnError }: Pro
} }
return ( return (
<Modal isOpen onClose={ onModalClose } size={{ base: 'full', lg: 'sm' }}> <DialogRoot open onOpenChange={ onModalOpenChange } size={{ base: 'full', lg: 'sm' }}>
<ModalOverlay/> <DialogBackdrop/>
<ModalContent p={ 6 } maxW={{ lg: '400px' }}> <DialogContent p={ 6 } maxW={{ lg: '400px' }}>
<ModalHeader fontWeight="500" textStyle="h3" mb={ 2 } display="flex" alignItems="center" columnGap={ 2 }> <DialogHeader fontWeight="500" textStyle="h3" mb={ 2 } display="flex" alignItems="center" columnGap={ 2 }>
{ steps.length > 1 && !steps[steps.length - 1].type.startsWith('success') && ( { steps.length > 1 && !steps[steps.length - 1].type.startsWith('success') && (
<IconSvg <IconSvg
name="arrows/east" name="arrows/east"
...@@ -179,13 +184,13 @@ const AuthModal = ({ initialScreen, onClose, mixpanelConfig, closeOnError }: Pro ...@@ -179,13 +184,13 @@ const AuthModal = ({ initialScreen, onClose, mixpanelConfig, closeOnError }: Pro
/> />
) } ) }
{ header } { header }
</ModalHeader> </DialogHeader>
<ModalCloseButton top={ 6 } right={ 6 } color="gray.400"/> <DialogCloseTrigger top={ 6 } right={ 6 } color="gray.400"/>
<ModalBody mb={ 0 }> <DialogBody mb={ 0 }>
{ content } { content }
</ModalBody> </DialogBody>
</ModalContent> </DialogContent>
</Modal> </DialogRoot>
); );
}; };
......
...@@ -154,7 +154,7 @@ const Footer = () => { ...@@ -154,7 +154,7 @@ const Footer = () => {
const containerProps: HTMLChakraProps<'div'> = { const containerProps: HTMLChakraProps<'div'> = {
as: 'footer', as: 'footer',
borderTopWidth: '1px', borderTopWidth: '1px',
borderTopColor: 'divider', borderTopColor: 'border.divider',
}; };
const contentProps: GridProps = { const contentProps: GridProps = {
......
import { useColorModeValue, useBreakpointValue, chakra } from '@chakra-ui/react'; import { useBreakpointValue, chakra } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import getDefaultTransitionProps from 'theme/utils/getDefaultTransitionProps'; import { useColorModeValue } from 'toolkit/chakra/color-mode';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
export const LIGHTNING_LABEL_CLASS_NAME = 'lightning-label'; export const LIGHTNING_LABEL_CLASS_NAME = 'lightning-label';
...@@ -15,7 +15,6 @@ interface Props { ...@@ -15,7 +15,6 @@ interface Props {
const LightningLabel = ({ className, iconColor, isCollapsed }: Props) => { const LightningLabel = ({ className, iconColor, isCollapsed }: Props) => {
const isLgScreen = useBreakpointValue({ base: false, lg: true, xl: false }); const isLgScreen = useBreakpointValue({ base: false, lg: true, xl: false });
const themeBgColor = useColorModeValue('white', 'black'); const themeBgColor = useColorModeValue('white', 'black');
const defaultTransitionProps = getDefaultTransitionProps({ transitionProperty: 'color' });
const isExpanded = isCollapsed === false; const isExpanded = isCollapsed === false;
...@@ -36,7 +35,6 @@ const LightningLabel = ({ className, iconColor, isCollapsed }: Props) => { ...@@ -36,7 +35,6 @@ const LightningLabel = ({ className, iconColor, isCollapsed }: Props) => {
top={{ lg: isExpanded ? '0' : '10px', xl: isCollapsed ? '10px' : '0' }} top={{ lg: isExpanded ? '0' : '10px', xl: isCollapsed ? '10px' : '0' }}
right={{ lg: isExpanded ? '0' : '15px', xl: isCollapsed ? '15px' : '0' }} right={{ lg: isExpanded ? '0' : '15px', xl: isCollapsed ? '15px' : '0' }}
color={ color } color={ color }
{ ...defaultTransitionProps }
/> />
); );
}; };
......
...@@ -11,7 +11,6 @@ import LinkInternal from 'ui/shared/links/LinkInternal'; ...@@ -11,7 +11,6 @@ import LinkInternal from 'ui/shared/links/LinkInternal';
import LightningLabel from '../LightningLabel'; import LightningLabel from '../LightningLabel';
import NavLinkIcon from '../NavLinkIcon'; import NavLinkIcon from '../NavLinkIcon';
import useColors from '../useColors';
import { checkRouteHighlight } from '../utils'; import { checkRouteHighlight } from '../utils';
interface Props { interface Props {
...@@ -23,10 +22,7 @@ interface Props { ...@@ -23,10 +22,7 @@ interface Props {
const NavLink = ({ className, item, noIcon }: Props) => { const NavLink = ({ className, item, noIcon }: Props) => {
const isInternalLink = isInternalItem(item); const isInternalLink = isInternalItem(item);
const colors = useColors(); const isActive = 'isActive' in item && item.isActive;
const color = 'isActive' in item && item.isActive ? colors.text.active : colors.text.default;
const bgColor = 'isActive' in item && item.isActive ? colors.bg.active : colors.bg.default;
const Link = isInternalLink ? LinkInternal : LinkExternal; const Link = isInternalLink ? LinkInternal : LinkExternal;
const href = isInternalLink ? route(item.nextRoute) : item.url; const href = isInternalLink ? route(item.nextRoute) : item.url;
...@@ -41,20 +37,25 @@ const NavLink = ({ className, item, noIcon }: Props) => { ...@@ -41,20 +37,25 @@ const NavLink = ({ className, item, noIcon }: Props) => {
href={ href } href={ href }
display="flex" display="flex"
alignItems="center" alignItems="center"
color={ color } visual="navigation"
bgColor={ bgColor } { ...(isActive ? { 'data-selected': true } : {}) }
_hover={{ textDecoration: 'none', color: colors.text.hover }}
w="224px" w="224px"
px={ 2 } px={ 2 }
py="9px" py="9px"
fontSize="sm" textStyle="sm"
lineHeight={ 5 }
fontWeight={ 500 } fontWeight={ 500 }
borderRadius="base" borderRadius="base"
> >
{ !noIcon && <NavLinkIcon item={ item } mr={ 3 }/> } { !noIcon && <NavLinkIcon item={ item } mr={ 3 }/> }
<chakra.span>{ item.text }</chakra.span> <chakra.span>{ item.text }</chakra.span>
{ isHighlighted && <LightningLabel iconColor={ bgColor } position={{ lg: 'static' }} ml={{ lg: '2px' }} isCollapsed={ false }/> } { isHighlighted && (
<LightningLabel
iconColor={ isActive ? 'link.navigation.bg.selected' : 'link.navigation.bg' }
position={{ lg: 'static' }}
ml={{ lg: '2px' }}
isCollapsed={ false }
/>
) }
</Link> </Link>
</chakra.li> </chakra.li>
); );
......
import { HStack, PopoverBody, PopoverContent, PopoverTrigger, chakra, StackDivider } from '@chakra-ui/react'; import { HStack, chakra, Separator, Link } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { NavGroupItem } from 'types/client/navigation'; import type { NavGroupItem } from 'types/client/navigation';
import getDefaultTransitionProps from 'theme/utils/getDefaultTransitionProps'; import { PopoverRoot, PopoverBody, PopoverContent, PopoverTrigger } from 'toolkit/chakra/popover';
import Popover from 'ui/shared/chakra/Popover';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import LightningLabel from '../LightningLabel'; import LightningLabel from '../LightningLabel';
import useColors from '../useColors';
import { checkRouteHighlight } from '../utils'; import { checkRouteHighlight } from '../utils';
import NavLink from './NavLink'; import NavLink from './NavLink';
interface Props { interface Props {
...@@ -16,75 +14,83 @@ interface Props { ...@@ -16,75 +14,83 @@ interface Props {
} }
const NavLinkGroup = ({ item }: Props) => { const NavLinkGroup = ({ item }: Props) => {
const colors = useColors(); const [ isOpen, setIsOpen ] = React.useState(false);
const bgColor = item.isActive ? colors.bg.active : colors.bg.default; // const bgColor = item.isActive ? colors.bg.active : colors.bg.default;
const color = item.isActive ? colors.text.active : colors.text.default; // const color = item.isActive ? colors.text.active : colors.text.default;
const isHighlighted = checkRouteHighlight(item.subItems); const isHighlighted = checkRouteHighlight(item.subItems);
const hasGroups = item.subItems.some((subItem) => Array.isArray(subItem)); const hasGroups = item.subItems.some((subItem) => Array.isArray(subItem));
const handleOpenChange = React.useCallback(({ open }: { open: boolean }) => {
setIsOpen(open);
}, []);
return ( return (
<Popover <PopoverRoot
trigger="hover" // TODO @tom2drum make menu open on hover
placement="bottom" // trigger="hover"
isLazy onOpenChange={ handleOpenChange }
gutter={ 8 } lazyMount
positioning={{
placement: 'bottom',
offset: { mainAxis: 8 },
}}
> >
{ ({ isOpen }) => ( <PopoverTrigger>
<> <Link
<PopoverTrigger> as="li"
<chakra.li listStyleType="none"
listStyleType="none" display="flex"
display="flex" alignItems="center"
alignItems="center" px={ 2 }
px={ 2 } py={ 1.5 }
py={ 1.5 } textStyle="sm"
fontSize="sm" fontWeight={ 500 }
lineHeight={ 5 } visual="navigation"
fontWeight={ 500 } { ...(item.isActive ? { 'data-selected': true } : {}) }
cursor="pointer" { ...(isOpen ? { 'data-active': true } : {}) }
color={ isOpen ? colors.text.hover : color } borderRadius="base"
_hover={{ color: colors.text.hover }} >
bgColor={ bgColor } { item.text }
borderRadius="base" { isHighlighted && (
{ ...getDefaultTransitionProps() } <LightningLabel
> iconColor={ item.isActive ? 'link.navigation.bg.selected' : 'link.navigation.bg' }
{ item.text } position={{ lg: 'static' }}
{ isHighlighted && <LightningLabel iconColor={ bgColor } position={{ lg: 'static' }} ml={{ lg: '2px' }}/> } ml={{ lg: '2px' }}
<IconSvg name="arrows/east-mini" boxSize={ 5 } transform="rotate(-90deg)" ml={ 1 }/> />
</chakra.li> ) }
</PopoverTrigger> <IconSvg name="arrows/east-mini" boxSize={ 5 } transform="rotate(-90deg)" ml={ 1 }/>
<PopoverContent w="fit-content"> </Link>
<PopoverBody p={ 4 }> </PopoverTrigger>
{ hasGroups ? ( <PopoverContent>
<HStack divider={ <StackDivider borderColor="divider"/> } alignItems="flex-start"> <PopoverBody>
{ item.subItems.map((subItem, index) => { { hasGroups ? (
if (!Array.isArray(subItem)) { <HStack separator={ <Separator/> } alignItems="flex-start">
return <NavLink key={ subItem.text } item={ subItem }/>; { item.subItems.map((subItem, index) => {
} if (!Array.isArray(subItem)) {
return <NavLink key={ subItem.text } item={ subItem }/>;
}
return ( return (
<chakra.ul key={ index } display="flex" flexDir="column" rowGap={ 1 }> <chakra.ul key={ index } display="flex" flexDir="column" rowGap={ 1 }>
{ subItem.map((navItem) => <NavLink key={ navItem.text } item={ navItem }/>) } { subItem.map((navItem) => <NavLink key={ navItem.text } item={ navItem }/>) }
</chakra.ul> </chakra.ul>
); );
}) } }) }
</HStack> </HStack>
) : ( ) : (
<chakra.ul display="flex" flexDir="column" rowGap={ 1 }> <chakra.ul display="flex" flexDir="column" rowGap={ 1 }>
{ item.subItems.map((subItem) => { { item.subItems.map((subItem) => {
if (Array.isArray(subItem)) { if (Array.isArray(subItem)) {
return null; return null;
} }
return <NavLink key={ subItem.text } item={ subItem }/>; return <NavLink key={ subItem.text } item={ subItem }/>;
}) } }) }
</chakra.ul> </chakra.ul>
) } ) }
</PopoverBody> </PopoverBody>
</PopoverContent> </PopoverContent>
</> </PopoverRoot>
) }
</Popover>
); );
}; };
......
...@@ -17,7 +17,7 @@ const NavigationDesktop = () => { ...@@ -17,7 +17,7 @@ const NavigationDesktop = () => {
const { mainNavItems } = useNavItems(); const { mainNavItems } = useNavItems();
return ( return (
<Box borderColor="divider" borderBottomWidth="1px"> <Box borderColor="border.divider" borderBottomWidth="1px">
<Flex <Flex
display={{ base: 'none', lg: 'flex' }} display={{ base: 'none', lg: 'flex' }}
alignItems="center" alignItems="center"
......
...@@ -82,7 +82,7 @@ const NavigationMobile = ({ onNavLinkClick, isMarketplaceAppPage }: Props) => { ...@@ -82,7 +82,7 @@ const NavigationMobile = ({ onNavLinkClick, isMarketplaceAppPage }: Props) => {
mt={ 3 } mt={ 3 }
pt={ 3 } pt={ 3 }
borderTopWidth="1px" borderTopWidth="1px"
borderColor="divider" borderColor="border.divider"
> >
<VStack as="ul" spacing="1" alignItems="flex-start"> <VStack as="ul" spacing="1" alignItems="flex-start">
<NavLinkRewards onClick={ onNavLinkClick } isCollapsed={ isCollapsed }/> <NavLinkRewards onClick={ onNavLinkClick } isCollapsed={ isCollapsed }/>
...@@ -119,7 +119,7 @@ const NavigationMobile = ({ onNavLinkClick, isMarketplaceAppPage }: Props) => { ...@@ -119,7 +119,7 @@ const NavigationMobile = ({ onNavLinkClick, isMarketplaceAppPage }: Props) => {
mb: 2, mb: 2,
pb: 2, pb: 2,
borderBottomWidth: '1px', borderBottomWidth: '1px',
borderColor: 'divider', borderColor: 'border.divider',
}} }}
> >
{ item.map(subItem => <NavLink key={ subItem.text } item={ subItem } onClick={ onNavLinkClick } isCollapsed={ isCollapsed }/>) } { item.map(subItem => <NavLink key={ subItem.text } item={ subItem } onClick={ onNavLinkClick } isCollapsed={ isCollapsed }/>) }
......
import { useColorModeValue } from '@chakra-ui/react'; import { useColorModeValue } from 'toolkit/chakra/color-mode';
// TODO @tom2drum remove this
export default function useColors() { export default function useColors() {
return { return {
text: { text: {
...@@ -12,7 +13,7 @@ export default function useColors() { ...@@ -12,7 +13,7 @@ export default function useColors() {
active: useColorModeValue('blue.50', 'gray.800'), active: useColorModeValue('blue.50', 'gray.800'),
}, },
border: { border: {
'default': 'divider', 'default': 'border.divider',
active: useColorModeValue('blue.50', 'gray.800'), active: useColorModeValue('blue.50', 'gray.800'),
}, },
}; };
......
...@@ -90,7 +90,7 @@ const NavLinkGroup = ({ item, isCollapsed }: Props) => { ...@@ -90,7 +90,7 @@ const NavLinkGroup = ({ item, isCollapsed }: Props) => {
mb: 2, mb: 2,
pb: 2, pb: 2,
borderBottomWidth: '1px', borderBottomWidth: '1px',
borderColor: 'divider', borderColor: 'border.divider',
}} }}
> >
{ subItem.map(subSubItem => <NavLink key={ subSubItem.text } item={ subSubItem } isCollapsed={ false }/>) } { subItem.map(subSubItem => <NavLink key={ subSubItem.text } item={ subSubItem } isCollapsed={ false }/>) }
......
...@@ -49,7 +49,7 @@ const NavigationDesktop = () => { ...@@ -49,7 +49,7 @@ const NavigationDesktop = () => {
const chevronIconStyles = { const chevronIconStyles = {
bgColor: useColorModeValue('white', 'black'), bgColor: useColorModeValue('white', 'black'),
color: useColorModeValue('blackAlpha.400', 'whiteAlpha.400'), color: useColorModeValue('blackAlpha.400', 'whiteAlpha.400'),
borderColor: 'divider', borderColor: 'border.divider',
}; };
const isExpanded = isCollapsed === false; const isExpanded = isCollapsed === false;
...@@ -62,7 +62,7 @@ const NavigationDesktop = () => { ...@@ -62,7 +62,7 @@ const NavigationDesktop = () => {
flexDirection="column" flexDirection="column"
alignItems="stretch" alignItems="stretch"
borderRight="1px solid" borderRight="1px solid"
borderColor="divider" borderColor="border.divider"
px={{ lg: isExpanded ? 6 : 4, xl: isCollapsed ? 4 : 6 }} px={{ lg: isExpanded ? 6 : 4, xl: isCollapsed ? 4 : 6 }}
py={ 12 } py={ 12 }
width={{ lg: isExpanded ? '229px' : '92px', xl: isCollapsed ? '92px' : '229px' }} width={{ lg: isExpanded ? '229px' : '92px', xl: isCollapsed ? '92px' : '229px' }}
...@@ -99,7 +99,7 @@ const NavigationDesktop = () => { ...@@ -99,7 +99,7 @@ const NavigationDesktop = () => {
</VStack> </VStack>
</Box> </Box>
{ isAuth && ( { isAuth && (
<Box as="nav" borderTopWidth="1px" borderColor="divider" w="100%" mt={ 3 } pt={ 3 }> <Box as="nav" borderTopWidth="1px" borderColor="border.divider" w="100%" mt={ 3 } pt={ 3 }>
<VStack as="ul" spacing="1" alignItems="flex-start"> <VStack as="ul" spacing="1" alignItems="flex-start">
<NavLinkRewards isCollapsed={ isCollapsed }/> <NavLinkRewards isCollapsed={ isCollapsed }/>
{ accountNavItems.map((item) => <NavLink key={ item.text } item={ item } isCollapsed={ isCollapsed }/>) } { accountNavItems.map((item) => <NavLink key={ item.text } item={ item } isCollapsed={ isCollapsed }/>) }
......
import { Box, Image, useColorModeValue, Skeleton, chakra } from '@chakra-ui/react'; import { Box, Image, Skeleton, chakra } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import { route } from 'nextjs-routes'; import { route } from 'nextjs-routes';
import config from 'configs/app'; import config from 'configs/app';
import { useColorModeValue } from 'toolkit/chakra/color-mode';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
......
...@@ -15,7 +15,7 @@ export default function useColors() { ...@@ -15,7 +15,7 @@ export default function useColors() {
active: useColorModeValue('blue.50', 'whiteAlpha.100'), active: useColorModeValue('blue.50', 'whiteAlpha.100'),
}, },
border: { border: {
'default': 'divider', 'default': 'border.divider',
active: useColorModeValue('blue.50', 'whiteAlpha.100'), active: useColorModeValue('blue.50', 'whiteAlpha.100'),
}, },
}; };
......
...@@ -44,7 +44,7 @@ const SearchBarSuggest = ({ onClick, onClear }: Props) => { ...@@ -44,7 +44,7 @@ const SearchBarSuggest = ({ onClick, onClear }: Props) => {
return ( return (
<Box py={ 6 }> <Box py={ 6 }>
{ !isMobile && ( { !isMobile && (
<Box pb={ 4 } mb={ 5 } borderColor="divider" borderBottomWidth="1px" _empty={{ display: 'none' }}> <Box pb={ 4 } mb={ 5 } borderColor="border.divider" borderBottomWidth="1px" _empty={{ display: 'none' }}>
<TextAd/> <TextAd/>
</Box> </Box>
) } ) }
...@@ -57,7 +57,7 @@ const SearchBarSuggest = ({ onClick, onClear }: Props) => { ...@@ -57,7 +57,7 @@ const SearchBarSuggest = ({ onClick, onClear }: Props) => {
key={ kw } key={ kw }
py={ 3 } py={ 3 }
px={ 1 } px={ 1 }
borderColor="divider" borderColor="border.divider"
borderBottomWidth="1px" borderBottomWidth="1px"
_last={{ _last={{
borderBottomWidth: '0', borderBottomWidth: '0',
......
...@@ -192,7 +192,7 @@ const SearchBarSuggest = ({ query, searchTerm, onItemClick, containerId }: Props ...@@ -192,7 +192,7 @@ const SearchBarSuggest = ({ query, searchTerm, onItemClick, containerId }: Props
return ( return (
<Box mt={ 5 } mb={ 5 }> <Box mt={ 5 } mb={ 5 }>
{ !isMobile && ( { !isMobile && (
<Box pb={ 4 } mb={ 5 } borderColor="divider" borderBottomWidth="1px" _empty={{ display: 'none' }}> <Box pb={ 4 } mb={ 5 } borderColor="border.divider" borderBottomWidth="1px" _empty={{ display: 'none' }}>
<TextAd/> <TextAd/>
</Box> </Box>
) } ) }
......
...@@ -16,7 +16,7 @@ const SearchBarSuggestItemLink = ({ onClick, href, target, children }: Props) => ...@@ -16,7 +16,7 @@ const SearchBarSuggestItemLink = ({ onClick, href, target, children }: Props) =>
display="flex" display="flex"
flexDir="column" flexDir="column"
rowGap={ 2 } rowGap={ 2 }
borderColor="divider" borderColor="border.divider"
borderBottomWidth="1px" borderBottomWidth="1px"
_last={{ _last={{
borderBottomWidth: '0', borderBottomWidth: '0',
......
...@@ -34,7 +34,7 @@ const GetGasButton = () => { ...@@ -34,7 +34,7 @@ const GetGasButton = () => {
return ( return (
<> <>
<Box h="1px" w="8px" bg="divider" mx={ 1 }/> <Box h="1px" w="8px" bg="border.divider" mx={ 1 }/>
<Link <Link
href={ href } href={ href }
display="flex" display="flex"
......
...@@ -76,7 +76,7 @@ const TopBarStats = () => { ...@@ -76,7 +76,7 @@ const TopBarStats = () => {
</Skeleton> </Skeleton>
</Flex> </Flex>
) } ) }
{ data?.coin_price && config.features.gasTracker.isEnabled && <TextSeparator color="divider"/> } { data?.coin_price && config.features.gasTracker.isEnabled && <TextSeparator color="border.divider"/> }
{ data?.gas_prices && data.gas_prices.average !== null && config.features.gasTracker.isEnabled && ( { data?.gas_prices && data.gas_prices.average !== null && config.features.gasTracker.isEnabled && (
<> <>
<Skeleton isLoaded={ !isPlaceholderData }> <Skeleton isLoaded={ !isPlaceholderData }>
......
...@@ -27,7 +27,7 @@ const Settings = () => { ...@@ -27,7 +27,7 @@ const Settings = () => {
<PopoverContent overflowY="hidden" w="auto" fontSize="sm"> <PopoverContent overflowY="hidden" w="auto" fontSize="sm">
<PopoverBody boxShadow="2xl" p={ 4 }> <PopoverBody boxShadow="2xl" p={ 4 }>
<SettingsColorTheme onSelect={ onClose }/> <SettingsColorTheme onSelect={ onClose }/>
<Box borderColor="divider" borderWidth="1px" my={ 3 }/> <Box borderColor="border.divider" borderWidth="1px" my={ 3 }/>
<SettingsIdentIcon/> <SettingsIdentIcon/>
<SettingsAddressFormat/> <SettingsAddressFormat/>
</PopoverBody> </PopoverBody>
......
import type { ButtonProps } from '@chakra-ui/react'; import type { ButtonProps } from '@chakra-ui/react';
import { Button, Tooltip, Box, HStack } from '@chakra-ui/react'; import { Box, HStack } from '@chakra-ui/react';
import type { UseQueryResult } from '@tanstack/react-query'; import type { UseQueryResult } from '@tanstack/react-query';
import React, { useCallback, useState } from 'react'; import React, { useCallback, useState } from 'react';
...@@ -9,6 +9,8 @@ import { useMarketplaceContext } from 'lib/contexts/marketplace'; ...@@ -9,6 +9,8 @@ import { useMarketplaceContext } from 'lib/contexts/marketplace';
import useIsMobile from 'lib/hooks/useIsMobile'; import useIsMobile from 'lib/hooks/useIsMobile';
import shortenString from 'lib/shortenString'; import shortenString from 'lib/shortenString';
import useWeb3AccountWithDomain from 'lib/web3/useAccountWithDomain'; import useWeb3AccountWithDomain from 'lib/web3/useAccountWithDomain';
import { Button } from 'toolkit/chakra/button';
import { Tooltip } from 'toolkit/chakra/tooltip';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import UserIdenticon from '../UserIdenticon'; import UserIdenticon from '../UserIdenticon';
...@@ -17,12 +19,12 @@ import { getUserHandle } from './utils'; ...@@ -17,12 +19,12 @@ import { getUserHandle } from './utils';
interface Props { interface Props {
profileQuery: UseQueryResult<UserInfo, unknown>; profileQuery: UseQueryResult<UserInfo, unknown>;
size?: ButtonProps['size']; size?: ButtonProps['size'];
variant?: ButtonProps['variant']; visual?: ButtonProps['visual'];
onClick: () => void; onClick: () => void;
isPending?: boolean; isPending?: boolean;
} }
const UserProfileButton = ({ profileQuery, size, variant, onClick, isPending }: Props, ref: React.ForwardedRef<HTMLButtonElement>) => { const UserProfileButton = ({ profileQuery, size, visual, onClick, isPending }: Props, ref: React.ForwardedRef<HTMLButtonElement>) => {
const [ isFetched, setIsFetched ] = useState(false); const [ isFetched, setIsFetched ] = useState(false);
const isMobile = useIsMobile(); const isMobile = useIsMobile();
...@@ -69,25 +71,22 @@ const UserProfileButton = ({ profileQuery, size, variant, onClick, isPending }: ...@@ -69,25 +71,22 @@ const UserProfileButton = ({ profileQuery, size, variant, onClick, isPending }:
return ( return (
<Tooltip <Tooltip
label={ <span>Sign in to My Account to add tags,<br/>create watchlists, access API keys and more</span> } content={ <span>Sign in to My Account to add tags,<br/>create watchlists, access API keys and more</span> }
textAlign="center" disabled={ isMobile || isLoading || Boolean(data) }
padding={ 2 }
isDisabled={ isMobile || isLoading || Boolean(data) }
openDelay={ 500 } openDelay={ 500 }
> >
<Button <Button
ref={ ref } ref={ ref }
size={ size } size={ size }
variant={ variant } visual={ visual }
onClick={ onClick } onClick={ onClick }
onFocus={ handleFocus } onFocus={ handleFocus }
data-selected={ dataExists } selected={ dataExists }
data-warning={ isAutoConnectDisabled } highlighted={ isAutoConnectDisabled }
fontSize="sm" textStyle="sm"
lineHeight={ 5 }
px={ dataExists ? 2.5 : 4 } px={ dataExists ? 2.5 : 4 }
fontWeight={ dataExists ? 700 : 600 } fontWeight={ dataExists ? 700 : 600 }
isLoading={ isButtonLoading } loading={ isButtonLoading }
> >
{ content } { content }
</Button> </Button>
......
...@@ -83,13 +83,13 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress } ...@@ -83,13 +83,13 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
fontSize="xs" fontSize="xs"
lineHeight={ 4 } lineHeight={ 4 }
fontWeight="500" fontWeight="500"
borderColor="divider" borderColor="border.divider"
borderWidth="1px" borderWidth="1px"
borderRadius="base" borderRadius="base"
color={ accountTextColor } color={ accountTextColor }
> >
{ config.features.blockchainInteraction.isEnabled && ( { config.features.blockchainInteraction.isEnabled && (
<Flex p={ 2 } borderColor="divider" borderBottomWidth="1px"> <Flex p={ 2 } borderColor="border.divider" borderBottomWidth="1px">
<Box>Address</Box> <Box>Address</Box>
<Hint <Hint
label={ `This wallet address is linked to your Blockscout account. It can be used to login ${ config.features.rewards.isEnabled ? 'and is used for Merits Program participation' : '' }` } // eslint-disable-line max-len label={ `This wallet address is linked to your Blockscout account. It can be used to login ${ config.features.rewards.isEnabled ? 'and is used for Merits Program participation' : '' }` } // eslint-disable-line max-len
......
import { PopoverBody, PopoverContent, PopoverTrigger, useDisclosure, type ButtonProps } from '@chakra-ui/react'; import { useDisclosure, type ButtonProps } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
...@@ -7,7 +7,7 @@ import type { Screen } from 'ui/snippets/auth/types'; ...@@ -7,7 +7,7 @@ import type { Screen } from 'ui/snippets/auth/types';
import config from 'configs/app'; import config from 'configs/app';
import * as mixpanel from 'lib/mixpanel'; import * as mixpanel from 'lib/mixpanel';
import useAccount from 'lib/web3/useAccount'; import useAccount from 'lib/web3/useAccount';
import Popover from 'ui/shared/chakra/Popover'; import { PopoverBody, PopoverContent, PopoverRoot, PopoverTrigger } from 'toolkit/chakra/popover';
import AuthModal from 'ui/snippets/auth/AuthModal'; import AuthModal from 'ui/snippets/auth/AuthModal';
import useProfileQuery from 'ui/snippets/auth/useProfileQuery'; import useProfileQuery from 'ui/snippets/auth/useProfileQuery';
...@@ -16,14 +16,14 @@ import UserProfileContent from './UserProfileContent'; ...@@ -16,14 +16,14 @@ import UserProfileContent from './UserProfileContent';
interface Props { interface Props {
buttonSize?: ButtonProps['size']; buttonSize?: ButtonProps['size'];
buttonVariant?: ButtonProps['variant']; buttonVisual?: ButtonProps['visual'];
} }
const initialScreen = { const initialScreen = {
type: config.features.blockchainInteraction.isEnabled ? 'select_method' as const : 'email' as const, type: config.features.blockchainInteraction.isEnabled ? 'select_method' as const : 'email' as const,
}; };
const UserProfileDesktop = ({ buttonSize, buttonVariant = 'header' }: Props) => { const UserProfileDesktop = ({ buttonSize, buttonVisual = 'header' }: Props) => {
const [ authInitialScreen, setAuthInitialScreen ] = React.useState<Screen>(initialScreen); const [ authInitialScreen, setAuthInitialScreen ] = React.useState<Screen>(initialScreen);
const router = useRouter(); const router = useRouter();
...@@ -62,14 +62,22 @@ const UserProfileDesktop = ({ buttonSize, buttonVariant = 'header' }: Props) => ...@@ -62,14 +62,22 @@ const UserProfileDesktop = ({ buttonSize, buttonVariant = 'header' }: Props) =>
authModal.onClose(); authModal.onClose();
}, [ authModal ]); }, [ authModal ]);
const handleOpenChange = React.useCallback(({ open }: { open: boolean }) => {
if (open) {
profileMenu.onOpen();
} else {
profileMenu.onClose();
}
}, [ profileMenu ]);
return ( return (
<> <>
<Popover openDelay={ 300 } placement="bottom-end" isLazy isOpen={ profileMenu.isOpen } onClose={ profileMenu.onClose }> <PopoverRoot positioning={{ placement: 'bottom-end' }} lazyMount open={ profileMenu.open } onOpenChange={ handleOpenChange }>
<PopoverTrigger> <PopoverTrigger>
<UserProfileButton <UserProfileButton
profileQuery={ profileQuery } profileQuery={ profileQuery }
size={ buttonSize } size={ buttonSize }
variant={ buttonVariant } visual={ buttonVisual }
onClick={ handleProfileButtonClick } onClick={ handleProfileButtonClick }
/> />
</PopoverTrigger> </PopoverTrigger>
...@@ -86,8 +94,8 @@ const UserProfileDesktop = ({ buttonSize, buttonVariant = 'header' }: Props) => ...@@ -86,8 +94,8 @@ const UserProfileDesktop = ({ buttonSize, buttonVariant = 'header' }: Props) =>
</PopoverBody> </PopoverBody>
</PopoverContent> </PopoverContent>
) } ) }
</Popover> </PopoverRoot>
{ authModal.isOpen && ( { authModal.open && (
<AuthModal <AuthModal
onClose={ handleAuthModalClose } onClose={ handleAuthModalClose }
initialScreen={ authInitialScreen } initialScreen={ authInitialScreen }
......
...@@ -14,6 +14,7 @@ interface Props { ...@@ -14,6 +14,7 @@ interface Props {
buttonVariant?: ButtonProps['variant']; buttonVariant?: ButtonProps['variant'];
} }
// TODO @tom2drum check this component
const UserWalletDesktop = ({ buttonSize, buttonVariant = 'header' }: Props) => { const UserWalletDesktop = ({ buttonSize, buttonVariant = 'header' }: Props) => {
const walletMenu = useDisclosure(); const walletMenu = useDisclosure();
......
...@@ -19,7 +19,7 @@ const MetadataAccordionItem = ({ children, className, level, isFlat }: Props) => ...@@ -19,7 +19,7 @@ const MetadataAccordionItem = ({ children, className, level, isFlat }: Props) =>
pl={ isFlat ? 0 : 6 } pl={ isFlat ? 0 : 6 }
columnGap={ 3 } columnGap={ 3 }
borderTopWidth="1px" borderTopWidth="1px"
borderColor="divider" borderColor="border.divider"
wordBreak="break-all" wordBreak="break-all"
rowGap={ 1 } rowGap={ 1 }
_last={{ _last={{
......
...@@ -27,7 +27,7 @@ const MetadataItemArray = ({ name, value, level }: Props) => { ...@@ -27,7 +27,7 @@ const MetadataItemArray = ({ name, value, level }: Props) => {
fontSize="sm" fontSize="sm"
textAlign="left" textAlign="left"
_expanded={{ _expanded={{
borderColor: 'divider', borderColor: 'border.divider',
borderBottomWidth: '1px', borderBottomWidth: '1px',
}} }}
> >
...@@ -75,7 +75,7 @@ const MetadataItemArray = ({ name, value, level }: Props) => { ...@@ -75,7 +75,7 @@ const MetadataItemArray = ({ name, value, level }: Props) => {
<Flex <Flex
key={ index } key={ index }
py={ 2 } py={ 2 }
_notFirst={{ borderColor: 'divider', borderTopWidth: '1px' }} _notFirst={{ borderColor: 'border.divider', borderTopWidth: '1px' }}
flexDir="column" flexDir="column"
rowGap={ 2 } rowGap={ 2 }
> >
......
...@@ -37,7 +37,7 @@ const MetadataItemObject = ({ name, value, level }: Props) => { ...@@ -37,7 +37,7 @@ const MetadataItemObject = ({ name, value, level }: Props) => {
fontSize="sm" fontSize="sm"
textAlign="left" textAlign="left"
_expanded={{ _expanded={{
borderColor: 'divider', borderColor: 'border.divider',
borderBottomWidth: '1px', borderBottomWidth: '1px',
}} }}
> >
......
...@@ -57,7 +57,7 @@ const TxAdditionalInfo = ({ hash, tx, isMobile, isLoading, className }: Props) = ...@@ -57,7 +57,7 @@ const TxAdditionalInfo = ({ hash, tx, isMobile, isLoading, className }: Props) =
<PopoverTrigger> <PopoverTrigger>
<AdditionalInfoButton isOpen={ isOpen } isLoading={ isLoading } className={ className }/> <AdditionalInfoButton isOpen={ isOpen } isLoading={ isLoading } className={ className }/>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent border="1px solid" borderColor="divider"> <PopoverContent border="1px solid" borderColor="border.divider">
<PopoverBody fontWeight={ 400 } fontSize="sm"> <PopoverBody fontWeight={ 400 } fontSize="sm">
{ content } { content }
</PopoverBody> </PopoverBody>
......
...@@ -18,7 +18,7 @@ import Utilization from 'ui/shared/Utilization/Utilization'; ...@@ -18,7 +18,7 @@ import Utilization from 'ui/shared/Utilization/Utilization';
const TxAdditionalInfoContent = ({ tx }: { tx: Transaction }) => { const TxAdditionalInfoContent = ({ tx }: { tx: Transaction }) => {
const sectionProps = { const sectionProps = {
borderBottom: '1px solid', borderBottom: '1px solid',
borderColor: 'divider', borderColor: 'border.divider',
paddingBottom: 4, paddingBottom: 4,
}; };
......
...@@ -48,13 +48,13 @@ const TxsFilters = ({ filters, appliedFiltersNum }: Props) => { ...@@ -48,13 +48,13 @@ const TxsFilters = ({ filters, appliedFiltersNum }: Props) => {
return ( return (
<PopoverFilter contentProps={{ w: { md: '100%', lg: '438px' } }} appliedFiltersNum={ appliedFiltersNum }> <PopoverFilter contentProps={{ w: { md: '100%', lg: '438px' } }} appliedFiltersNum={ appliedFiltersNum }>
<Text variant="secondary" fontWeight="600" fontSize="sm">Type</Text> <Text variant="secondary" fontWeight="600" fontSize="sm">Type</Text>
<Grid gridTemplateColumns="1fr 1fr" rowGap={ 5 } mt={ 4 } mb={ 4 } pb={ 6 } borderBottom="1px solid" borderColor="divider"> <Grid gridTemplateColumns="1fr 1fr" rowGap={ 5 } mt={ 4 } mb={ 4 } pb={ 6 } borderBottom="1px solid" borderColor="border.divider">
<CheckboxGroup size="lg" onChange={ onTypeFilterChange } defaultValue={ typeFilter }> <CheckboxGroup size="lg" onChange={ onTypeFilterChange } defaultValue={ typeFilter }>
{ TYPE_OPTIONS.map(({ title, id }) => <Checkbox key={ id } value={ id }><Text fontSize="md">{ title }</Text></Checkbox>) } { TYPE_OPTIONS.map(({ title, id }) => <Checkbox key={ id } value={ id }><Text fontSize="md">{ title }</Text></Checkbox>) }
</CheckboxGroup> </CheckboxGroup>
</Grid> </Grid>
<Text variant="secondary" fontWeight="600" fontSize="sm">Method</Text> <Text variant="secondary" fontWeight="600" fontSize="sm">Method</Text>
<Grid gridTemplateColumns="1fr 1fr" rowGap={ 5 } mt={ 4 } mb={ 4 } pb={ 6 } borderBottom="1px solid" borderColor="divider"> <Grid gridTemplateColumns="1fr 1fr" rowGap={ 5 } mt={ 4 } mb={ 4 } pb={ 6 } borderBottom="1px solid" borderColor="border.divider">
<CheckboxGroup size="lg" onChange={ onMethodFilterChange } defaultValue={ methodFilter }> <CheckboxGroup size="lg" onChange={ onMethodFilterChange } defaultValue={ methodFilter }>
{ METHOD_OPTIONS.map(({ title, id }) => <Checkbox key={ id } value={ id }><Text fontSize="md">{ title }</Text></Checkbox>) } { METHOD_OPTIONS.map(({ title, id }) => <Checkbox key={ id } value={ id }><Text fontSize="md">{ title }</Text></Checkbox>) }
</CheckboxGroup> </CheckboxGroup>
......
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