Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release #68

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading