Skip to content

Commit

Permalink
feat: make login button public
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM committed Nov 7, 2023
1 parent 89337b5 commit d47f5f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
20 changes: 3 additions & 17 deletions app/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
"use client";
import React, { useEffect, useState } from "react";
import React from "react";
import Link from "next/link";
import { loginVisibilityState } from "@/jotai/loginVisibility";
import { useSetAtom } from "jotai";

const Footer = () => {
const [clicksCounter, setClicksCounter] = useState(0);
const setLoginVisibility = useSetAtom(loginVisibilityState);

useEffect(() => {
if (clicksCounter === 5) {
setLoginVisibility(true);
}
}, [clicksCounter, setLoginVisibility]);

return (
<div className="flex bg-bondscape-background-primary px-xMobile md:px-xMd lg:px-xLg xl:px-xXl py-yMobile lg:py-[30px]">
<div className="flex flex-1 flex-col lg:flex-row lg:items-center">
<button
onClick={() => setClicksCounter((prev) => prev + 1)}
className="text-[#8F8F8F] text-[14px] font-light leading-none pb-2 lg:pb-0 lg:pr-[40px]"
>
<div className="text-[#8F8F8F] text-[14px] font-light leading-none pb-2 lg:pb-0 lg:pr-[40px]">
Copyright © Desmos Labs {new Date().getFullYear()}
</button>
</div>
<div className="flex flex-row lg:flex-1 justify-between items-center">
<div className="flex flex-row text-[14px] font-light">
<Link
Expand Down
13 changes: 3 additions & 10 deletions app/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import EventsHeader from "@/components/EventsHeader";
import Tabs from "@/components/Tabs";
import { useActiveTab, useSetActiveTab } from "@/jotai/activeTab";
import CreateEventHeader from "@/components/CreateEventHeader";
import { useAtomValue } from "jotai";
import { loginVisibilityState } from "@/jotai/loginVisibility";

interface Props {
readonly disableNavbarBgInDesktop?: boolean;
Expand All @@ -33,10 +31,9 @@ const NavigationBar = ({
}: Props) => {
const activeTab = useActiveTab();
const setActiveTab = useSetActiveTab();
const isLoginButtonVisible = useAtomValue(loginVisibilityState);
const [navbarBgVisible, setNavbarBgVisible] = useState(false);
// Hooks
const [isMobile, isMd, isLg, isXl, isDesktop, isBreakpointReady] =
const [isMobile, isMd, isDesktop, isBreakpointReady] =
useBreakpoints();
const pathname = usePathname();
const { user } = useUser();
Expand Down Expand Up @@ -70,11 +67,7 @@ const NavigationBar = ({
) {
return;
}
if (
!user ||
!isDesktop ||
(process.env.NODE_ENV === "production" && !isLoginButtonVisible)
) {
if (!user || !isDesktop) {
return;
}
return user.profile ? (
Expand All @@ -86,7 +79,7 @@ const NavigationBar = ({
</div>
</Link>
);
}, [isDesktop, isLoginButtonVisible, pathname, user]);
}, [isDesktop, pathname, user]);

return (
<nav
Expand Down

0 comments on commit d47f5f9

Please sign in to comment.