diff --git a/frontend/src/app/components/searchbar/SearchBar.jsx b/frontend/src/app/components/searchbar/SearchBar.jsx index 40a317a..b465630 100644 --- a/frontend/src/app/components/searchbar/SearchBar.jsx +++ b/frontend/src/app/components/searchbar/SearchBar.jsx @@ -1,9 +1,13 @@ -import React from "react"; +import React, { useState } from "react"; import searchBarStyle from "./styles.module.css"; const SearchBar = () => { + const [open, setOpen] = useState(false); + return ( -
+ { id="" placeholder="Search" /> -
+
setOpen((open) => !open)} + > { > .input { - background-color: red; + +.searchBarContainer:focus-within { + background: #292a36; + background: color(display-p3 0.1608 0.1647 0.2078); +} +/* When the searchbar is opened */ +.open { + width: 260px; + padding: 6px 6px 6px 12px; + justify-content: space-between; + border: 1px solid #31324a; + border: 1px solid color(display-p3 0.1922 0.1961 0.2824); + border-radius: 6px; +} +.input { + background: transparent; outline: none; border: none; width: 100%; - + opacity: 0; /*hide input kung collapse*/ + transition: opacity 0.35s ease; color: #85869b; color: color(display-p3 0.5216 0.5255 0.6); font-family: Inter; @@ -27,6 +42,11 @@ caret-color: #575bc7; } +.open > .input { + opacity: 1; /*show input when open*/ + transition-delay: 0.1s; +} + .input::placeholder { color: #85869b; color: color(display-p3 0.5216 0.5255 0.6); @@ -39,8 +59,13 @@ letter-spacing: -0.09px; } -.icon { +.searchBtn { display: flex; align-items: center; justify-content: center; + cursor: pointer; + color: #858699; +} +.searchBtn:hover { + color: #959aff; } diff --git a/frontend/src/app/components/topHeader/TopHeader.jsx b/frontend/src/app/components/topHeader/TopHeader.jsx index d764201..f6d917c 100644 --- a/frontend/src/app/components/topHeader/TopHeader.jsx +++ b/frontend/src/app/components/topHeader/TopHeader.jsx @@ -20,6 +20,7 @@ import PrimaryButton from "../buttons/primarybutton/PrimaryButton"; import EditIcon from "../icons/edit"; import UpdateIcon from "../icons/update"; import SecondaryButton from "../buttons/secondaryButton/SecondaryButton"; +import SearchBar from "../searchbar/SearchBar"; const TopHeader = (props) => { const [triggerDropDownMenu, setTriggerDropDownMenu] = useState(false); @@ -51,7 +52,7 @@ const TopHeader = (props) => {
{props?.requiredButtons.includes("search") && (
- +
)} {props?.requiredButtons.includes("env") && ( diff --git a/frontend/src/app/components/topHeader/styles.module.css b/frontend/src/app/components/topHeader/styles.module.css index 2ea4c69..616ff87 100644 --- a/frontend/src/app/components/topHeader/styles.module.css +++ b/frontend/src/app/components/topHeader/styles.module.css @@ -6,6 +6,7 @@ align-self: stretch; background: #21232f; transition: all 0.15s; + position: relative; } .title { display: flex;