Skip to content

Commit

Permalink
Update examples accordingly.
Browse files Browse the repository at this point in the history
  • Loading branch information
yamafaktory committed Apr 18, 2017
1 parent 2e86933 commit a80e9bc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
8 changes: 4 additions & 4 deletions examples/tweet/content.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createElement } from '../../src/react' // eslint-disable-line no-unused-vars
/** @jsx createElement */

import React, { PropTypes } from 'react' //eslint-disable-line no-unused-vars
import PropTypes from 'prop-types'
import React from 'react'
import { merge, select } from '../../src'
import { vars } from '../../src/react'

Expand All @@ -13,7 +14,7 @@ export class Content extends React.Component {
text: PropTypes.string
}
styles = {
text: merge({
text: merge({
fontSize: '1.25rem',
fontWeight: 300,
lineHeight: '1.5em',
Expand All @@ -35,7 +36,7 @@ export class Content extends React.Component {
}
render() {
let { media, text } = this.props
let styles = this.styles
let styles = this.styles
return <div>
<p css={styles.text} dangerouslySetInnerHTML={{ __html: text }} />
<a css={styles.media} href={media.expanded_url}>
Expand All @@ -44,4 +45,3 @@ export class Content extends React.Component {
</div>
}
}

11 changes: 6 additions & 5 deletions examples/tweet/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createElement } from '../../src/react' // eslint-disable-line no-unused-vars
/** @jsx createElement */

import React, { Component, PropTypes } from 'react' // eslint-disable-line no-unused-vars
import PropTypes from 'prop-types'
import React, { Component } from 'react' // eslint-disable-line no-unused-vars

import { reply, retweet, like, more } from './svgs'

Expand Down Expand Up @@ -68,7 +69,7 @@ export class Footer extends Component {
flexGrow: 1,
justifyContent: 'center',
textAlign: 'center',

background: 'none',
border: 'none',
color: 'inherit',
Expand All @@ -81,7 +82,7 @@ export class Footer extends Component {
color: this.props.vars.animation
}
}

handleClick = () => {
this.setState({
liked: !this.state.liked
Expand All @@ -91,7 +92,7 @@ export class Footer extends Component {
render() {
const { createdAt, favoriteCount, retweetCount } = this.props
const { liked } = this.state
let { styles } = this
let { styles } = this

return (
<div>
Expand All @@ -116,7 +117,7 @@ export class Footer extends Component {
{retweet}
</div>
<button css={styles.button} onClick={this.handleClick}>
{like(liked && style(styles.liked))}
{like(liked && style(styles.liked))}
</button>
<div css={styles.icon}>
{more}
Expand Down
6 changes: 3 additions & 3 deletions examples/tweet/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { createElement } from '../../src/react' // eslint-disable-line no-unused


// @value primary, secondary from 'styles/colors.css';
import React, { PropTypes } from 'react'
import PropTypes from 'prop-types'
import React from 'react'
import { merge, select, before } from '../../src'
import { vars } from '../../src/react'

Expand Down Expand Up @@ -70,7 +71,6 @@ export class Header extends React.Component {
<span css={styles.screenName}>@{screenName}</span>
</a>
</div>
</div>
</div>
}
}

4 changes: 2 additions & 2 deletions examples/tweet/tweet.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createElement } from '../../src/react' // eslint-disable-line no-unused-vars
/** @jsx createElement */


import React, { PropTypes } from 'react'
import PropTypes from 'prop-types'
import React from 'react' // eslint-disable-line no-unused-vars

import { Header } from './header'
import { Content } from './content'
Expand Down

0 comments on commit a80e9bc

Please sign in to comment.