@@ -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] ;
2525export 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