fix some style, remove svg config. · lu607601/admin-react@0b360ee · GitHub
Skip to content

Commit 0b360ee

Browse files
committed
fix some style, remove svg config.
1 parent c92a1e1 commit 0b360ee

11 files changed

Lines changed: 42 additions & 33 deletions

File tree

.umirc.js

Lines changed: 5 additions & 10 deletions

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
"stylelint": "^9.6.0",
6363
"stylelint-config-prettier": "^4.0.0",
6464
"stylelint-config-standard": "^18.2.0",
65-
"svg-sprite-loader": "^4.1.1",
66-
"umi": "2.1.2",
65+
"umi": "^2.2.1",
6766
"umi-plugin-react": "^1.2.0"
6867
},
6968
"optionalDependencies": {

src/components/Layout/Sider.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ class Sider extends PureComponent {
3939
</div>
4040

4141
<div className={styles.menuContainer}>
42-
<ScrollBar>
42+
<ScrollBar
43+
option={{
44+
// Disabled horizontal scrolling, https://github.com/utatti/perfect-scrollbar#options
45+
suppressScrollX: true,
46+
}}
47+
>
4348
<SiderMenu
4449
menus={menus}
4550
theme={theme}

src/components/Layout/Sider.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
background-color: rgba(0, 0, 0, 0.2);
6565
}
6666
}
67+
68+
:global {
69+
.ant-menu-inline {
70+
border-right: none;
71+
}
72+
}
6773
}
6874

6975
.switchTheme {

src/components/Loader/Loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44
import styles from './Loader.less'
55

6-
const Loader = ({ spinning, fullScreen }) => {
6+
const Loader = ({ spinning = true, fullScreen }) => {
77
return (
88
<div
99
className={classNames(styles.loader, {

src/layouts/PrimaryLayout.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
3030

3131
.content {
3232
padding: 24px;
33+
min-height: ~'calc(100% - 72px)';
3334
}
3435

3536
.container {
3637
height: 100vh;
3738
flex: 1;
39+
width: ~'calc(100% - 256px)';
3840
}
3941

4042
.footer {
@@ -43,4 +45,5 @@
4345
margin-bottom: 0;
4446
padding-top: 24px;
4547
padding-bottom: 24px;
48+
min-height: 72px;
4649
}

src/pages/dashboard/components/user.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import { Button, Icon } from 'antd'
3+
import { Button, Avatar } from 'antd'
44
import CountUp from 'react-countup'
55
import { Color } from 'utils'
66
import styles from './user.less'
@@ -13,13 +13,13 @@ const countUpProps = {
1313
separator: ',',
1414
}
1515

16-
function User({ name, sales = 0, sold = 0 }) {
16+
function User({ avatar, username, sales = 0, sold = 0 }) {
1717
return (
1818
<div className={styles.user}>
1919
<div className={styles.header}>
2020
<div className={styles.headerinner}>
21-
<Icon className={styles.avatar} type="github" theme="outlined" />
22-
<h5 className={styles.name}>{name}</h5>
21+
<Avatar size="large" src={avatar} />
22+
<h5 className={styles.name}>{username}</h5>
2323
</div>
2424
</div>
2525
<div className={styles.number}>
@@ -46,7 +46,8 @@ function User({ name, sales = 0, sold = 0 }) {
4646
}
4747

4848
User.propTypes = {
49-
name: PropTypes.string,
49+
avatar: PropTypes.string,
50+
username: PropTypes.string,
5051
sales: PropTypes.number,
5152
sold: PropTypes.number,
5253
}

src/pages/dashboard/components/user.less

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,9 @@
2626
z-index: 1;
2727
}
2828

29-
.avatar {
30-
font-size: 48px;
31-
background-position: center;
32-
background-size: cover;
33-
border-radius: 50%;
34-
display: inline-block;
35-
}
36-
3729
.name {
3830
font-size: 16px;
31+
margin-top: 8px;
3932
}
4033
}
4134

src/pages/dashboard/index.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ const bodyStyle = {
2525
},
2626
}
2727

28-
@connect(({ dashboard, loading }) => ({ dashboard, loading }))
28+
@connect(({ app, dashboard, loading }) => ({
29+
avatar: app.user.avatar,
30+
username: app.user.username,
31+
dashboard,
32+
loading,
33+
}))
2934
class Dashboard extends PureComponent {
3035
render() {
31-
const { dashboard, loading } = this.props
36+
const { avatar, username, dashboard, loading } = this.props
3237
const {
3338
weather,
3439
sales,
@@ -50,7 +55,7 @@ class Dashboard extends PureComponent {
5055

5156
return (
5257
<Page
53-
loading={loading.models.dashboard && sales.length === 0}
58+
// loading={loading.models.dashboard && sales.length === 0}
5459
className={styles.dashboard}
5560
>
5661
<Row gutter={24}>
@@ -139,7 +144,7 @@ class Dashboard extends PureComponent {
139144
bordered={false}
140145
bodyStyle={{ ...bodyStyle.bodyStyle, padding: 0 }}
141146
>
142-
<User {...user} />
147+
<User {...user} avatar={avatar} username={username} />
143148
</Card>
144149
</Col>
145150
</Row>
@@ -149,6 +154,8 @@ class Dashboard extends PureComponent {
149154
}
150155

151156
Dashboard.propTypes = {
157+
avatar: PropTypes.string,
158+
username: PropTypes.string,
152159
dashboard: PropTypes.object,
153160
loading: PropTypes.object,
154161
}

src/pages/post/components/List.js

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)