Add skeleton for dropdown component
This commit is contained in:
parent
4ad42312b1
commit
73c49252f6
2 changed files with 25 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import Button from "@/components/ui/Button";
|
import Button from "@/components/ui/Button";
|
||||||
|
import Dropdown from "@/components/ui/Dropdown";
|
||||||
import Form from "@/components/ui/Form";
|
import Form from "@/components/ui/Form";
|
||||||
import NavLink from "@/components/ui/NavLink";
|
import NavLink from "@/components/ui/NavLink";
|
||||||
import RoundedContainer from "@/components/ui/RoundedContainer";
|
import RoundedContainer from "@/components/ui/RoundedContainer";
|
||||||
|
|
@ -48,6 +49,11 @@ export default function Components() {
|
||||||
<p>More Contents</p>
|
<p>More Contents</p>
|
||||||
</div>
|
</div>
|
||||||
</RoundedContainer>
|
</RoundedContainer>
|
||||||
|
|
||||||
|
<h1>Dropdown</h1>
|
||||||
|
<Dropdown>
|
||||||
|
<p>Hello!</p>
|
||||||
|
</Dropdown>
|
||||||
</div>
|
</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