generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 64
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
11 changed files
with
195 additions
and
1 deletion.
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,59 @@ | ||
import styles from './sidebar.module.css'; | ||
import { useRouter } from 'next/router'; | ||
import Image from 'next/image'; | ||
import sidebarMenuOptions from 'constants/sidebarMenuOptions'; | ||
|
||
const Sidebar = () => { | ||
const router = useRouter(); | ||
const navigateTo = (url) => router.push(url); | ||
|
||
return ( | ||
<div className={styles.wrapper}> | ||
<aside className={styles.sidebar}> | ||
<span className={styles.heading}> | ||
<Image src={'/assets/Real-Dev-Squad1x.png'} width={50} height={50} /> | ||
<h3>RealDevSquad</h3> | ||
</span> | ||
<div className={styles.options}> | ||
{sidebarMenuOptions.map((option, index) => { | ||
return ( | ||
<span | ||
key={index} | ||
// this code below insure even if we are in nested path like currency-exchange/**/ | ||
//even then the link is active | ||
className={ | ||
styles.option + | ||
(router.pathname.split('/')[1] === option.urlPath || | ||
(router.pathname === '/' && '/' === option.urlPath) | ||
? ' ' + styles.option_active | ||
: '') | ||
} | ||
onClick={() => navigateTo(option.urlPath)} | ||
> | ||
<Image | ||
src={option.iconPath} | ||
className={styles.option_image} | ||
width={25} | ||
height={25} | ||
/> | ||
<p>{option.name}</p> | ||
<span className={styles.option_bar}></span> | ||
</span> | ||
); | ||
})} | ||
</div> | ||
|
||
<div className={styles.buttonWrapper}> | ||
<button className={styles.button}> | ||
<Image src="/assets/InfoSquare.svg" width={25} height={25} /> | ||
Guide | ||
</button> | ||
</div> | ||
</aside> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Sidebar; | ||
|
||
//pure TDD |
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,93 @@ | ||
.wrapper { | ||
font: 700 16px 'DM Sans', sans-serif; | ||
margin-bottom: 25px; | ||
width: 20vw; | ||
height: max-content; | ||
margin-right: auto; | ||
} | ||
|
||
.sidebar { | ||
height: calc(100vh - 78px); | ||
overflow-y: scroll; | ||
background-color: #f8f7ff; | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
flex-direction: column; | ||
} | ||
|
||
.sidebar::-webkit-scrollbar { | ||
width: 0.5px; | ||
} | ||
.sidebar::-webkit-scrollbar-thumb { | ||
visibility: hidden; | ||
} | ||
|
||
.sidebar > * { | ||
padding: 1.6rem; | ||
width: 100%; | ||
} | ||
|
||
.heading { | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
gap: 10px; | ||
} | ||
|
||
.option { | ||
position: relative; | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
padding: 6px 9px; | ||
gap: 10px; | ||
color: #a5a2b8; | ||
cursor: pointer; | ||
} | ||
|
||
.option:hover { | ||
color: #352e5bd0; | ||
} | ||
|
||
.option_image { | ||
position: static; | ||
color: #352e5b; | ||
} | ||
|
||
.option_active { | ||
color: #352e5b; | ||
} | ||
|
||
.option_bar { | ||
width: 3px; | ||
aspect-ratio: 1/6; | ||
background-color: #9381ff; | ||
border-radius: 1px 0px 0px 1px; | ||
right: -1.2rem; | ||
position: absolute; | ||
display: none; | ||
} | ||
|
||
.option_active .option_bar { | ||
display: block; | ||
} | ||
|
||
.buttonWrapper { | ||
width: 100%; | ||
margin-top: auto; | ||
} | ||
|
||
.button { | ||
width: 100%; | ||
background-color: #041187; | ||
height: 4rem; | ||
border-radius: 8px; | ||
border: none; | ||
color: white; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
font: 500 16px 'DM Sans', sans-serif; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -70,3 +70,7 @@ footer a { | |
.d-none { | ||
display: none !important; | ||
} | ||
.main_app { | ||
width: 100vw; | ||
display: flex; | ||
} |