Skip to content

Commit cc12748

Browse files
author
Sven
committed
style: 修改loading样式
1 parent a9fe5f1 commit cc12748

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

src/routes/Zen/components/Zen.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import './Zen.scss'
43
import Spinner from 'react-spinkit'
54
import { Button } from 'reactstrap'
65

@@ -11,26 +10,23 @@ Zen.propTypes = {
1110
}
1211

1312
function Zen({ fetchZen, clearZen, zen: { fetching, text } }) {
14-
return (<div>
15-
<div className="loading">
16-
{fetching
17-
? <Spinner name="cube-grid" color="purple" /> : ''
18-
}
19-
</div>
13+
return (
2014
<div>
21-
<Button color="success" onClick={fetchZen}>
22-
{fetching ? 'Fetching...' : 'Fetch'}
23-
</Button>
24-
{' '}
25-
<Button color="danger" onClick={clearZen}>Clear</Button>
26-
</div>
27-
<hr />
28-
<div>
29-
{text.map(item => (
30-
<p key={item.id}>{item.text}</p>
31-
))}
32-
</div>
33-
</div>)
15+
{fetching && <Spinner name="cube-grid" color="purple" style={{ margin: 'auto' }} />}
16+
<div style={{ marginTop: '20px' }}>
17+
<Button color="success" onClick={fetchZen}>
18+
{fetching ? 'Fetching...' : 'Fetch'}
19+
</Button>
20+
{' '}
21+
<Button color="danger" onClick={clearZen}>Clear</Button>
22+
</div>
23+
<hr />
24+
<div>
25+
{text.map(item => (
26+
<p key={item.id}>{item.text}</p>
27+
))}
28+
</div>
29+
</div>)
3430
}
3531

3632
export default Zen

src/routes/Zen/components/Zen.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)