Skip to content

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

3 participants