-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #490 from starknet-id/feat/submenu-dropdown
feat: submenu dropdown
- Loading branch information
Showing
5 changed files
with
224 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import React, { FunctionComponent, MouseEvent, useEffect } from "react"; | ||
import styles from "../../styles/components/desktopNav.module.css"; | ||
import Link from "next/link"; | ||
import { FaDiscord, FaGithub, FaTwitter } from "react-icons/fa"; | ||
import theme from "../../styles/theme"; | ||
|
||
type DesktopNavProps = { | ||
close: () => void; | ||
}; | ||
|
||
const DesktopNav: FunctionComponent<DesktopNavProps> = ({ close }) => { | ||
const handleClick = (e: MouseEvent) => { | ||
e.stopPropagation(); | ||
}; | ||
|
||
// Close when clicking outside the nav | ||
useEffect(() => { | ||
const handleClickOutside: EventListener = (e) => { | ||
const burger = document.getElementById("burger"); | ||
if (burger && !burger.contains(e.target as Node)) { | ||
close(); | ||
} | ||
}; | ||
// Bind the event listener | ||
document.addEventListener("mousedown", handleClickOutside); | ||
return () => { | ||
// Unbind the event listener on clean up | ||
document.removeEventListener("mousedown", handleClickOutside); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<nav onClick={handleClick} className={styles.navContainer}> | ||
<div className={styles.columns}> | ||
<div className={styles.column}> | ||
<Link | ||
href={process.env.NEXT_PUBLIC_STARKNET_ID as string} | ||
target="_blank" | ||
> | ||
<li className={styles.burgerItem}>Website</li> | ||
</Link> | ||
<Link href="https://www.starknet.id/pdfs/Terms.pdf" target="_blank"> | ||
<li className={styles.burgerItem}>Term of use</li> | ||
</Link> | ||
<Link href="https://docs.starknet.id/" target="_blank"> | ||
<li className={styles.burgerItem}>Documentation</li> | ||
</Link> | ||
</div> | ||
<div className={styles.column}> | ||
<Link | ||
href={`${ | ||
process.env.NEXT_PUBLIC_STARKNET_ID as string | ||
}/affiliates/individual-program`} | ||
target="_blank" | ||
> | ||
<li className={styles.burgerItem}>Affiliation</li> | ||
</Link> | ||
<Link | ||
href="https://starknet.id/pdfs/PrivacyPolicy.pdf" | ||
target="_blank" | ||
> | ||
<li className={styles.burgerItem}>Privacy policy</li> | ||
</Link> | ||
</div> | ||
</div> | ||
<hr className={styles.hr} /> | ||
<div className={styles.socials}> | ||
<div className="rounded-full shadow-gray-400 p-3 cursor-pointer hover:scale-105 ease-in duration-300"> | ||
<Link href="https://twitter.com/Starknet_id" target="_blank"> | ||
<FaTwitter size={24} color={theme.palette.secondary.main} /> | ||
</Link> | ||
</div> | ||
<div className="rounded-full shadow-gray-400 p-3 cursor-pointer hover:scale-105 ease-in duration-300"> | ||
<Link href="https://discord.com/invite/8uS2Mgcsza" target="_blank"> | ||
<FaDiscord size={24} color={theme.palette.secondary.main} /> | ||
</Link> | ||
</div> | ||
<div className="rounded-full shadow-gray-400 p-3 cursor-pointer hover:scale-105 ease-in duration-300"> | ||
<Link href="https://github.com/starknet-id" target="_blank"> | ||
<FaGithub size={24} color={theme.palette.secondary.main} /> | ||
</Link> | ||
</div> | ||
</div> | ||
</nav> | ||
); | ||
}; | ||
|
||
export default DesktopNav; |
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,58 @@ | ||
.navContainer { | ||
position: absolute; | ||
justify-content: space-between; | ||
background-color: #fff; | ||
right: 0; | ||
top: 38px; | ||
border-radius: 8px; | ||
border: 1px solid var(--light-tertiary-300, #f5f0eb); | ||
background: var(--background-light, #fffcf8); | ||
/* Small Shadow */ | ||
box-shadow: 0px 2px 30px 0px rgba(0, 0, 0, 0.06); | ||
display: inline-flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
width: 312px; | ||
cursor: default; | ||
} | ||
|
||
.columns { | ||
display: flex; | ||
width: 100%; | ||
} | ||
|
||
.column { | ||
width: 50%; | ||
} | ||
|
||
.burgerItem { | ||
text-transform: none; | ||
color: var(--dark-content, #454545); | ||
/* Body/default/medium */ | ||
font-family: Poppins-Regular; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 500; | ||
line-height: 20px; /* 125% */ | ||
display: flex; | ||
padding: 16px; | ||
gap: 10px; | ||
} | ||
|
||
.burgerItem:hover { | ||
background-color: var(--light-tertiary); | ||
} | ||
|
||
.hr { | ||
width: 100%; | ||
height: 1px; | ||
background-color: var(--light-tertiary); | ||
} | ||
|
||
.socials { | ||
display: flex; | ||
gap: 1rem; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
} |
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
22119ff
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:
goerli-app-starknet-id – ./
goerli-app-starknet-id-git-testnet-starknetid.vercel.app
goerli.app.starknet.id
app-starknet-id.vercel.app
goerli-app-starknet-id-starknetid.vercel.app
goerli.indexer.starknet.id