From c1600045a243e3547fe589bfc7e474d2decaea4c Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Mon, 13 Sep 2021 17:26:09 +0530 Subject: moved interfaces to new folder --- src/components/Util/SearchBar.scss | 28 --------------------- src/components/Util/SearchBar.tsx | 50 -------------------------------------- 2 files changed, 78 deletions(-) delete mode 100644 src/components/Util/SearchBar.scss delete mode 100644 src/components/Util/SearchBar.tsx (limited to 'src/components/Util') diff --git a/src/components/Util/SearchBar.scss b/src/components/Util/SearchBar.scss deleted file mode 100644 index d08f1ac..0000000 --- a/src/components/Util/SearchBar.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import "../../styles/theme"; - -.searchBar input { - width: 12rem; -} - -.searchResults { - margin-top: $fontSize1; - width: 12rem; - height: 10rem; - background-color: $background3; - overflow-x: hidden; - overflow-y: auto; - border: 1px solid $border2; -} - -.searchResult { - color: $defFG; -} - -.searchResults .dataItem { - width: 100%; - height: 50px; - display: flex; - align-items: center; - color: black; -} - diff --git a/src/components/Util/SearchBar.tsx b/src/components/Util/SearchBar.tsx deleted file mode 100644 index d26415b..0000000 --- a/src/components/Util/SearchBar.tsx +++ /dev/null @@ -1,50 +0,0 @@ -/* - * OpenBills - Self hosted browser app to generate and keep track of simple invoices - * Version - 0 - * Licensed under the MIT license - https://opensource.org/licenses/MIT - * - * Copyright (c) 2021 Vidhu Kant Sharma -*/ - -import React, { useState } from "react"; -import "./SearchBar.scss"; - -const SearchBar: React.FC = () => { - const sampledata: string[] = ["one", "two", "three", "four", "five", "six"] - - const [searchValue, setSearchValue] = useState(""); - const [searchSelection, setSearchSelection] = useState(""); - - const setSelectionValue = (value: string) => { - setSearchValue(""); - setSearchSelection(value); - console.log(searchSelection); - } - - return ( -
-
- { - setSearchValue(event.target.value); - console.log(searchSelection); - } - } - /> -
- -
- { - searchValue === "" - || sampledata.map((i) => i.toLowerCase().includes(searchValue.toLowerCase()) - && (

setSelectionValue(i)}>{i}

)) - } -
-
- ); -} - -export default SearchBar; -- cgit v1.2.3