From 78698436fe39670e17732530a2ac9d3c094481a7 Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Wed, 27 Apr 2022 14:14:10 +0200 Subject: [PATCH] Add search bar initial form --- components/SearchBar/SearchBar.tsx | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 components/SearchBar/SearchBar.tsx diff --git a/components/SearchBar/SearchBar.tsx b/components/SearchBar/SearchBar.tsx new file mode 100644 index 000000000..aa852b8b6 --- /dev/null +++ b/components/SearchBar/SearchBar.tsx @@ -0,0 +1,41 @@ +import { Input, TextInput, Text, ActionIcon, useMantineTheme } from '@mantine/core'; +import { showNotification } from '@mantine/notifications'; +import { useState, useEffect } from 'react'; +import { Search, ArrowRight, ArrowLeft } from 'tabler-icons-react'; +import { Config, loadConfig } from '../../tools/config'; + +export default function SearchBar(props: any) { + const theme = useMantineTheme(); + const [config, setConfig] = useState({ + searchBar: true, + }); + + useEffect(() => { + const config = loadConfig('settings'); + if (config) { + showNotification({ + autoClose: 1000, + title: Config loaded, + message: undefined, + }); + setConfig(config); + } + }, []); + return ( + } + radius="xl" + size="md" + placeholder="Search the web" + onChange={(e) => { + showNotification({ + autoClose: 1000, + title: Searching for {e.target.value}, + message: undefined, + }); + }} + rightSectionWidth={42} + {...props} + /> + ); +}