Skip to content

Commit 3e67379

Browse files
committed
minor fix and update
1 parent 7debf75 commit 3e67379

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
A Switch control built with and for [React](http://facebook.github.io/react/index.html)
44

5-
## New version 2.0.0
5+
## New version 2.1.0
66

7-
I've rewritten the component model with some alignment for ES6.
7+
Add square theme.
88

99
## Demo & Example
1010

1111
Example: [http://gfazioli.github.io/react-switch-button](http://gfazioli.github.io/react-switch-button)
1212
Live demo: [Online Demo](http://gfazioli.github.io/react-switch-button#demo)
1313

14-
![schermata 2016-09-16 alle 15 49 23](https://cloud.githubusercontent.com/assets/432181/18588077/42623d26-7c25-11e6-9e43-4043ac288d0a.png)
15-
1614
## Installation
1715

1816
You can use React Switch Button by using NPM and include it in your own React build process (using [Browserify](http://browserify.org), etc).

example/dist/app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ var App = React.createClass({
2828
var code = [{
2929
label: "Simple usage",
3030
code: '<SwitchButton name="switch-1" />', object: React.createElement(SwitchButton, { theme: this.state.theme, name: 'switch-1' })
31+
}, {
32+
label: "Set Theme",
33+
code: '<SwitchButton name="switch-1t" theme="rsbc-switch-button-flat-square" defaultChecked={true} />',
34+
object: React.createElement(SwitchButton, { name: 'switch-1t',
35+
theme: 'rsbc-switch-button-flat-square',
36+
defaultChecked: true })
3137
}, {
3238
label: "Set initial status",
3339
code: '<SwitchButton name="switch-2" defaultChecked={true} />',
@@ -105,6 +111,15 @@ var App = React.createClass({
105111
null,
106112
'Say Hello, React Switch Button'
107113
),
114+
React.createElement(
115+
'div',
116+
{ className: 'example' },
117+
React.createElement(
118+
'h3',
119+
null,
120+
'New in v.2.1.0'
121+
)
122+
),
108123
React.createElement(SwitchButton, { name: 'switch-theme', label: 'Switch Theme', onChange: this.onChange }),
109124
React.createElement('hr', null),
110125
rows

example/src/app.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ const App = React.createClass( {
3030
label : "Simple usage",
3131
code : '<SwitchButton name="switch-1" />', object : <SwitchButton theme={this.state.theme} name="switch-1"/>
3232
},
33+
{
34+
label : "Set Theme",
35+
code : '<SwitchButton name="switch-1t" theme="rsbc-switch-button-flat-square" defaultChecked={true} />',
36+
object : <SwitchButton name="switch-1t"
37+
theme="rsbc-switch-button-flat-square"
38+
defaultChecked={true}/>
39+
},
3340
{
3441
label : "Set initial status",
3542
code : '<SwitchButton name="switch-2" defaultChecked={true} />',
@@ -100,6 +107,11 @@ const App = React.createClass( {
100107
return (
101108
<div className="examples">
102109
<h1>Say Hello, React Switch Button</h1>
110+
111+
<div className="example">
112+
<h3>New in v.2.1.0</h3>
113+
</div>
114+
103115
<SwitchButton name="switch-theme" label="Switch Theme" onChange={this.onChange} />
104116
<hr/>
105117
{rows}

0 commit comments

Comments
 (0)