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

Add navbar and sidebar #216

Draft
wants to merge 19 commits into
base: env/dev
Choose a base branch
from
Draft

Add navbar and sidebar #216

wants to merge 19 commits into from

Conversation

Deep310
Copy link
Collaborator

@Deep310 Deep310 commented Jun 23, 2021

No description provided.

@Deep310 Deep310 linked an issue Jun 23, 2021 that may be closed by this pull request
@Deep310 Deep310 requested a review from samuel-ping June 23, 2021 19:03
Comment on lines +26 to +41
const openNav = () => {
document.getElementById('sideNav').style.width = '250px';
};

const closeNav = () => {
document.getElementById('sideNav').style.width = '0';
};

return (
<div className={classes.root}>
<div id="sideNav" className={styles.sideNav}>
<a
href="javascript:void(0)"
className={styles.closeBtn}
onClick={() => closeNav()}
>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One benefit of using React.js over vanilla JavaScript is holding a state inside the component. You can hold a boolean variable that says whether or not the sidebar is open or closed, and then conditionally render the sidebar based on that variable.

@samuel-ping samuel-ping marked this pull request as draft June 27, 2021 05:36
@samuel-ping samuel-ping changed the title Nav side bar Add navbar, sidebar, and hacker dashboard Jun 27, 2021
@samuel-ping samuel-ping changed the title Add navbar, sidebar, and hacker dashboard Add navbar and sidebar Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users can see a navbar and sidebar
2 participants