done dropdown sheesh

This commit is contained in:
2026-02-24 16:28:19 +08:00
parent e9c266fe8f
commit 63375ee272
2 changed files with 279 additions and 6 deletions

View File

@@ -5,7 +5,19 @@ import styles from "./styles.module.css";
import { useState } from "react";
const Header = () => {
const orgList = [
{ name: "Project Moonshot Inc." },
{ name: "Organization X" },
{ name: "Organization Y" },
{ name: "Organization Z" },
];
const [open, setOpen] = useState(false);
const [orgId, setorgId] = useState(null);
const activeHandler = (index) => {
setorgId(index);
};
return (
// Main Container
<div className={styles.mainContainer}>
@@ -16,18 +28,139 @@ const Header = () => {
<div className={styles.logo}></div>
<div className={styles.orgName}>
<p>Organization</p>
<div
className={styles.dropdownContainer}
onClick={() => setOpen(!open)}
>
<div className={styles.dropdownContainer}>
{/* Dropdown */}
{open && (
<div className={styles.dropdown}>
<div>ahdas</div>
{/* Organization Header and Search */}
<div className={styles.ohsContainer}>
{/* Header */}
<div className={styles.createBtnContainer}>
<p>Organization</p>
<div className={styles.createBtn}>
<p>Create</p>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
>
<g clipPath="url(#clip0_548_2226)">
<path
d="M8.00034 14.8718C11.7954 14.8718 14.8718 11.7954 14.8718 8.00034C14.8718 4.20535 11.7954 1.12891 8.00034 1.12891C4.20535 1.12891 1.12891 4.20535 1.12891 8.00034C1.12891 11.7954 4.20535 14.8718 8.00034 14.8718Z"
stroke="#8287FF"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 4.8291V11.172"
stroke="#8287FF"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M4.82812 8H11.171"
stroke="#8287FF"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_548_2226">
<rect width="16" height="16" fill="white" />
</clipPath>
</defs>
</svg>
</div>
</div>
{/* Search */}
<div className={styles.searchBtnContainer}>
<div className={styles.searchInputGroup}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
>
<g clipPath="url(#clip0_23_1333)">
<path
d="M7.79548 14.424C11.4568 14.424 14.4249 11.4559 14.4249 7.7945C14.4249 4.13315 11.4568 1.16504 7.79548 1.16504C4.13412 1.16504 1.16602 4.13315 1.16602 7.7945C1.16602 11.4559 4.13412 14.424 7.79548 14.424Z"
stroke="#858699"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M16.8359 16.835L12.6172 12.6162"
stroke="#858699"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_23_1333">
<rect width="18" height="18" fill="white" />
</clipPath>
</defs>
</svg>
<input
className={styles.placeholderTxt}
type="text"
name="search"
id=""
placeholder="Search"
/>
</div>
</div>
</div>
{/* Select Options */}
<div className={styles.optionsContainer}>
{orgList.map((org, index) => {
return (
<div
className={styles.orgList}
key={index}
onClick={() => activeHandler(index)}
>
<div
className={`${styles.iconTxt} ${index === orgId ? styles.active : ""}`}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 20 20"
fill="none"
>
<path
d="M7.87565 14.8747L3.20898 10.208L4.10482 9.31217L7.87565 13.083L15.8757 5.08301L16.7715 5.97884L7.87565 14.8747Z"
fill="#8287FF"
style={{
fill: "#8287FF",
fillOpacity: 1,
}}
/>
</svg>
<p>{org.name}</p>
</div>
</div>
);
})}
</div>
</div>
)}
{/* Button */}
<div className={styles.dropdownBtn}>
<div
className={styles.dropdownBtn}
onClick={() => setOpen(!open)}
>
<p>Project Moonshot Inc.</p>
<div>
<svg