Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions client/src/features/calendarHeader/CalendarHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,30 @@ function CalendarHeader({ date }) {
const handleLogin = () => {
window.location = "api/auth/discord";
};

return (
<header className="flex items-center max-[440px]:px-2 px-5 py-3 bg-white lg:justify-between w-full justify-center lg:flex-nowrap flex-wrap max-[440px]:gap-x-2 gap-x-6 lg:gap-x-4 overflow-hidden">
<header className="flex items-center max-[440px]:px-2 px-5 py-3 bg-white lg:justify-between w-full justify-center lg:flex-nowrap flex-wrap max-[440px]:gap-x-2 gap-x-6 lg:gap-x-4">
<section className="flex max-[440px]:gap-x-2 gap-x-6 lg:gap-x-4">
<HeaderButton
Icon={BsCalendarPlusFill}
tooltipText="Add Event"
onClick={formModal.handleOpen}
aria-label="Add Event"
title="Add Event"
/>

<HeaderButton
Icon={MdGroupAdd}
tooltipText="Join Team"
onClick={() => linkToUrl(DISCORD_THREAD_URL)}
aria-label="Join Team"
title="Join Team"
/>
<HeaderButton
Icon={FaHome}
tooltipText={"Home"}
onClick={() => navigate("/")}
aria-label="Home"
title="Home"
/>
</section>
<section className="flex items-center w-full order-first lg:w-min lg:space-x-3 lg:order-0 justify-between mb-4 lg:mb-0">
Expand All @@ -61,30 +66,40 @@ function CalendarHeader({ date }) {
text={"Today"}
tooltipText={"Jump to current month"}
onClick={() => date.getCurrentMonth()}
aria-label="Today"
title="Today"
/>
</section>
<section className="flex max-[440px]:gap-x-2 gap-x-6 lg:gap-x-4">
<HeaderButton
Icon={IoChatbubblesOutline}
tooltipText="Feedback"
onClick={() => linkToUrl(GH_ISSUES_URL)}
aria-label="Feedback"
title="Feedback"
/>
<HeaderButton
Icon={FaQuestion}
tooltipText="Help"
onClick={() => linkToUrl(GH_ISSUES_URL)}
aria-label="Help"
title="Help"
/>
{isAuthenticated() ? (
<HeaderButton
Icon={RiArrowLeftCircleFill}
tooltipText="Logout"
onClick={logout}
aria-label="Logout"
title="Logout"
/>
) : (
<HeaderButton
Icon={RiArrowRightCircleFill}
tooltipText="Login"
onClick={handleLogin}
aria-label="Login"
title="Login"
/>
)}
</section>
Expand Down
16 changes: 9 additions & 7 deletions client/src/features/calendarHeader/components/HeaderButton.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
function HeaderButton({ Icon, tooltipText, ...rest }) {
return (
<button
className="p-2 sm:p-3 relative bg-[#F5E7DE] shadow-[0_4px_4px_0_rgba(0,0,0,0.25)] rounded-lg group font-inconsolata font-bold cursor-pointer"
{...rest}
>
<Icon className="max-[380px]:w-4 max-[380px]:h-4 w-6 h-6 sm:w-8 sm:h-8 text-[#C57756]" />
<span className="absolute -bottom-full left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 ease-in bg-[#F5CEB5BF] p-2 border border-black whitespace-nowrap rounded-md pointer-events-none z-10">
<div className="relative inline-block group">
<button
className="p-2 sm:p-3 bg-[#F5E7DE] shadow-[0_4px_4px_0_rgba(0,0,0,0.25)] rounded-lg font-inconsolata font-bold cursor-pointer"
{...rest}
>
<Icon className="max-[380px]:w-4 max-[380px]:h-4 w-6 h-6 sm:w-8 sm:h-8 text-[#C57756]" />
</button>
<span className="absolute -bottom-full left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-200 ease-in bg-[#F5CEB5BF] p-2 border border-black whitespace-nowrap rounded-md pointer-events-none z-10">
{tooltipText}
</span>
</button>
</div>
);
}
export default HeaderButton;
Loading