Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Added Sidebar. #274

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
responsivness added
ivinayakg committed Oct 19, 2022

Verified

This commit was signed with the committer’s verified signature.
xieyuschen Griffin
commit 944e08f07e73f7664074e258769e33af6ffddb4f
13 changes: 13 additions & 0 deletions components/Sidebar/index.jsx
Original file line number Diff line number Diff line change
@@ -2,8 +2,10 @@ import styles from './sidebar.module.css';
import { useRouter } from 'next/router';
import Image from 'next/image';
import sidebarMenuOptions from 'constants/sidebarMenuOptions';
import { useState } from 'react';

const Sidebar = () => {
const [mobileToggle, setMobileToggle] = useState(false);
const router = useRouter();
const navigateTo = (url) => router.push(url);

@@ -17,6 +19,17 @@ const Sidebar = () => {

return (
<div className={styles.wrapper} data-testid="sidebar-notification">
<div
className={
styles.mobileToggle +
` ${mobileToggle ? styles['mobileToggle--active'] : ''}`
}
onClick={() => setMobileToggle((prev) => !prev)}
>
<h3>Menu</h3>
<Image src="/assets/MenuArrow.svg" width={25} height={25} />
</div>

<aside className={styles.sidebar}>
<span className={styles.heading}>
<Image src={'/assets/Real-Dev-Squad1x.png'} width={50} height={50} />
61 changes: 61 additions & 0 deletions components/Sidebar/sidebar.module.css
Original file line number Diff line number Diff line change
@@ -35,6 +35,12 @@
gap: 10px;
}

.options{
gap: 1rem;
display: flex;
flex-direction: column;
}

.option {
position: relative;
display: flex;
@@ -92,3 +98,58 @@
font: 500 16px 'DM Sans', sans-serif;
margin-top: 1rem;
}

.mobileToggle{
display: none;
}

/* Responsive CSS */
@media screen and (max-width: 970px) {
.wrapper{
width: 100vw;
}

.mobileToggle{
display: flex;
justify-content: space-between;
padding: 1.6rem;
background-color: #1D1283;
color: white;
}

.mobileToggle img{
transform: rotateZ(180deg);
transition: all 300ms ease-in;
}

.mobileToggle--active img{
transform: rotateZ(0deg);
}

.sidebar{
height: 0px;
transition: all 300ms ease-in;
}

.mobileToggle--active ~ .sidebar{
height: max-content;
margin-top: 0rem;
animation: MobileMenuAnimation 300ms forwards ;
}

.buttonWrapper{
margin-top: 1rem;
}
}



/* custom animations */
@keyframes MobileMenuAnimation{
0%{
margin-top: -5rem;
}
100%{
margin-top: 0rem;
}
}
3 changes: 3 additions & 0 deletions public/assets/MenuArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
@@ -75,6 +75,12 @@ footer a {
display: none !important;
}
.main_app {
width: 100vw;
display: flex;
}

/* Responsive CSS */
@media screen and (max-width: 970px) {
.main_app{
flex-direction: column;
}
}