Skip to content

Commit

Permalink
feat: release (#68)
Browse files Browse the repository at this point in the history
- Add network hexadecimal chain id
- Fix breadcrumb locale navigation
- Pixel perfect enhancements
  • Loading branch information
0xtiti authored Sep 19, 2024
2 parents 06b4c45 + 53459d9 commit b3374eb
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 1,174 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/navigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Navigation tests', () => {
cy.url().should('include', '/324');

cy.getByTestId('home-breadcrumb').click();
cy.url().should('eq', 'http://localhost:5173/');
cy.url().should('eq', 'http://localhost:5173/en');
cy.getByTestId('search-bar').find('input').should('have.value', '');
});

Expand Down
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
4 changes: 2 additions & 2 deletions 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 All @@ -87,7 +87,7 @@
"FOOTER": {
"docs": "Documentación",
"github": "GitHub",
"madeWithLove": "Hecho con",
"madeWith": "Hecho con",
"by": "por"
},
"WALLET": {
Expand Down
3 changes: 2 additions & 1 deletion src/components/AddNetworkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const AddNetworkButton = () => {

try {
await addNetwork({
chainId: chain as string,
chainId: '0x' + Number(chain)?.toString(16),
chainName: chainData?.metadata.name,
rpcUrls: chainData?.metadata.publicRpcs[0],
name: chainData?.baseToken.name,
Expand All @@ -39,6 +39,7 @@ export const AddNetworkButton = () => {
} catch (error) {
console.error('Failed to add network:', error);
alert(t('CHAIN.addNetworkFailed'));
setIsNetworkAdded(false);
}
};

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 b3374eb

Please sign in to comment.