Skip to content

Instantly share code, notes, and snippets.

@cullophid
Created August 26, 2015 12:30
Show Gist options
  • Save cullophid/81386f009388b0aa160b to your computer and use it in GitHub Desktop.
Save cullophid/81386f009388b0aa160b to your computer and use it in GitHub Desktop.
import React from 'react';
import styles from './Cover.css';
import withStyles from '../../decorators/withStyles';
import Link from '../../utils/Link';
import Avatar from './Avatar';
import { Button } from 'react-bootstrap';
@withStyles(styles)
class Cover extends React.Component {
getInitialState() {
return {
isFollowing: false
}
},
toggleFollow () {
this.setState({isFollowing: !this.state.isFollowing});
// do other stuff
},
render() {
return (
var followClass = this.state.isFollowing? 'active': '';
<div className="Cover">
<div className="Cover-container">
<div>
<Avatar
username="hilarl"
profession="Web Developer"
location="New York, New York"
status="I am here to protect my business, a bunch of kids are out to ruin me" />
<div className="Cover-submenu-container">
<div className="Cover-submenu-section">
.
</div>
<div className="Cover-submenu-section links">
<a href="#" className="Cover-submenu-link">
<i className="fa fa-twitter"></i>
</a>
<a href="#" className="Cover-submenu-link">
<i className="fa fa-facebook"></i>
</a>
</div>
<div className="Cover-submenu-section connect-menu">
<Button className={`follow-btn ${followClass}`} href="#" onClick={this.toggleFollow.bind(this)}>Follow</Button>
</div>
</div>
</div>
</div>
</div>
);
}
}
export default Cover;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment