-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
70 additions
and
10 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
Empty file.
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import React from "react"; | ||
import React, { useState } from "react"; | ||
import { Fragment } from "react"; | ||
import { LogOutUser } from "../api/auth"; | ||
import { Disclosure, Menu, Transition } from "@headlessui/react"; | ||
import { useDispatch } from "react-redux"; | ||
import { Link, useNavigate } from "react-router-dom"; | ||
import { Bars3Icon, BellIcon, XMarkIcon } from "@heroicons/react/24/outline"; | ||
import logo from "../Images/Bill.png"; | ||
import { Modal } from "flowbite-react"; | ||
import { Button } from "semantic-ui-react"; | ||
import EventForm from "./EventForm"; | ||
const user = { | ||
name: "John Doe", | ||
email: "[email protected]", | ||
|
@@ -29,9 +32,11 @@ function classNames(...classes) { | |
export const Navbar = () => { | ||
const dispatch = useDispatch(); | ||
const navigate = useNavigate(); | ||
const [flag, setFlag] = useState(false); | ||
const LogoutHandler = async () => { | ||
await LogOutUser(dispatch, navigate); | ||
}; | ||
const [openForm, setOpenForm] = useState(false); | ||
return ( | ||
<Disclosure as="nav" className="bg-gray-800"> | ||
{({ open }) => ( | ||
|
@@ -102,6 +107,9 @@ export const Navbar = () => { | |
if (item.name === "Sign out") { | ||
LogoutHandler(); | ||
} | ||
if (item.name === "Your Profile") { | ||
setOpenForm(true); | ||
} | ||
}} | ||
className={classNames( | ||
active ? "bg-gray-100" : "", | ||
|
@@ -186,6 +194,9 @@ export const Navbar = () => { | |
if (item.name === "Sign out") { | ||
LogoutHandler(); | ||
} | ||
if (item.name === "Your Profile") { | ||
setOpenForm(true); | ||
} | ||
}} | ||
className="block rounded-md px-3 py-2 text-base font-medium text-gray-400 hover:bg-gray-700 hover:text-white" | ||
> | ||
|
@@ -195,6 +206,27 @@ export const Navbar = () => { | |
</div> | ||
</div> | ||
</Disclosure.Panel> | ||
|
||
<Modal | ||
// closeOnDimmerClick={false} | ||
size={"large"} | ||
// open={openForm} | ||
popup={true} | ||
show={openForm} | ||
size="6xl" | ||
onClose={() => setOpenForm(false)} | ||
> | ||
<Modal.Header>Profile</Modal.Header> | ||
|
||
<Modal.Body> | ||
<EventForm setFlag={setFlag} setOpenForm={setOpenForm} /> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button negative onClick={() => setOpenForm(false)}> | ||
Cancel | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
</> | ||
)} | ||
</Disclosure> | ||
|
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,22 @@ | ||
import React from "react"; | ||
import { Tabs } from "flowbite-react"; | ||
|
||
const ProfileCard = () => { | ||
return ( | ||
<> | ||
<Tabs.Group aria-label="Tabs with icons" style="underline"> | ||
<Tabs.Item title="Profile">Profile content</Tabs.Item> | ||
<Tabs.Item active={true} title="Dashboard"> | ||
Dashboard content | ||
</Tabs.Item> | ||
<Tabs.Item title="Settings">Settings content</Tabs.Item> | ||
<Tabs.Item title="Contacts">Contacts content</Tabs.Item> | ||
<Tabs.Item disabled={true} title="Disabled"> | ||
Disabled content | ||
</Tabs.Item> | ||
</Tabs.Group> | ||
</> | ||
); | ||
}; | ||
|
||
export default ProfileCard; |
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 @@ | ||
# Backend of the application |