Commit 7914ba1b authored by tom's avatar tom

yet another tab styles update

parent c9dd38ec
...@@ -36,7 +36,6 @@ export const TabsCounter = ({ count }: TabsCounterProps) => { ...@@ -36,7 +36,6 @@ export const TabsCounter = ({ count }: TabsCounterProps) => {
return ( return (
<chakra.span <chakra.span
color={ count > 0 ? 'text.secondary' : { _light: 'blackAlpha.400', _dark: 'whiteAlpha.400' } } color={ count > 0 ? 'text.secondary' : { _light: 'blackAlpha.400', _dark: 'whiteAlpha.400' } }
ml={ 1 }
_groupHover={{ _groupHover={{
color: 'inherit', color: 'inherit',
}} }}
......
...@@ -155,19 +155,18 @@ const AdaptiveTabsList = (props: Props) => { ...@@ -155,19 +155,18 @@ const AdaptiveTabsList = (props: Props) => {
} }
return ( return (
<TabsTrigger <Skeleton loading={ isLoading } key={ value } asChild>
key={ value } <TabsTrigger
value={ value } value={ value }
ref={ ref } ref={ ref }
scrollSnapAlign="start" scrollSnapAlign="start"
flexShrink={ 0 } flexShrink={ 0 }
{ ...getItemStyles(index, tabsCut) } { ...getItemStyles(index, tabsCut) }
> >
<Skeleton loading={ isLoading }>
{ typeof tab.title === 'function' ? tab.title() : tab.title } { typeof tab.title === 'function' ? tab.title() : tab.title }
<TabsCounter count={ tab.count }/> <TabsCounter count={ tab.count }/>
</Skeleton> </TabsTrigger>
</TabsTrigger> </Skeleton>
); );
}) } }) }
{ {
......
...@@ -2,14 +2,15 @@ import React from 'react'; ...@@ -2,14 +2,15 @@ import React from 'react';
import type { TabItem } from './types'; import type { TabItem } from './types';
import type { ButtonProps } from 'toolkit/chakra/button'; import { PopoverBody, PopoverCloseTriggerWrapper, PopoverContent, PopoverRoot, PopoverTrigger } from 'toolkit/chakra/popover';
import { Button } from 'toolkit/chakra/button';
import { PopoverBody, PopoverContent, PopoverRoot, PopoverTrigger } from 'toolkit/chakra/popover';
import { TabsCounter, TabsTrigger } from 'toolkit/chakra/tabs'; import { TabsCounter, TabsTrigger } from 'toolkit/chakra/tabs';
import IconSvg from 'ui/shared/IconSvg';
import { getTabValue, menuButton } from './utils'; import { IconButton } from '../../chakra/icon-button';
import type { IconButtonProps } from '../../chakra/icon-button';
import { getTabValue } from './utils';
interface Props extends ButtonProps { interface Props extends IconButtonProps {
tabs: Array<TabItem>; tabs: Array<TabItem>;
tabsCut: number; tabsCut: number;
isActive: boolean; isActive: boolean;
...@@ -20,7 +21,7 @@ const AdaptiveTabsMenu = ({ tabs, tabsCut, isActive, ...props }: Props, ref: Rea ...@@ -20,7 +21,7 @@ const AdaptiveTabsMenu = ({ tabs, tabsCut, isActive, ...props }: Props, ref: Rea
return ( return (
<PopoverRoot positioning={{ placement: 'bottom-end' }}> <PopoverRoot positioning={{ placement: 'bottom-end' }}>
<PopoverTrigger> <PopoverTrigger>
<Button <IconButton
// we use "div" so the :last-of-type pseudo-class targets the last tab and not the menu trigger // we use "div" so the :last-of-type pseudo-class targets the last tab and not the menu trigger
as="div" as="div"
variant="plain" variant="plain"
...@@ -34,10 +35,11 @@ const AdaptiveTabsMenu = ({ tabs, tabsCut, isActive, ...props }: Props, ref: Rea ...@@ -34,10 +35,11 @@ const AdaptiveTabsMenu = ({ tabs, tabsCut, isActive, ...props }: Props, ref: Rea
}} }}
ref={ ref } ref={ ref }
expanded={ isActive } expanded={ isActive }
px="18px"
{ ...props } { ...props }
> >
{ menuButton.title } <IconSvg name="dots" boxSize={ 5 }/>
</Button> </IconButton>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent> <PopoverContent>
<PopoverBody display="flex" flexDir="column" rowGap={ 2 } px={ 0 }> <PopoverBody display="flex" flexDir="column" rowGap={ 2 } px={ 0 }>
...@@ -45,19 +47,23 @@ const AdaptiveTabsMenu = ({ tabs, tabsCut, isActive, ...props }: Props, ref: Rea ...@@ -45,19 +47,23 @@ const AdaptiveTabsMenu = ({ tabs, tabsCut, isActive, ...props }: Props, ref: Rea
const value = getTabValue(tab); const value = getTabValue(tab);
return ( return (
<TabsTrigger <PopoverCloseTriggerWrapper key={ value }>
key={ value } <TabsTrigger
value={ value } className="group"
w="100%" value={ value }
py="5px" w="100%"
borderRadius="none" py="5px"
_hover={{ borderRadius="none"
bg: 'tabs.solid.bg.selected', fontWeight="normal"
}} color="initial"
> _hover={{
{ typeof tab.title === 'function' ? tab.title() : tab.title } bg: 'tabs.solid.bg.selected',
<TabsCounter count={ tab.count }/> }}
</TabsTrigger> >
{ typeof tab.title === 'function' ? tab.title() : tab.title }
<TabsCounter count={ tab.count }/>
</TabsTrigger>
</PopoverCloseTriggerWrapper>
); );
}) } }) }
</PopoverBody> </PopoverBody>
......
...@@ -130,6 +130,7 @@ export const recipe = defineSlotRecipe({ ...@@ -130,6 +130,7 @@ export const recipe = defineSlotRecipe({
solid: { solid: {
trigger: { trigger: {
fontWeight: '600', fontWeight: '600',
gap: '1',
borderRadius: 'base', borderRadius: 'base',
color: 'tabs.solid.fg', color: 'tabs.solid.fg',
bg: 'transparent', bg: 'transparent',
...@@ -148,7 +149,7 @@ export const recipe = defineSlotRecipe({ ...@@ -148,7 +149,7 @@ export const recipe = defineSlotRecipe({
secondary: { secondary: {
list: { list: {
border: 'none', border: 'none',
columnGap: '3', columnGap: '2',
_horizontal: { _horizontal: {
_before: { _before: {
display: 'none', display: 'none',
......
...@@ -10,17 +10,13 @@ interface Props { ...@@ -10,17 +10,13 @@ interface Props {
shouldRender?: boolean; shouldRender?: boolean;
} }
const TAB_LIST_PROPS = {
columnGap: 3,
};
const AddressContract = ({ tabs, isLoading, shouldRender }: Props) => { const AddressContract = ({ tabs, isLoading, shouldRender }: Props) => {
if (!shouldRender) { if (!shouldRender) {
return null; return null;
} }
return ( return (
<RoutedTabs tabs={ tabs } variant="secondary" size="sm" listProps={ TAB_LIST_PROPS } isLoading={ isLoading }/> <RoutedTabs tabs={ tabs } variant="secondary" size="sm" isLoading={ isLoading }/>
); );
}; };
......
...@@ -34,12 +34,10 @@ const TAB_LIST_PROPS = { ...@@ -34,12 +34,10 @@ const TAB_LIST_PROPS = {
mt: 1, mt: 1,
mb: { base: 6, lg: 1 }, mb: { base: 6, lg: 1 },
py: 5, py: 5,
columnGap: 3,
}; };
const TAB_LIST_PROPS_MOBILE = { const TAB_LIST_PROPS_MOBILE = {
my: 8, my: 8,
columnGap: 3,
}; };
const getTokenFilterValue = (getFilterValuesFromQuery<NFTTokenType>).bind(null, NFT_TOKEN_TYPE_IDS); const getTokenFilterValue = (getFilterValuesFromQuery<NFTTokenType>).bind(null, NFT_TOKEN_TYPE_IDS);
......
...@@ -166,7 +166,7 @@ const AddressPageContent = () => { ...@@ -166,7 +166,7 @@ const AddressPageContent = () => {
return ( return (
<> <>
<span>{ tabName }</span> <span>{ tabName }</span>
<IconSvg name="status/success" boxSize="14px" color="green.500" ml={ 1 }/> <IconSvg name="status/success" boxSize="14px" color="green.500"/>
</> </>
); );
} }
......
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