Skip to content

Commit 6d19b4f

Browse files
committed
fix: broken links
1 parent 8f6e023 commit 6d19b4f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/Hero.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ const exampleTools: { label: string; url: string }[] = [
1515
},
1616
{ label: 'Convert text to morse code', url: '/string/to-morse' },
1717
{ label: 'Change GIF speed', url: '/gif/change-speed' },
18-
{ label: 'Sort a list', url: 'list/sort' },
19-
{ label: 'Compress PNG', url: 'png/compress-png' },
18+
{ label: 'Sort a list', url: '/list/sort' },
19+
{ label: 'Compress PNG', url: '/png/compress-png' },
2020
{ label: 'Split a text', url: '/string/split' },
2121
{ label: 'Calculate number sum', url: '/number/sum' },
22-
{ label: 'Shuffle a list', url: 'list/shuffle' },
23-
{ label: 'Change colors in image', url: 'png/change-colors-in-png' }
22+
{ label: 'Shuffle a list', url: '/list/shuffle' },
23+
{ label: 'Change colors in image', url: '/png/change-colors-in-png' }
2424
];
2525
export default function Hero() {
2626
const [inputValue, setInputValue] = useState<string>('');
@@ -98,7 +98,9 @@ export default function Hero() {
9898
<Grid container spacing={2} mt={2}>
9999
{exampleTools.map((tool) => (
100100
<Grid
101-
onClick={() => navigate(tool.url)}
101+
onClick={() =>
102+
navigate(tool.url.startsWith('/') ? tool.url : `/${tool.url}`)
103+
}
102104
item
103105
xs={12}
104106
md={6}

0 commit comments

Comments
 (0)