Skip to content

Commit

Permalink
Merge pull request #10 from Schwartz10/UI
Browse files Browse the repository at this point in the history
adds some design on the home screen
  • Loading branch information
Schwartz10 authored Jan 20, 2018
2 parents 59306d8 + 3e04188 commit 0568920
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 39 deletions.
22 changes: 22 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,25 @@ code {
height: 16px;
margin-right: 10px;
}

#navigation {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-left: 10em;
margin-right: 10em;
margin-top: 3em;
}

#main-header {
font-size: 3em;
}

#post-container {
display: flex;
justify-content: center;
}

.single-view-header {
text-align: center;
}
10 changes: 10 additions & 0 deletions src/components/Drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import MenuItem from 'material-ui/MenuItem';
import RaisedButton from 'material-ui/RaisedButton';
import { Link } from 'react-router-dom'

const styles = {
button: {
width: "7em",
height: "3em",
},
};


export default class DrawerNav extends React.Component {

constructor(props) {
Expand All @@ -19,6 +27,8 @@ export default class DrawerNav extends React.Component {
return (
<div>
<RaisedButton
buttonStyle={styles.button}
primary={true}
label="Menu"
onClick={this.handleToggle}
/>
Expand Down
27 changes: 13 additions & 14 deletions src/components/Explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ class Explore extends Component {
render(){
return(
<div>
<h1>Explore</h1>
{this.props.posts.length > 0 &&
this.props.posts.map(post =>
<div key={post.username}>
<Post
username={post.username}
tokenPot={post.tokenPot}
postUrl={post.postUrl}
address={post.address}
isPreview={false}
/>
<br />
</div>
)}
<h1 className="single-view-header">Explore</h1>
{this.props.posts.length > 0 &&
this.props.posts.map(post =>
<div id="post-container" key={post.username}>
<Post
username={post.username}
tokenPot={post.tokenPot}
postUrl={post.postUrl}
address={post.address}
isPreview={false}
/>
</div>
)}
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/LikePhoto.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class LikePhoto extends Component {
render(){
return(
<div>
<RaisedButton label="like" onClick={e => this.props.like(e, this.props.postUrl, this.props.postAddress, this.props.contract.likePost, this.props.accounts[0])}/>
<RaisedButton primary={true} label="like" onClick={e => this.props.like(e, this.props.postUrl, this.props.postAddress, this.props.contract.likePost, this.props.accounts[0])}/>
</div>
)
}
Expand Down
47 changes: 25 additions & 22 deletions src/components/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@ import {Card, CardActions, CardHeader, CardMedia, CardTitle } from 'material-ui/
import LikePhoto from './LikePhoto';

const cardStyle = {
width: '30vw'
width: '40vw'
}

const Post = props => (
<Card style={cardStyle}>
<CardHeader
title={props.username}
/>
<CardMedia
overlay={<CardTitle title={'Total InstaCoins: ' + props.tokenPot} />}
>
<img src={props.postUrl} alt="" />
</CardMedia>
{!props.isPreview &&
<div>
<CardTitle title="Like this pic?"/>
<CardActions>
<LikePhoto
postUrl={props.postUrl}
postAddress={props.address}
/>
</CardActions>
</div>
}
</Card>
<div>
<Card style={cardStyle}>
<CardHeader
title={props.username}
/>
<CardMedia
overlay={<CardTitle title={'Total InstaCoins: ' + props.tokenPot} />}
>
<img src={props.postUrl} alt="" />
</CardMedia>
{!props.isPreview &&
<div>
<CardTitle title="Like this pic?"/>
<CardActions>
<LikePhoto
postUrl={props.postUrl}
postAddress={props.address}
/>
</CardActions>
</div>
}
</Card>
<br /><br />
</div>
)

export default Post;
17 changes: 15 additions & 2 deletions src/components/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import CreatePost from './CreatePost';
import RaisedButton from 'material-ui/RaisedButton';
import { Link } from 'react-router-dom';

const styles = {
button: {
width: "7em",
height: "3em",
},
};

export default class Routes extends Component {
componentDidMount () {}

Expand All @@ -17,8 +24,14 @@ export default class Routes extends Component {
<Router history={history}>
<div>
<span>
<Drawer />
<Link to="/" ><RaisedButton label="home" /> </Link>
<div id="navigation">
<Drawer />
<h1 id="main-header">InstaCoin</h1>
<Link to="/" >
<RaisedButton buttonStyle={styles.button}
primary={true} label="home" />
</Link>
</div>
</span>
<Switch>
<Route exact path='/profile' component={Account} />
Expand Down

0 comments on commit 0568920

Please sign in to comment.