create torrent page progress

This commit is contained in:
Feross Aboukhadijeh
2016-08-23 03:51:05 -07:00
parent 509691a85a
commit 157226f75b
11 changed files with 179 additions and 103 deletions

View File

@@ -0,0 +1,35 @@
const React = require('react')
const colors = require('material-ui/styles/colors')
class Heading extends React.Component {
static get propTypes () {
return {
level: React.PropTypes.number
}
}
static get defaultProps () {
return {
level: 1
}
}
render () {
const HeadingTag = 'h' + this.props.level
return (
<HeadingTag
style={{
color: colors.grey100,
fontSize: 20,
marginBottom: 15,
marginTop: 30
}}
>
{this.props.children}
</HeadingTag>
)
}
}
module.exports = Heading

View File

@@ -1,22 +0,0 @@
const React = require('react')
const colors = require('material-ui/styles/colors')
class PageHeading extends React.Component {
render () {
return (
<h2
style={{
color: colors.grey100,
fontSize: 20,
marginBottom: 15,
marginTop: 30
}}
>
{this.props.children}
</h2>
)
}
}
module.exports = PageHeading

View File

@@ -1,3 +1,4 @@
const colors = require('material-ui/styles/colors')
const electron = require('electron')
const React = require('react')
@@ -15,7 +16,7 @@ class PathSelector extends React.Component {
id: React.PropTypes.string,
onChange: React.PropTypes.func,
title: React.PropTypes.string.isRequired,
value: React.PropTypes.string.isRequired
value: React.PropTypes.string
}
}
@@ -67,6 +68,9 @@ class PathSelector extends React.Component {
className='control'
disabled
id={id}
inputStyle={{
color: colors.grey50
}}
style={{
flex: '1',
fontSize: 14

View File

@@ -0,0 +1,53 @@
const React = require('react')
const FlatButton = require('material-ui/FlatButton').default
class ShowMore extends React.Component {
static get propTypes () {
return {
defaultExpanded: React.PropTypes.bool,
hideLabel: React.PropTypes.string,
showLabel: React.PropTypes.string
}
}
static get defaultProps () {
return {
hideLabel: 'Hide more...',
showLabel: 'Show more...'
}
}
constructor (props) {
super(props)
this.state = {
expanded: !!this.props.defaultExpanded
}
this.handleClick = this.handleClick.bind(this)
}
handleClick () {
this.setState({
expanded: !this.state.expanded
})
}
render () {
const label = this.state.expanded
? this.props.hideLabel
: this.props.showLabel
return (
<div>
{this.state.expanded ? this.props.children : null}
<FlatButton
onClick={this.handleClick}
label={label}
/>
</div>
)
}
}
module.exports = ShowMore