Skip to content

Commit dbc3382

Browse files
committed
Fix admin UI
1 parent 4a64c65 commit dbc3382

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

web/admin/src/index.css

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
@import '~antd/dist/antd.css';
2-
@import '~codemirror/lib/codemirror.css';
3-
@import '~codemirror/theme/idea.css';
1+
@import "~antd/dist/antd.css";
2+
@import "~codemirror/lib/codemirror.css";
3+
@import "~codemirror/theme/idea.css";
44

55
:root {
66
/* TEXT COLORS */
7-
--heading-color: color-mod(#000 alpha(85%));
8-
--text-color: color-mod(#000 alpha(65%));
7+
--heading-color: color-mod(#000 alpha(85%));
8+
--text-color: color-mod(#000 alpha(65%));
99
--text-color-secondary: color-mod(#000 alpha(45%));
1010

11-
--heading-color-dark: color-mod(#fff alpha(100%));
12-
--text-color-dark: color-mod(#fff alpha(85%));
11+
--heading-color-dark: color-mod(#fff alpha(100%));
12+
--text-color-dark: color-mod(#fff alpha(85%));
1313
--text-color-secondary-dark: color-mod(#fff alpha(65%));
1414

15-
1615
/* BACKGROUND COLORS */
1716
--dark-background: #001529;
1817
--light-background: #f8f8f8;
@@ -25,3 +24,10 @@
2524
/* FORM */
2625
--field-border-color: #d9d9d9;
2726
}
27+
28+
html,
29+
body,
30+
#root {
31+
width: 100%;
32+
min-height: 100vh;
33+
}

web/admin/src/scenes/scenes/main/Main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ class Main extends Component {
7979

8080
renderAll() {
8181
return (
82-
<Layout className={styles.layout}>
82+
<Layout style={{ minHeight:"100vh" }}>
8383

8484
{this.renderSidebar()}
8585

86-
<Layout className={styles.main}>
86+
<Layout>
8787

8888
<Layout.Header>
8989
{this.renderHeader()}
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
.layout {
2-
}
3-
41
.content {
52
padding: 24px;
6-
height: 100%;
73
}
84

95
.body {
106
padding: 10px;
117
background-color: #fff;
12-
height: 100%;
138
}
149

1510
.spin {
@@ -18,7 +13,3 @@
1813
align-items: center;
1914
justify-content: center;
2015
}
21-
22-
.main {
23-
height: 100vh;
24-
}

web/admin/src/scenes/scenes/main/components/nav/Nav.js

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,35 @@ import { withRouter } from "react-router";
66

77
class Nav extends Component {
88
static propTypes = {
9-
menuItems: PropTypes.array,
109
location: PropTypes.object,
1110
};
1211

13-
static defaultProps = {
14-
menuItems: [],
15-
};
1612

1713
render() {
18-
const { menuItems, location } = this.props;
14+
const { location } = this.props;
15+
16+
const menuItems = [
17+
{
18+
title: 'Users',
19+
path: '/users',
20+
icon: 'team',
21+
},
22+
{
23+
title: 'Challenges',
24+
path: '/challenges',
25+
icon: 'bulb',
26+
},
27+
{
28+
title: 'Announcements',
29+
path: '/announcements',
30+
icon: 'notification',
31+
},
32+
{
33+
title: 'Files',
34+
path: '/files',
35+
icon: 'file',
36+
},
37+
]
1938

2039
let selectedKeys = [];
2140
menuItems.forEach((m, i) => {
@@ -29,30 +48,14 @@ class Nav extends Component {
2948

3049
return (
3150
<Menu selectedKeys={selectedKeys} theme="dark" style={{ height: "100%" }}>
32-
<Menu.Item key={0}>
33-
<Link to="/users">
34-
<Icon type="team" />
35-
<span>Users</span>
36-
</Link>
37-
</Menu.Item>
38-
<Menu.Item key={1}>
39-
<Link to="/challenges">
40-
<Icon type="bulb" />
41-
<span>Challenges</span>
42-
</Link>
43-
</Menu.Item>
44-
<Menu.Item key={2}>
45-
<Link to="/announcements">
46-
<Icon type="notification" />
47-
<span>Announcements</span>
48-
</Link>
49-
</Menu.Item>
50-
<Menu.Item key={3}>
51-
<Link to="/users">
52-
<Icon type="file" />
53-
<span>Files</span>
54-
</Link>
55-
</Menu.Item>
51+
{menuItems.map((item, i) => (
52+
<Menu.Item key={i}>
53+
<Link to={item.path}>
54+
<Icon type={item.icon} />
55+
<span>{item.title}</span>
56+
</Link>
57+
</Menu.Item>
58+
))}
5659
</Menu>
5760
);
5861
}

0 commit comments

Comments
 (0)