diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index a2a1384..e0222d2 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,10 @@
-
+
-
+
+
@@ -117,11 +118,11 @@
+
-
@@ -259,31 +260,9 @@
-
-
-
-
- 1719516424652
-
-
-
- 1719516424652
-
-
-
- 1719519913328
-
-
-
- 1719519913328
-
-
-
- 1719586077004
-
-
-
- 1719586077005
+
+
+
@@ -653,7 +632,31 @@
1740504100676
-
+
+
+ 1740505390205
+
+
+
+ 1740505390205
+
+
+
+ 1740614012237
+
+
+
+ 1740614012237
+
+
+
+ 1740614185980
+
+
+
+ 1740614185980
+
+
@@ -685,7 +688,6 @@
-
@@ -710,7 +712,8 @@
-
+
+
diff --git a/README.md b/README.md
index 856a9c2..584b09d 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@
Welcome to OmniTools, a self-hosted web app offering a variety of online tools to simplify everyday tasks.
-Whether you are coding, manipulating images, crunching numbers, or OmniTools has you covered. Please don't forget to
+Whether you are coding, manipulating images or crunching numbers, OmniTools has you covered. Please don't forget to
star the repo to support us.
Here is the [demo](https://omnitools.netlify.app/) website.
diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx
index 3074f45..b5b0192 100644
--- a/src/components/Hero.tsx
+++ b/src/components/Hero.tsx
@@ -2,7 +2,7 @@ import { Autocomplete, Box, Stack, TextField } from '@mui/material';
import Typography from '@mui/material/Typography';
import SearchIcon from '@mui/icons-material/Search';
import Grid from '@mui/material/Grid';
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import { DefinedTool } from '@tools/defineTool';
import { filterTools, tools } from '@tools/index';
import { useNavigate } from 'react-router-dom';
@@ -27,6 +27,7 @@ export default function Hero() {
const [filteredTools, setFilteredTools] = useState(
_.shuffle(tools)
);
+ const [pendingNavigation, setPendingNavigation] = useState(false);
const navigate = useNavigate();
const handleInputChange = (
event: React.ChangeEvent<{}>,
@@ -35,6 +36,14 @@ export default function Hero() {
setInputValue(newInputValue);
setFilteredTools(_.shuffle(filterTools(tools, newInputValue)));
};
+
+ useEffect(() => {
+ if (pendingNavigation && filteredTools.length > 0) {
+ navigate('/' + filteredTools[0].path);
+ setPendingNavigation(false);
+ }
+ }, [pendingNavigation, filteredTools, navigate]);
+
return (
@@ -94,6 +103,11 @@ export default function Hero() {
)}
+ onKeyDown={(event) => {
+ if (event.key === 'Enter') {
+ setPendingNavigation(true);
+ }
+ }}
/>
{exampleTools.map((tool) => (