-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
css-modules infrastructure, ui components rewritten to use css-modules
- Loading branch information
Showing
40 changed files
with
600 additions
and
525 deletions.
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
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
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
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,9 @@ | ||
$darkPrimaryColor: #303f9f; | ||
$primaryColor: #3f51b5; | ||
$lightPrimaryColor: #c5cae9; | ||
$textColor: #fff; | ||
$accentColor: #ff4081; | ||
$primaryTextColor: #212121; | ||
$secondaryTextColor: #727272; | ||
$dividerColor: #b6b6b6; | ||
$errorColor: #f44336; |
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
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,9 @@ | ||
:global { | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
font-family: 'Roboto'; | ||
background-color: rgba(0,0,0,.05); | ||
-webkit-font-smoothing: antialiased; | ||
} | ||
} |
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,51 +1,40 @@ | ||
import React, {Component, PropTypes} from 'react'; | ||
import {curried} from '../../utils/common'; | ||
import {colors} from '../../utils/styles'; | ||
import {List, ListItem, ListLabel, Avatar, Icon, Loader} from '../ui'; | ||
import cn from 'classnames'; | ||
import styles from './feed.scss'; | ||
|
||
export default class FeedChannels extends Component { | ||
static propTypes = { | ||
list: PropTypes.array.isRequired, | ||
onToggle: PropTypes.func.isRequired, | ||
}; | ||
} | ||
|
||
render() { | ||
const styles = this.getStyles(); | ||
|
||
const channels = this.props.list.map((channel) => { | ||
return <ListItem | ||
key={channel.id} | ||
style={styles.channel} | ||
className={styles.channelsItem} | ||
primaryText={channel.name} | ||
leftElement={<Avatar size={32} url={channel.image} />} | ||
leftElement={<Avatar url={channel.image} className={styles.channelsItemImage} />} | ||
leftElementHeight={32} | ||
rightElement={this._renderRightElement(channel)} | ||
rightElementHeight={24} | ||
height={48} | ||
onClick={curried(this.props.onToggle, channel)} />; | ||
}); | ||
|
||
return <div style={this.props.style}> | ||
return <div className={cn(styles.channels, this.props.className)}> | ||
<ListLabel text="Your channels" /> | ||
<List>{channels}</List> | ||
</div>; | ||
} | ||
|
||
_renderRightElement(channel) { | ||
if (channel.isLoading) { | ||
return <Loader size={24} color={colors.primaryText} />; | ||
return <Loader size={24} />; | ||
} | ||
|
||
return channel.isEnabled ? <Icon size={24}>check</Icon> : null; | ||
} | ||
|
||
getStyles() { | ||
return { | ||
|
||
channel: { | ||
fontSize: 14, | ||
}, | ||
|
||
}; | ||
return channel.isEnabled ? <Icon size={24} glyph="check" /> : null; | ||
} | ||
} |
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
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,13 @@ | ||
|
||
.channels { | ||
&Item { | ||
font-size: 14px; | ||
|
||
&Image { | ||
width: 32px; | ||
height: 32px; | ||
} | ||
} | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
import React, {Component} from 'react'; | ||
import cn from 'classnames'; | ||
import styles from './avatar.scss'; | ||
|
||
export default class Avatar extends Component { | ||
static propTypes = { | ||
url: React.PropTypes.string.isRequired, | ||
} | ||
|
||
render() { | ||
return <span | ||
className={cn(styles.avatar, this.props.className)} | ||
style={{...this.props.style, backgroundImage: `url(${this.props.url})`}} />; | ||
} | ||
} |
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,8 @@ | ||
.avatar { | ||
display: inline-block; | ||
width: 40px; | ||
height: 40px; | ||
background-size: cover; | ||
background-position: center; | ||
border-radius: 50%; | ||
} |
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,31 @@ | ||
.flat { | ||
height: 36px; | ||
padding: 0 24px; | ||
line-height: 16px; | ||
font-size: 16px; | ||
text-transform: uppercase; | ||
border: none; | ||
background: none; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
background: rgba(0,0,0,.1); | ||
} | ||
} | ||
|
||
.icon { | ||
display: inline-block; | ||
position: relative; | ||
background-color: transparent; | ||
border: none; | ||
outline: none; | ||
margin: 0; | ||
padding: 0; | ||
cursor: pointer; | ||
border-radius: 50%; | ||
|
||
&:hover { | ||
background: rgba(0,0,0,.1); | ||
} | ||
|
||
} |
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,15 @@ | ||
import React, {Component, PropTypes} from 'react'; | ||
import cn from 'classnames'; | ||
import styles from './button.scss'; | ||
|
||
export default class FlatButton extends Component { | ||
static propTypes = { | ||
label: PropTypes.node.isRequired, | ||
} | ||
|
||
render() { | ||
return <button className={cn(styles.flat, this.props.className)}> | ||
{this.props.label} | ||
</button>; | ||
} | ||
} |
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,23 @@ | ||
import React, {Component, PropTypes} from 'react'; | ||
import cn from 'classnames'; | ||
import Icon from '../icon/icon'; | ||
import styles from './button.scss'; | ||
|
||
export default class IconButton extends Component { | ||
static propTypes = { | ||
glyph: PropTypes.string.isRequired, | ||
onClick: PropTypes.func.isRequired, | ||
size: PropTypes.number, | ||
boxSize: PropTypes.number, | ||
} | ||
|
||
render() { | ||
const {size, boxSize, glyph, onClick, className} = this.props; | ||
return <button | ||
className={cn(styles.icon, className)} | ||
onClick={onClick} | ||
style={this.props.style}> | ||
<Icon size={size} boxSize={boxSize} glyph={glyph} /> | ||
</button>; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.