-
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.
feat: create footer.
- Loading branch information
albertocruzluis
committed
Mar 1, 2022
1 parent
def22fe
commit 781104e
Showing
15 changed files
with
662 additions
and
46 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,17 @@ | ||
import CustomLink from 'components/CustomLink'; | ||
import { BsTwitter } from 'react-icons/bs' | ||
|
||
export const Footer = () => { | ||
const currentYear = new Date().getFullYear(); | ||
|
||
return ( | ||
<div className="flex flex-col gap-2"> | ||
<div className='flex justify-center'> | ||
<CustomLink href="https://twitter.com/intent/user?screen_name=albertocruzdev"> | ||
<BsTwitter color='white' /> | ||
</CustomLink> | ||
</div> | ||
<span className="text-white">©{currentYear} Alberto Cruz Luis | Made with NextJS</span> | ||
</div> | ||
) | ||
} |
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
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,7 @@ | ||
import create from 'zustand' | ||
import { devtools } from 'zustand/middleware' | ||
|
||
export const useGlobalStore = create(devtools(set => ({ | ||
hasClaimedNFT: false, | ||
setHasClaimedNFT: (value) => set(_ => ({ hasClaimedNFT: value})) | ||
}))) |
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,31 @@ | ||
import { useWeb3 } from "@3rdweb/hooks" | ||
import { useRouter } from "next/router" | ||
import { useEffect } from "react" | ||
import toast from "react-hot-toast" | ||
import { useClaimNFT } from "./useClaimNFT" | ||
|
||
export const useAuth = (privateRoutes) => { | ||
const { address } = useWeb3() | ||
const { hasClaimedNFT } = useClaimNFT() | ||
const router = useRouter() | ||
|
||
const isPrivateRoute = () => { | ||
const currentRoute = router.asPath | ||
return privateRoutes[currentRoute] | ||
} | ||
|
||
const isLandingPage = () => { | ||
const currentRoute = router.asPath | ||
return (currentRoute === '/') | ||
} | ||
|
||
useEffect(() => { | ||
if (!hasClaimedNFT && isPrivateRoute() && !isLandingPage()) { | ||
router.push('/') | ||
toast('This route only can be access who have the SpanishDAO NFT', { | ||
icon: '🔒' | ||
}) | ||
} | ||
|
||
}, [hasClaimedNFT, router, address]) | ||
} |
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
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
Oops, something went wrong.
781104e
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: