diff --git a/.gitignore b/.gitignore index 95da2eb34..53b8c62f9 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,5 @@ certificates scripts/chainid-lookup.csv scripts/ledger-live-manifest.json + +!.vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..a2e91c34c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "i18n-ally.localesPaths": ["locales", "lib/i18n"], + "i18n-ally.namespace": true, + "i18n-ally.keystyle": "nested", + "biome.enabled": true, + "[typescript][javascript][typescriptreact][javascriptreact][html][css][json][jsonc]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "editor.formatOnSave": true +} diff --git a/app/[locale]/learn/[category]/page.tsx b/app/[locale]/learn/[category]/page.tsx index 76ff75bfe..b1422c465 100644 --- a/app/[locale]/learn/[category]/page.tsx +++ b/app/[locale]/learn/[category]/page.tsx @@ -59,7 +59,7 @@ const LearnSectionPage: NextPage = async ({ params }: Props) => {

{sidebar.map((entry) => entry.path === `/learn/${params.category}` ? ( - + {entry.children} ) : null, )} diff --git a/app/[locale]/merchandise/ClaimCodesSection.tsx b/app/[locale]/merchandise/ClaimCodesSection.tsx index 09f296326..c67655917 100644 --- a/app/[locale]/merchandise/ClaimCodesSection.tsx +++ b/app/[locale]/merchandise/ClaimCodesSection.tsx @@ -23,7 +23,10 @@ const ClaimCodesSection = () => {
{codes.map((code) => ( -
+
{code.code}
({shortenAddress(code.address, 4)})
diff --git a/app/[locale]/og.jpg/blog/route.tsx b/app/[locale]/og.jpg/blog/route.tsx index 6a1167c42..6b5668b4d 100644 --- a/app/[locale]/og.jpg/blog/route.tsx +++ b/app/[locale]/og.jpg/blog/route.tsx @@ -21,8 +21,8 @@ export const generateStaticParams = () => { export async function GET(req: Request, { params }: Props) { const t = await getTranslations({ locale: params.locale }); - const title = t(`blog.meta.title`); - const background = loadDataUrl(`public/assets/images/blog/cover.jpg`, 'image/jpeg'); + const title = t('blog.meta.title'); + const background = loadDataUrl('public/assets/images/blog/cover.jpg', 'image/jpeg'); return generateOgImage({ title, background }); } diff --git a/app/[locale]/og.jpg/exploits/[slug]/route.tsx b/app/[locale]/og.jpg/exploits/[slug]/route.tsx index 8ff6e1440..1dfe19be3 100644 --- a/app/[locale]/og.jpg/exploits/[slug]/route.tsx +++ b/app/[locale]/og.jpg/exploits/[slug]/route.tsx @@ -1,5 +1,3 @@ -// Note: this file contains TypeScript errors, but these errors are incorrect. I'm not sure how to fix them. - import { locales } from 'lib/i18n/config'; import { getChainLogo, getChainName, isSupportedChain } from 'lib/utils/chains'; import { formatExploitAmount, getAllExploits, getExploitBySlug, getUniqueChainIds } from 'lib/utils/exploits'; @@ -28,7 +26,9 @@ export async function GET(req: Request, { params }: Props) { const t = await getTranslations({ locale: params.locale }); const exploit = await getExploitBySlug(params.slug, params.locale); - const numberOfChainsStr = t('exploits.meta.og.chains', { count: getUniqueChainIds(exploit).length }); + const uniqueChainIds = getUniqueChainIds(exploit); + + const numberOfChainsStr = t('exploits.meta.og.chains', { count: uniqueChainIds.length }); const stolenAmountStr = t('exploits.meta.og.amount', { amount: formatExploitAmount(exploit.amount) }); const response = ( @@ -38,21 +38,22 @@ export async function GET(req: Request, { params }: Props) {
{exploit.date}
-
+
{stolenAmountStr}
-
+
{numberOfChainsStr}
-
- {getUniqueChainIds(exploit).map((chainId, index) => ( - +
+ {uniqueChainIds.slice(0, 16).map((chainId) => ( + ))} + {uniqueChainIds.length > 16 &&
{`+${uniqueChainIds.length - 16}`}
}
{t('exploits.meta.og.check')}
- + Revoke icon
); diff --git a/app/[locale]/og.jpg/exploits/route.tsx b/app/[locale]/og.jpg/exploits/route.tsx index bba697142..2f4335b7e 100644 --- a/app/[locale]/og.jpg/exploits/route.tsx +++ b/app/[locale]/og.jpg/exploits/route.tsx @@ -21,8 +21,8 @@ export const generateStaticParams = () => { export async function GET(req: Request, { params }: Props) { const t = await getTranslations({ locale: params.locale }); - const title = t(`exploits.meta.title`); - const background = loadDataUrl(`public/assets/images/exploits/cover.jpg`, 'image/jpeg'); + const title = t('exploits.meta.title'); + const background = loadDataUrl('public/assets/images/exploits/cover.jpg', 'image/jpeg'); return generateOgImage({ title, background }); } diff --git a/app/[locale]/og.jpg/learn/faq/route.tsx b/app/[locale]/og.jpg/learn/faq/route.tsx index fe32065e0..8d0d622da 100644 --- a/app/[locale]/og.jpg/learn/faq/route.tsx +++ b/app/[locale]/og.jpg/learn/faq/route.tsx @@ -21,8 +21,8 @@ export const generateStaticParams = () => { export async function GET(req: Request, { params }: Props) { const t = await getTranslations({ locale: params.locale }); - const title = t(`faq.meta.title`); - const background = loadDataUrl(`public/assets/images/learn/faq/cover.jpg`, 'image/jpeg'); + const title = t('faq.meta.title'); + const background = loadDataUrl('public/assets/images/learn/faq/cover.jpg', 'image/jpeg'); return generateOgImage({ title, background }); } diff --git a/app/[locale]/og.jpg/learn/route.tsx b/app/[locale]/og.jpg/learn/route.tsx index 546ef1bea..00f5d5755 100644 --- a/app/[locale]/og.jpg/learn/route.tsx +++ b/app/[locale]/og.jpg/learn/route.tsx @@ -21,8 +21,8 @@ export const generateStaticParams = () => { export async function GET(req: Request, { params }: Props) { const t = await getTranslations({ locale: params.locale }); - const title = t(`learn.meta.title`); - const background = loadDataUrl(`public/assets/images/learn/cover.jpg`, 'image/jpeg'); + const title = t('learn.meta.title'); + const background = loadDataUrl('public/assets/images/learn/cover.jpg', 'image/jpeg'); return generateOgImage({ title, background }); } diff --git a/app/[locale]/og.jpg/learn/wallets/add-network/route.tsx b/app/[locale]/og.jpg/learn/wallets/add-network/route.tsx index 808a8df12..2f03ec165 100644 --- a/app/[locale]/og.jpg/learn/wallets/add-network/route.tsx +++ b/app/[locale]/og.jpg/learn/wallets/add-network/route.tsx @@ -21,8 +21,8 @@ export const generateStaticParams = () => { export async function GET(req: Request, { params }: Props) { const t = await getTranslations({ locale: params.locale }); - const title = t(`learn.add_network.sidebar_title`); - const background = loadDataUrl(`public/assets/images/learn/wallets/add-network/cover.jpg`, 'image/jpeg'); + const title = t('learn.add_network.sidebar_title'); + const background = loadDataUrl('public/assets/images/learn/wallets/add-network/cover.jpg', 'image/jpeg'); return generateOgImage({ title, background }); } diff --git a/app/[locale]/og.jpg/token-approval-checker/[slug]/route.tsx b/app/[locale]/og.jpg/token-approval-checker/[slug]/route.tsx index 5faa02bb5..f8ca07157 100644 --- a/app/[locale]/og.jpg/token-approval-checker/[slug]/route.tsx +++ b/app/[locale]/og.jpg/token-approval-checker/[slug]/route.tsx @@ -25,8 +25,8 @@ export async function GET(req: Request, { params }: Props) { const t = await getTranslations({ locale: params.locale }); const chainName = getChainName(getChainIdFromSlug(params.slug)); - const title = t(`token_approval_checker.meta.title`, { chainName }); - const background = loadDataUrl(`public/assets/images/token-approval-checker/cover.jpg`, 'image/jpeg'); + const title = t('token_approval_checker.meta.title', { chainName }); + const background = loadDataUrl('public/assets/images/token-approval-checker/cover.jpg', 'image/jpeg'); return generateOgImage({ title, background }); } diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index ad1eda04d..077d4a8c7 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -42,6 +42,7 @@ const LandingPage: NextPage = ({ params }) => {
+ {/* biome-ignore lint/security/noDangerouslySetInnerHtml: JSON-LD needs to be injected using dangerouslySetInnerHTML */}