feat: some more localized links

This commit is contained in:
tresabhi committed 2024-12-27 14:01:59 -06:00
1 parent 8203db3dc2
commit e0daf85561
19 files changed
+182 -81

No files matched your search

+14 -8
View File
@@ -20,11 +20,13 @@ import {
import { resolveBranchName } from '../core/blitzkit/branches';
import { homeTool, TOOLS } from '../constants/tools';
import { NavbarAccount } from './NavbarAccount';
import { LinkI18n } from './LinkI18n';
const toolsFiltered = TOOLS.filter((tool) => !('href' in tool));
const tools = [homeTool, ...toolsFiltered];
const branchName = resolveBranchName();
const isBranchNamed = branchName !== undefined;
const { locale } = Astro.params;
---
<style>
@@ -108,7 +110,8 @@ const isBranchNamed = branchName !== undefined;
<Flex className="expander" data-expanded="false" direction="column" gap="2">
<Flex justify="center">
<Flex flexGrow="1" maxWidth="1024px" p="3" align="center">
<Link
<LinkI18n
{locale}
color="gray"
highContrast
href="/"
@@ -125,7 +128,7 @@ const isBranchNamed = branchName !== undefined;
)
}
</Flex>
</Link>
</LinkI18n>
<Box flexGrow="1" />
@@ -145,7 +148,8 @@ const isBranchNamed = branchName !== undefined;
return (
<Fragment key={tool.title}>
{index > 0 && <Separator orientation="vertical" size="1" />}
<Link
<LinkI18n
{locale}
color="gray"
highContrast={selected}
size="2"
@@ -153,7 +157,7 @@ const isBranchNamed = branchName !== undefined;
underline={selected ? 'always' : 'hover'}
>
{tool.title}
</Link>
</LinkI18n>
</Fragment>
);
})
@@ -173,14 +177,15 @@ const isBranchNamed = branchName !== undefined;
<DiscordLogoIcon />
</Link>
<Link
<LinkI18n
{locale}
style={{ display: 'flex', alignContent: 'center' }}
color="gray"
href="/settings"
underline="none"
>
<GearIcon />
</Link>
</LinkI18n>
<NavbarAccount client:idle />
@@ -226,7 +231,8 @@ const isBranchNamed = branchName !== undefined;
aspectRatio: '2 / 1',
}}
>
<Link
<LinkI18n
{locale}
href={tool.id.length === 0 ? '/' : `/tools/${tool.id}`}
style={{
display: 'flex',
@@ -261,7 +267,7 @@ const isBranchNamed = branchName !== undefined;
>
<Text>{tool.title}</Text>
</Flex>
</Link>
</LinkI18n>
</Flex>
);
})