diff --git a/src/App.tsx b/src/App.tsx index 69002fa..5a59f53 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,7 +10,9 @@ import React from "react"; * @return {JSX.Element} */ function App() { - return
Hello world!
; + return +

Hello world!

+
; } export default App; diff --git a/src/assets/svg/background.svg b/src/assets/svg/background.svg new file mode 100644 index 0000000..e15137a --- /dev/null +++ b/src/assets/svg/background.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/svg/selectIcon.svg b/src/assets/svg/selectIcon.svg new file mode 100644 index 0000000..67a561d --- /dev/null +++ b/src/assets/svg/selectIcon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/MainSection.tsx b/src/components/MainSection.tsx new file mode 100644 index 0000000..11e75f0 --- /dev/null +++ b/src/components/MainSection.tsx @@ -0,0 +1,111 @@ +import classNames from "classnames"; +import React from "react"; +import Inputgroup from "./Inputgroup"; +import Select from "./Select"; +import { useState } from "react"; +import { Button } from "./Button/Button"; +import { SVGSearch } from "../components/icons"; +import TextInputBox from "components/TextInputBox"; + +type Props = { + className?: string; +}; + +const options = [ + { name: "All" }, + { name: "Wade Cooper" }, + { name: "Arlene Mccoy" }, + { name: "Devon Webb" }, + { name: "Tom Cook" }, + { name: "Tanya Fox" }, + { name: "Hellen Schmidt" }, +]; +const Items = [ + { name: "test" }, + { name: "Wade Cooper" }, + { name: "Arlene Mccoy" }, + { name: "Devon Webb" }, + { name: "Tom Cook" }, + { name: "Tanya Fox" }, + { name: "Hellen Schmidt" }, +]; +export default function MainSection({ + className, + ...props +}: Props): JSX.Element { + const [value, setValue] = useState(options[0]); + const [selectedPerson, setSelectedPerson] = useState(Items); + const [query, setQuery] = useState(""); + + let filteredItems = + query === "" + ? Items + : Items.filter((item) => + item.name + .toLowerCase() + .replace(/\s+/g, "") + .includes(query.toLowerCase().replace(/\s+/g, "")) + ); + + const removeOption = (e: React.SyntheticEvent) => { + const newSelect = filteredItems.filter( + (element: any) => element.name !== e + ); + setSelectedPerson(newSelect); + }; + return ( +
+
+ Scientific Library with Free Access +
+
+
Search
+
320 455
+
Items
+
+
+ +
+
+