WIP: Major Update 0.2 #3
2 changed files with 25 additions and 0 deletions
Add skeleton for dropdown component
commit
73c49252f6
|
|
@ -1,6 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import Button from "@/components/ui/Button";
|
||||
import Dropdown from "@/components/ui/Dropdown";
|
||||
import Form from "@/components/ui/Form";
|
||||
import NavLink from "@/components/ui/NavLink";
|
||||
import RoundedContainer from "@/components/ui/RoundedContainer";
|
||||
|
|
@ -48,6 +49,11 @@ export default function Components() {
|
|||
<p>More Contents</p>
|
||||
</div>
|
||||
</RoundedContainer>
|
||||
|
||||
<h1>Dropdown</h1>
|
||||
<Dropdown>
|
||||
<p>Hello!</p>
|
||||
</Dropdown>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
19
components/ui/Dropdown.tsx
Normal file
19
components/ui/Dropdown.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { useState } from "react";
|
||||
import Button from "./Button";
|
||||
|
||||
export default function Dropdown({ children }: { children: React.ReactNode }) {
|
||||
const [dropped, setDropped] = useState<boolean>(false);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Button
|
||||
title="Drop down"
|
||||
mode="DARK"
|
||||
onClick={() => {
|
||||
setDropped(!dropped);
|
||||
}}
|
||||
></Button>
|
||||
{dropped && <div>{children}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue