-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added to-do comment * Dropdown created with placeholder profile icon * Default profile icon added * removed comments and renamed redirect Modal var Co-authored-by: Akshara Sundararajan <[email protected]>
- Loading branch information
1 parent
47bdb03
commit 4016bb7
Showing
2 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import * as React from "react"; | ||
import { Menu, Transition } from "@headlessui/react"; | ||
import { personCircleSharp } from "ionicons/icons"; | ||
import { IonIcon } from "@ionic/react"; | ||
import Button from "./Button"; | ||
|
||
export default function Dropdown({ onClick = () => {} }) { | ||
return ( | ||
<div className="flex items-center justify-center"> | ||
<div className="relative inline-block text-left"> | ||
<Menu> | ||
{({ open }) => ( | ||
<> | ||
<span className="rounded-md shadow-sm"> | ||
<Menu.Button className="inline-flex justify-center w-full text-sm font-medium leading-5 rounded-md"> | ||
<Button onClick={onClick}> | ||
<IonIcon icon={personCircleSharp} size="small"></IonIcon> | ||
</Button> | ||
</Menu.Button> | ||
</span> | ||
|
||
<Transition | ||
show={open} | ||
enter="transition ease-out duration-100" | ||
enterFrom="transform opacity-0 scale-95" | ||
enterTo="transform opacity-100 scale-100" | ||
leave="transition ease-in duration-75" | ||
leaveFrom="transform opacity-100 scale-100" | ||
leaveTo="transform opacity-0 scale-95" | ||
> | ||
<Menu.Items | ||
static | ||
className="absolute right-0 w-56 mt-2 origin-top-right bg-secondary text-primary divide-y divide-gray-100 border shadow-lg outline-none" | ||
> | ||
<div> | ||
<Menu.Item> | ||
<a className="flex cursor-pointer justify-between w-full px-4 py-2 text-sm font-bold leading-5 text-left"> | ||
Logged in as ___. | ||
</a> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<a className="flex cursor-pointer justify-between w-full px-4 py-2 text-sm leading-5 text-left"> | ||
My Profile | ||
</a> | ||
</Menu.Item> | ||
<Menu.Item className="flex cursor-pointer justify-start w-full px-4 py-2 text-sm leading-5 text-left"> | ||
<span>Settings</span> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<a className="flex cursor-pointer justify-between w-full px-4 py-2 text-sm leading-5 text-left"> | ||
Log Out | ||
</a> | ||
</Menu.Item> | ||
</div> | ||
</Menu.Items> | ||
</Transition> | ||
</> | ||
)} | ||
</Menu> | ||
</div> | ||
</div> | ||
); | ||
} |
4016bb7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: