Skip to content

Commit

Permalink
fix: breadcrumb | locale | styles
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtiti committed Sep 17, 2024
1 parent 397f021 commit 8181f17
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 1,171 deletions.
2 changes: 1 addition & 1 deletion cypress/fixtures/nextData.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"batch": "Sobrecarga de lote L1 Gas",
"maxPubData": "Máximos datos públicos por lote",
"maxGasBatch": "Máximo gas por lote",
"priorityTxMaxPubdata": "Maximos datos de prioridad"
"priorityTxMaxPubdata": "Máximos datos de prioridad"
},
"backButton": "Volver"
},
Expand Down
2 changes: 1 addition & 1 deletion public/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"batch": "Sobrecarga de lote L1 Gas",
"maxPubData": "Máximos datos públicos por lote",
"maxGasBatch": "Máximo gas por lote",
"priorityTxMaxPubdata": "Maximos datos de prioridad"
"priorityTxMaxPubdata": "Máximos datos de prioridad"
},
"backButton": "Volver"
},
Expand Down
8 changes: 5 additions & 3 deletions src/components/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Image from 'next/image';
import { useData, useCustomTheme } from '~/hooks';
import SmallArrowDark from '~/assets/icons/smallArrowDark.svg';
import SmallArrowLight from '~/assets/icons/smallArrowLight.svg';
import { capitalizeFirstLetter } from '~/utils';

interface BreadcrumbProps {
isChain: boolean;
Expand All @@ -15,13 +16,14 @@ export const Breadcrumb = ({ isChain }: BreadcrumbProps) => {
const pathname = usePathname();
const { chainData } = useData();
const { theme } = useCustomTheme();
const { t } = useTranslation();
const { t, i18n } = useTranslation();

const pathNames = pathname ? pathname.split('/').filter((path) => path) : [];

const breadcrumbItems = pathNames.map((path, index) => {
const isLast = index === pathNames.length - 1;
const displayName = isChain && isLast ? chainData?.metadata?.name || path : path;
const displayName =
isChain && isLast ? chainData?.metadata?.name || capitalizeFirstLetter(path) : capitalizeFirstLetter(path);
const href = `/${pathNames.slice(0, index + 1).join('/')}`;

return {
Expand All @@ -34,7 +36,7 @@ export const Breadcrumb = ({ isChain }: BreadcrumbProps) => {

return (
<BreadcrumbNav aria-label='breadcrumb'>
<BreadcrumbLink href='/' data-testid='home-breadcrumb'>
<BreadcrumbLink href={`/${i18n.language}`} data-testid='home-breadcrumb'>
{t('HOME.home')}
</BreadcrumbLink>

Expand Down
4 changes: 3 additions & 1 deletion src/containers/ChainDetail/ChainMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export const ChainMetadata = () => {
<MetadataItem>
<NativeTokenAvatar src={chainData?.baseToken.imageUrl || ''} alt={chainData?.baseToken.symbol} />
<Box>
<Label>{t('CHAIN.nativeToken')}</Label>
<Label variant='subtitle1' color='textSecondary' gutterBottom>
{t('CHAIN.nativeToken')}
</Label>
<Value>{chainData?.baseToken.symbol}</Value>
</Box>
</MetadataItem>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/LockedAssets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const AllTokensButton = styled(Button)(() => {
borderRadius: currentTheme.borderRadius,
padding: '0.5rem 1rem',
gap: currentTheme.gap,
width: '5.5rem',
minWidth: 'fit-content',
textTransform: 'none',
fontSize: '0.75rem',
marginTop: '1.5rem',
Expand Down
Loading

0 comments on commit 8181f17

Please sign in to comment.