-
Notifications
You must be signed in to change notification settings - Fork 3
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
Desktop Header Component #9
Merged
+259
−71
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b994530
Desktop Header
d5820fa
New line
e8c104f
PR comments; Footer touch up
savannahostrowski cc81f7c
Box shadow
savannahostrowski 178bbbe
Formatting
savannahostrowski 4173a81
Cursor pointer
savannahostrowski bd76cbd
Fix conflicts and fix css
savannahostrowski 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
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,5 +1,13 @@ | ||
.App { | ||
text-align: center; | ||
display: flex; | ||
flex-direction: column; | ||
height: 100vh; | ||
} | ||
|
||
.Main { | ||
background-color: lightgray; | ||
padding-bottom: 120px; | ||
} | ||
|
||
/* | ||
|
@@ -53,18 +61,96 @@ Header | |
display: table-cell; | ||
vertical-align: middle; | ||
font-weight: bold; | ||
color: white; | ||
} | ||
|
||
.filterButton { | ||
height: 70px; | ||
float: right; | ||
display: table-cell; | ||
} | ||
|
||
.filterButton > span { | ||
margin-right: 15px; | ||
} | ||
|
||
.toolbar { | ||
display: table !important; | ||
background-color: white; | ||
height: 70px; | ||
} | ||
|
||
/* | ||
Desktop Header | ||
*/ | ||
.categories { | ||
display: inline-block; | ||
text-transform: uppercase; | ||
color: black; | ||
height: 37px !important; | ||
|
||
} | ||
|
||
.categories > h4 { | ||
margin: 10px 5px; | ||
font-size: 12px; | ||
cursor: pointer; | ||
} | ||
|
||
.nav { | ||
display: inline-block; | ||
float: right; | ||
} | ||
|
||
.appBar { | ||
background-color: black !important; | ||
display: table !important; | ||
} | ||
|
||
#explore { | ||
background-color: #8acc25; | ||
} | ||
|
||
#report { | ||
background-color: #ffd700; | ||
} | ||
|
||
#resources { | ||
background-color: #39c9bb; | ||
} | ||
|
||
.headerTitle { | ||
display: inline; | ||
font-size: 14px; | ||
color: white; | ||
position: absolute; | ||
left: 27%; | ||
} | ||
|
||
@media (min-width: 768px) { | ||
.headerTitle { | ||
left: 26%; | ||
} | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
.headerTitle { | ||
left: 23%; | ||
} | ||
} | ||
|
||
@media (min-width: 1280px) { | ||
.headerTitle { | ||
left: 20%; | ||
} | ||
} | ||
|
||
.logo { | ||
height: 120px; | ||
width: 120px; | ||
background: url('assets/logo.png') no-repeat; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
background-size: contain; | ||
position: absolute; | ||
left: 10%; | ||
box-shadow: 1px 1px 1px grey; | ||
} | ||
|
||
/* | ||
|
@@ -129,23 +215,72 @@ input { | |
background-color: transparent; | ||
} | ||
|
||
/* | ||
List + Card | ||
*/ | ||
|
||
.cardContainer { | ||
margin-top: 30px; | ||
margin-bottom: 80px; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
height: 100%; | ||
justify-content: center; | ||
} | ||
|
||
|
||
.card { | ||
margin: 16px; | ||
height: 150px; | ||
width: 400px; | ||
} | ||
|
||
.cardPicture { | ||
height: 150px; | ||
width: 150px; | ||
} | ||
|
||
@media (min-width: 600px) { | ||
.card { | ||
width: 550px; | ||
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
|
||
.cardContainer { | ||
margin-top: 80px; | ||
margin-bottom: 0; | ||
} | ||
|
||
.card { | ||
width: 650px; | ||
height: 200px; | ||
} | ||
|
||
.cardPicture { | ||
height: 200px; | ||
width: 200px; | ||
} | ||
} | ||
|
||
/* | ||
Footer Styles | ||
*/ | ||
|
||
.plusButton { | ||
position: relative; | ||
top: -40px; | ||
top: -50px; | ||
} | ||
|
||
.footerIconDiv { | ||
width: 100%; | ||
position: sticky; | ||
bottom: 0; | ||
left: 0; | ||
padding-bottom: 25px; | ||
padding: 25px 0; | ||
background-color: white; | ||
position: sticky; | ||
} | ||
|
||
.footerIcons span { | ||
|
@@ -158,8 +293,4 @@ Footer Styles | |
color: gray; | ||
} | ||
|
||
.App { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100vh; | ||
} | ||
|
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.
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,89 @@ | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withRouter } from 'react-router-dom'; | ||
|
||
import withStyles from '@material-ui/core/styles/withStyles'; | ||
import AppBar from '@material-ui/core/AppBar'; | ||
import Button from '@material-ui/core/Button'; | ||
import List from '@material-ui/core/List/List'; | ||
import ListItem from '@material-ui/core/ListItem/ListItem'; | ||
import Menu from '@material-ui/icons/Menu'; | ||
import SwipeableDrawer from '@material-ui/core/SwipeableDrawer/SwipeableDrawer'; | ||
|
||
import '../App.css'; | ||
|
||
|
||
const styles = { | ||
moreIcon: { | ||
float: 'right', | ||
display: 'inline', | ||
color: 'white', | ||
paddingBottom: 0, | ||
}, | ||
|
||
}; | ||
|
||
class DesktopHeader extends Component { | ||
state = { | ||
right: false, | ||
}; | ||
|
||
toggleDrawer = (side, open) => () => { | ||
this.setState({ | ||
[side]: open, | ||
}); | ||
}; | ||
|
||
render() { | ||
const { classes, history } = this.props; | ||
|
||
return ( | ||
<div style={{ position: 'fixed', width: '100%' }}> | ||
<AppBar position="static" className="appBar"> | ||
<div className="logo"/> | ||
<h1 className="headerTitle" onClick={() => history.push('/')} style={{ cursor: 'pointer' }}> | ||
Urban Carnivore Sightings | ||
</h1> | ||
<Button className={classes.moreIcon} onClick={this.toggleDrawer('right', true)}><Menu/></Button> | ||
<SwipeableDrawer | ||
anchor="right" | ||
open={this.state.right} | ||
onClose={this.toggleDrawer('right', false)} | ||
onOpen={this.toggleDrawer('right', true)} | ||
> | ||
<div | ||
tabIndex={0} | ||
role="button" | ||
onClick={this.toggleDrawer('right', false)} | ||
onKeyDown={this.toggleDrawer('right', false)} | ||
style={{ width: '250px' }} | ||
> | ||
<List> | ||
<ListItem className="drawerItem"><h3>Stub</h3> | ||
</ListItem> | ||
<ListItem className="drawerItem"><h3>Stub</h3> | ||
</ListItem> | ||
<ListItem className="drawerItem"><h3>Stub</h3> | ||
</ListItem> | ||
</List> | ||
</div> | ||
</SwipeableDrawer> | ||
<div className="nav"> | ||
<div id="explore" className="categories" onClick={() => history.push('/map')}><h4>Explore</h4></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 |
||
<div id="resources" className="categories" onClick={() => history.push('/resources')}><h4>Resources</h4> | ||
</div> | ||
<div id="report" className="categories" onClick={() => history.push('/reports/create')}><h4>Report | ||
Sightings</h4></div> | ||
</div> | ||
|
||
</AppBar> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
DesktopHeader.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default withRouter(withStyles(styles)(DesktopHeader)); |
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
Oops, something went wrong.
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 mega-mega-mega nit is that I don't think this logo has a drop-shadow like the rest of the header does. IDK how tricky that is to make happen -- maybe something for the backlog?
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.
Just added a v. small box shadow for now on 3 sides...not perfect because it overlaps the black bar but I'm not 100% sure that we can do this partially with CSS. Alternatively, I can remove the shadow from the black bar.
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.
Also, we need a better asset for the logo - this is a screenshot 😆
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.
We also might want to throw an onClick event on the logo to nav back to home eventually but that's tbd.