Skip to content

Commit

Permalink
Merge pull request #1 from btzr-io/master
Browse files Browse the repository at this point in the history
Split components
  • Loading branch information
xaiki authored Feb 21, 2017
2 parents 239be75 + cdc2b9f commit 6ae12ad
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 341 deletions.
10 changes: 10 additions & 0 deletions src/components/alert/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { Component } from 'react';
import { translate } from 'react-i18next';
import style from './theme.styl';

export default (props) => (
<div className={style['success']}>
{props.message}
<i className="material-icons">check</i>
</div>
)
35 changes: 35 additions & 0 deletions src/components/alert/theme.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.success
background: #33AA65
padding: 10px 30px
border-radius: 30px
z-index: 999
position fixed
bottom 25px
right 50px
color $Text1
font-family $MainFont, $AlternateFont
font-size 16px
i
font-size 14px

#checkmark-notify
display inline-block
width 20px
height 20px
transform rotate(45deg)

#stem-notify
position absolute
width 3px
height 12px
background-color $Text1
left 11px
top 6px

#kick-notify
position absolute
width 6px
height 3px
background-color $Text1
left 6px
top 15px
9 changes: 9 additions & 0 deletions src/components/button/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React, { Component } from 'react';
import { translate } from 'react-i18next';
import style from './theme.styl';

export default (props) => (
<div className={style.button}>
{props.text}
</div>
)
9 changes: 9 additions & 0 deletions src/components/button/theme.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.button
font-family: $TitleFont
background: $MainColor
color: $Pure_White
text-transform: uppercase
display: inline-block
padding: 5px 10px
border-radius: 4px
cursor: pointer
File renamed without changes.
18 changes: 2 additions & 16 deletions src/row/theme.styl → src/components/row/theme.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
border-bottom 1px solid rgba(225,225,225,0.15)
padding 35px 20px
transition: all 0.3s ease
transition-property: transform, opacity;
transition-property: background, transform, opacity;
background-color: $BgColor1
&.advanced
overflow: hidden
Expand Down Expand Up @@ -50,7 +50,7 @@
input[type=text],
input[type=number],
input[type=password]
padding: 5px 10px
padding: 7px 10px
border-radius 5px
color #FFF
outline 0
Expand All @@ -62,17 +62,3 @@
background $InputBg
-webkit-box-shadow: inset 0px 0px 1px 0px rgba(0,0,0,0.85)
transition background .2s ease


input[type=text]
&.dir-path
width: 225px

.btn
font-family: $TitleFont
background: $MainColor
color: $Pure_White
text-transform: uppercase
i
margin: 0 5px 0 0
font-size: 18px
2 changes: 1 addition & 1 deletion src/switch/index.js → src/components/switch/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { translate } from 'react-i18next';
import style from './styl/theme.styl';
import style from './theme.styl';

export default (props) => (
<label className={style.switch}>
Expand Down
File renamed without changes.
18 changes: 8 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React, { Component } from 'react';
import { translate } from 'react-i18next';
import style from './styl/theme.styl';

import Row from './row';
import Switch from './switch';
import Row from './components/row';
import Alert from './components/alert';
import Button from './components/button';
import Switch from './components/switch';

let GoBackButton = (props) => (
<div className={style['go-back']}>
Expand All @@ -29,13 +31,6 @@ let ActionBar = (props) => (
</div>
)

let SuccessAlert = (props) => (
<div className={style['success_alert']} style={{display:'none'}}>
{props.t('Saved')}
<i className={style['material-icons']}>check</i>
</div>
)

let CloseButton = (props) => (props)

let NavTabs = (props) => (
Expand All @@ -57,10 +52,13 @@ class Settings extends Component {
return (
<div>
<Row icon="collections_bookmark" title="Torrent Collection" helper="Display a view with your Torrent Collection" action={<Switch/>}/>
<Row icon="folder" title="Cache Directory" helper="Open the Directory where Butter keep it's cache" action={<Button text={props.t('Open')}/>}/>
<Row icon="location_on" title="IP Adress" helper="Set this machine's IP Adress" action={<input type="text"/>}/>

<div className={[style['settings'], props.settings.showAdvancedsettings?'show-advanced':''].join(' ')}>

<div className={style['settings-container']}>
<SuccessAlert {...props}/>
<Alert message={props.t('Saved')}/>
<ActionBar {...props}/>
<NavTabs {...props}/>
<div className={style['tab-content-wrapper']}></div>
Expand Down
Loading

0 comments on commit 6ae12ad

Please sign in to comment.