-
Notifications
You must be signed in to change notification settings - Fork 6
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
Deep310
wants to merge
19
commits into
env/dev
Choose a base branch
from
nav-side-bar
base: env/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dad66aa
patch save endpoint
Deep310 113e7e6
added a test for save endpoint
Deep310 9aa6155
made edits in save endpoint, working on fixing the test
Deep310 ee5113d
changes on my endpoint
Deep310 e74c105
resolved merge conflict
Deep310 303f312
updates the endpoint and made changes in cubmission schema
Deep310 6c668dc
ran linting and formatting
Deep310 01d499a
completed the patch endpoint :octocat:
Deep310 a933fd1
changes based on Sam's comments
Deep310 977a487
renamed testSubmission2.json
Deep310 065edb4
Merge branch 'env/dev' into deep-branch
Deep310 a194a03
package lock updated
Deep310 cd0dac5
reverted package lock update
Deep310 035425b
Merge branch 'env/dev' into deep-branch
Deep310 762311c
made a basic past submissions table component
Deep310 cfd6c24
more in basic past submissions table component
Deep310 59ff786
Merge branch 'env/dev' of https://github.com/HackRU/sledge into env/dev
Deep310 ed980b8
Merge branch 'env/dev' into deep-branch
Deep310 95c2a61
made app and sidebar
Deep310 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,66 @@ | ||
/* eslint-disable */ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import AppBar from '@material-ui/core/AppBar'; | ||
import Toolbar from '@material-ui/core/Toolbar'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import MenuIcon from '@material-ui/icons/Menu'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import styles from './AppSideBar.module.scss'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
flexGrow: 1, | ||
}, | ||
menuButton: { | ||
marginRight: theme.spacing(2), | ||
}, | ||
title: { | ||
flexGrow: 1, | ||
}, | ||
})); | ||
|
||
export default function ButtonAppBar() { | ||
const classes = useStyles(); | ||
|
||
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()} | ||
> | ||
× | ||
</a> | ||
<a href="#">New Submission</a> | ||
<a href="#">HackRU</a> | ||
<a href="#">Logout</a> | ||
</div> | ||
<AppBar position="static"> | ||
<Toolbar> | ||
<IconButton | ||
edge="start" | ||
className={classes.menuButton} | ||
color="inherit" | ||
aria-label="menu" | ||
onClick={() => openNav()} | ||
> | ||
<MenuIcon /> | ||
</IconButton> | ||
<Typography variant="h6" className={classes.title}> | ||
Sledge | ||
</Typography> | ||
</Toolbar> | ||
</AppBar> | ||
</div> | ||
); | ||
} |
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,27 @@ | ||
.sideNav { | ||
height: 100%; | ||
width: 0; | ||
position: fixed; | ||
z-index: 1; | ||
top: 0; | ||
left: 0; | ||
background-color: rgb(0, 0, 0); | ||
overflow-x: hidden; | ||
transition: 0.5s; | ||
padding-top: 60px; | ||
} | ||
|
||
.sideNav a { | ||
padding: 8px 8px 8px 32px; | ||
text-decoration: none; | ||
font-size: 25px; | ||
color: #fff; | ||
display: block; | ||
transition: 0.3s; | ||
} | ||
|
||
.closeBtn { | ||
position: absolute; | ||
top: 0; | ||
right: 25px; | ||
} |
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,51 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Table from '@material-ui/core/Table'; | ||
import TableBody from '@material-ui/core/TableBody'; | ||
import TableCell from '@material-ui/core/TableCell'; | ||
import TableContainer from '@material-ui/core/TableContainer'; | ||
import TableHead from '@material-ui/core/TableHead'; | ||
import TableRow from '@material-ui/core/TableRow'; | ||
import Paper from '@material-ui/core/Paper'; | ||
|
||
const useStyles = makeStyles({ | ||
table: { | ||
minWidth: 650, | ||
}, | ||
}); | ||
|
||
function createData(name, season) { | ||
return { name, season }; | ||
} | ||
|
||
const rows = [ | ||
createData('HealthyDiet', 'Spring 2020'), | ||
createData('RutgersBus', 'Fall 2020'), | ||
]; | ||
|
||
export default function PastSubmissions() { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<TableContainer component={Paper}> | ||
<Table className={classes.table} aria-label="simple table"> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell>Name of the hack</TableCell> | ||
<TableCell align="right">Hackathon season</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{rows.map((row) => ( | ||
<TableRow key={row.name}> | ||
<TableCell component="th" scope="row"> | ||
{row.name} | ||
</TableCell> | ||
<TableCell align="right">{row.season}</TableCell> | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import {Button} from "@material-ui/core" | ||
import { Button } from '@material-ui/core'; | ||
|
||
export default function SampleButton({name, message}) { | ||
export default function SampleButton({ name, message }) { | ||
const showAlert = (amessage) => { | ||
alert(amessage); | ||
}; | ||
|
||
return ( | ||
<Button color="primary" onClick={()=>showAlert(message)}> | ||
{name} says... | ||
<Button color="primary" onClick={() => showAlert(message)}> | ||
{name} says... | ||
</Button> | ||
); | ||
}; | ||
} |
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,14 @@ | ||
import React from 'react'; | ||
import PastSubmissions from '../components/PastSubmissions'; | ||
import styles from './HackerDashboard.module.scss'; | ||
|
||
function HackerDashboard() { | ||
return ( | ||
<div className={styles.hackerDashboardContainer}> | ||
<p>Your past submissions</p> | ||
<PastSubmissions /> | ||
</div> | ||
); | ||
} | ||
|
||
export default HackerDashboard; |
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,3 @@ | ||
.hackerDashboardContainer { | ||
margin: 0 25px; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.