Skip to content

Commit 1e3ed54

Browse files
author
Tina C Lin (RD-TW)
committed
Import Loader component for demo, and add new style for loading class within a button.
1 parent 641ffeb commit 1e3ed54

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

examples/IconButtons.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { Button } from '../src';
3+
import { Loader } from './components/Loader';
34

45
export default () => {
56
return (
@@ -19,11 +20,11 @@ export default () => {
1920

2021
<p><strong>Progressing</strong></p>
2122
<Button disabled>
22-
<i className="fa fa-circle-o-notch fa-spin" />
23+
<Loader size="small" />
2324
Uploading
2425
</Button>
2526
<Button btnStyle="primary" disabled>
26-
<i className="fa fa-circle-o-notch fa-spin" />
27+
<Loader size="small" />
2728
Uploading
2829
</Button>
2930
<br /><br />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import '@trendmicro/react-loader/dist/react-loader.css';
2+
3+
export Loader from '@trendmicro/react-loader';

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"react": "^0.14.0 || ^15.0.0"
5555
},
5656
"dependencies": {
57+
"@trendmicro/react-loader": "^0.1.0",
5758
"classnames": "^2.2.5",
5859
"react-addons-shallow-compare": "^0.14.0 || ^15.0.0"
5960
},

src/index.styl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@
8383
padding-right: 0;
8484
width: 42px;
8585
}
86+
87+
// Loading class within a button
88+
> [class*="loader-container"] {
89+
display: inline-block;
90+
margin-top: 2px;
91+
margin-right: 8px;
92+
}
8693
}
8794

8895
// Alternate buttons
@@ -147,6 +154,12 @@
147154
}
148155
}
149156

157+
// Loading class within a primary button
158+
> [class*="loader-container"] > [class*="loader"] {
159+
border-color: rgba(255, 255, 255, 0.4);
160+
border-left-color: #fff;
161+
}
162+
150163
&:active,
151164
&.active {
152165
color: #fff;

0 commit comments

Comments
 (0)