Skip to content

Commit a8413fe

Browse files
committed
fixed sidebar & updated dependencies
1 parent ae8b9ab commit a8413fe

File tree

9 files changed

+65
-49
lines changed

9 files changed

+65
-49
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
# React Redux Universal Hot Example With Semantic UI
33

4-
[![Build Status](https://travis-ci.org/bertho-zero/react-redux-universal-hot-example.svg?branch=master&style=flat-square)](https://travis-ci.org/bertho-zero/react-redux-universal-hot-example)
5-
[![Dependency Status](https://david-dm.org/bertho-zero/react-redux-universal-hot-example.svg?style=flat-square)](https://david-dm.org/bertho-zero/react-redux-universal-hot-example)
6-
[![devDependency Status](https://david-dm.org/bertho-zero/react-redux-universal-hot-example/dev-status.svg?style=flat-square)](https://david-dm.org/bertho-zero/react-redux-universal-hot-example?type=dev)
4+
[![Build Status](https://travis-ci.org/dongcai/react-redux-semantic-ui.svg?branch=master&style=flat-square)](https://travis-ci.org/dongcai/react-redux-semantic-ui)
5+
[![Dependency Status](https://david-dm.org/dongcai/react-redux-semantic-ui.svg?style=flat-square)](https://david-dm.org/dongcai/react-redux-semantic-ui)
6+
[![devDependency Status](https://david-dm.org/dongcai/react-redux-semantic-ui/dev-status.svg?style=flat-square)](https://david-dm.org/dongcai/react-redux-semantic-ui?type=dev)
77

88
---
99
## Demo

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,23 @@
154154
"feathers-errors": "^2.9.1",
155155
"feathers-hooks": "^2.0.1",
156156
"feathers-hooks-common": "^3.7.1",
157-
"feathers-nedb": "^2.6.0",
157+
"feathers-nedb": "^3.0.0",
158158
"feathers-rest": "^1.7.3",
159159
"feathers-socketio": "^2.0.0",
160160
"history": "^4.7.2",
161161
"http-proxy": "^1.16.2",
162162
"is-promise": "^2.1.0",
163163
"js-cookie": "^2.1.3",
164-
"localforage": "^1.4.3",
164+
"localforage": "^1.5.5",
165165
"lru-memoize": "^1.0.1",
166166
"morgan": "^1.8.1",
167167
"multireducer": "^3.1.0",
168168
"nedb": "^1.8.0",
169169
"passport-facebook-token": "^3.3.0",
170170
"pretty-error": "^2.0.2",
171171
"prop-types": "^15.5.8",
172-
"react": "^16.0.0",
173-
"react-dom": "^16.0.0",
172+
"react": "^16.2.0",
173+
"react-dom": "^16.2.0",
174174
"react-helmet": "^5.0.3",
175175
"react-loadable": "^5.3.0",
176176
"react-redux": "^5.0.6",
@@ -182,7 +182,7 @@
182182
"redial": "^0.5.0",
183183
"redux": "^3.6.0",
184184
"redux-auth-wrapper": "^2.0.2",
185-
"redux-form": "^7.1.1",
185+
"redux-form": "^7.2.0",
186186
"redux-logger": "^3.0.6",
187187
"redux-persist": "^5.4.0",
188188
"semantic-ui-less": "^2.2.12",
@@ -194,7 +194,7 @@
194194
"verror": "^1.10.0"
195195
},
196196
"devDependencies": {
197-
"babel-eslint": "^8.0.1",
197+
"babel-eslint": "^8.0.3",
198198
"babel-jest": "^21.0.2",
199199
"babel-loader": "^7.0.0",
200200
"babel-plugin-transform-react-jsx-source": "^6.22.0",
@@ -204,7 +204,7 @@
204204
"concurrently": "^3.5.1",
205205
"css-loader": "^0.28.5",
206206
"enzyme": "^3.1.0",
207-
"eslint": "^4.4.1",
207+
"eslint": "^4.12.1",
208208
"eslint-config-airbnb": "^16.0.0",
209209
"eslint-loader": "^1.6.1",
210210
"eslint-plugin-import": "^2.2.0",
@@ -222,19 +222,19 @@
222222
"less": "^3.0.0-alpha.3",
223223
"less-loader": "^4.0.3",
224224
"lighthouse": "^2.6.0",
225-
"lint-staged": "^5.0.0",
225+
"lint-staged": "^6.0.0",
226226
"mocha": "^4.0.1",
227227
"node-sass": "^4.7.2",
228228
"piping": "^1.0.0-rc.4",
229229
"postcss": "^6.0.9",
230230
"postcss-browser-reporter": "^0.5.0",
231231
"postcss-cssnext": "^3.0.2",
232232
"postcss-import": "^11.0.0",
233-
"postcss-loader": "^2.0.5",
233+
"postcss-loader": "^2.0.9",
234234
"postcss-reporter": "^5.0.0",
235-
"postcss-url": "^7.2.1",
236-
"prettier-eslint-cli": "^4.3.2",
237-
"react-a11y": "^0.3.3",
235+
"postcss-url": "^7.3.0",
236+
"prettier-eslint-cli": "^4.4.2",
237+
"react-a11y": "^1.0.0",
238238
"react-addons-test-utils": "^15.4.2",
239239
"react-hot-loader": "^3.0.0-beta.3",
240240
"react-to-html-webpack-plugin": "^2.2.0",
@@ -247,9 +247,9 @@
247247
"style-loader": "^0.19.0",
248248
"sw-precache-webpack-plugin": "^0.11.3",
249249
"url-loader": "^0.6.2",
250-
"webpack": "^3.7.1",
251-
"webpack-dev-middleware": "^1.12.0",
252-
"webpack-hot-middleware": "^2.17.0",
250+
"webpack": "^3.10.0",
251+
"webpack-dev-middleware": "^1.12.2",
252+
"webpack-hot-middleware": "^2.21.0",
253253
"webpack-isomorphic-tools": "^3.0.2"
254254
},
255255
"engines": {

src/components/InfoBar/InfoBar.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ export default class InfoBar extends Component {
2222
const { info, load } = this.props; // eslint-disable-line no-shadow
2323
const styles = require('./InfoBar.scss');
2424
return (
25-
<Message info>
26-
This is an info bar <strong>{info ? info.message : 'no info!'}</strong>
27-
<span className={styles.time}>{info && new Date(info.time).toString()}</span>
28-
<Button onClick={load}>Reload from server</Button>
29-
</Message>
25+
<div className={styles.wrapper}>
26+
<Message info>
27+
This is an info bar <strong>{info ? info.message : 'no info!'}</strong>
28+
<span className={styles.time}>{info && new Date(info.time).toString()}</span>
29+
<Button onClick={load}>Reload from server</Button>
30+
</Message>
31+
</div>
3032
);
3133
}
3234
}

src/components/InfoBar/InfoBar.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
.infoBar {
2-
font-variant: italics;
3-
}
4-
51
.time {
62
margin: 0 30px;
73
}
4+
5+
.wrapper{
6+
font-style: italic;
7+
margin-top: 2em;
8+
}

src/components/Navigation/Navigation.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import PropTypes from 'prop-types';
44
import { Link } from 'react-router-dom';
55
import _ from 'lodash';
66

7-
import { Container, Icon, Image, Menu, Sidebar, Responsive } from 'semantic-ui-react';
7+
import { Icon, Image, Menu, Sidebar, Responsive } from 'semantic-ui-react';
88

99
const NavBarMobile = props => (
1010
<Sidebar.Pushable>
11-
<Sidebar as={Menu} animation="push" inverted visible={props.visible} width="tiny" style={{ height: '100vh' }}>
11+
<Sidebar as={Menu} animation="overlay" inverted visible={props.visible} width="wide" style={{ height: '100vh' }}>
12+
<Icon className={props.styles.closeIt} name="close" size="large" onClick={props.onToggle} />
1213
<Menu vertical inverted fluid>
1314
<Menu.Item>
1415
<Image size="mini" src="https://react.semantic-ui.com/logo.png" />
@@ -20,16 +21,14 @@ const NavBarMobile = props => (
2021
))}
2122
</Menu>
2223
</Sidebar>
23-
<Sidebar.Pusher dimmed={props.visible} onClick={props.onPusherClick} style={{ minHeight: '100vh' }}>
24+
<Sidebar.Pusher dimmed={props.visible} onClick={props.onPusherClick}>
2425
<Menu fixed="top" inverted>
2526
<Menu.Item onClick={props.onToggle}>
2627
<Icon name="sidebar" />
2728
</Menu.Item>
28-
{!props.visible && (
29-
<Menu.Item>
30-
<Image size="mini" src="https://react.semantic-ui.com/logo.png" />
31-
</Menu.Item>
32-
)}
29+
<Menu.Item>
30+
<Image size="mini" src="https://react.semantic-ui.com/logo.png" />
31+
</Menu.Item>
3332
<Menu.Menu position="right">
3433
{_.map(props.rightItems, item => (
3534
<Menu.Item as={Link} to={item.to} key={item.key}>
@@ -49,13 +48,15 @@ NavBarMobile.propTypes = {
4948
onPusherClick: PropTypes.func.isRequired,
5049
onToggle: PropTypes.func.isRequired,
5150
rightItems: PropTypes.arrayOf(PropTypes.object),
52-
visible: PropTypes.bool
51+
visible: PropTypes.bool,
52+
styles: PropTypes.objectOf(PropTypes.any)
5353
};
5454

5555
NavBarMobile.defaultProps = {
5656
leftItems: [],
5757
rightItems: [],
58-
visible: false
58+
visible: false,
59+
styles: {}
5960
};
6061

6162
const NavBarDesktop = ({ leftItems, rightItems }) => (
@@ -88,7 +89,7 @@ NavBarDesktop.defaultProps = {
8889
rightItems: []
8990
};
9091

91-
const NavBarChildren = ({ children }) => <Container style={{ marginTop: '6em' }}>{children}</Container>;
92+
const NavBarChildren = ({ children }) => <div style={{ margin: '6em auto 2em' }}>{children}</div>;
9293

9394
NavBarChildren.propTypes = {
9495
children: PropTypes.node.isRequired
@@ -116,6 +117,7 @@ export default class Navigation extends Component {
116117
render() {
117118
const { children, leftItems, rightItems } = this.props;
118119
const { visible } = this.state;
120+
const styles = require('./Navigation.scss');
119121

120122
return (
121123
<div style={{ flex: 1 }}>
@@ -126,6 +128,7 @@ export default class Navigation extends Component {
126128
onToggle={this.handleToggle}
127129
rightItems={rightItems}
128130
visible={visible}
131+
styles={styles}
129132
>
130133
<NavBarChildren>{children}</NavBarChildren>
131134
</NavBarMobile>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.closeIt{
2+
position: absolute;
3+
top: 1em;
4+
right: 1em;
5+
color: #fff;
6+
z-index: 9999;
7+
}

src/containers/App/App.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { push } from 'react-router-redux';
66
import { renderRoutes } from 'react-router-config';
77
import { provideHooks } from 'redial';
88
import Helmet from 'react-helmet';
9-
import { Message, Segment } from 'semantic-ui-react';
9+
import { Container, Message, Segment } from 'semantic-ui-react';
1010
import { isLoaded as isInfoLoaded, load as loadInfo } from 'redux/modules/info';
1111
import { isLoaded as isAuthLoaded, load as loadAuth, logout } from 'redux/modules/auth';
1212
import { Notifs, InfoBar } from 'components';
@@ -151,21 +151,20 @@ export default class App extends Component {
151151
<Helmet {...config.app.head} />
152152

153153
<Navigation leftItems={leftItems} rightItems={rightItems}>
154-
<div className={styles.appContent}>
154+
<Container>
155155
{notifs.global && (
156-
<div className="container">
157-
<Notifs
158-
className={styles.notifs}
159-
namespace="global"
160-
NotifComponent={props => <Message warning>{props.message}</Message>}
161-
/>
162-
</div>
156+
<Notifs
157+
className={styles.notifs}
158+
namespace="global"
159+
NotifComponent={props => <Message warning>{props.message}</Message>}
160+
/>
163161
)}
164162
{renderRoutes(route.routes)}
165163
<InfoBar />
166-
</div>
164+
</Container>
167165
</Navigation>
168-
<Segment textAlign="center" vertical inverted style={{ marginTop: '2em' }}>
166+
167+
<Segment textAlign="center" vertical inverted>
169168
<p>
170169
Have questions? Ask for help{' '}
171170
<a

src/containers/App/App.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
.appContent {
88
position: relative;
9+
flex: 1
910
}
1011

1112
.notifs {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
/*******************************
22
Site Overrides
33
*******************************/
4+
.pusher.dimmed{
5+
height: 100vh;
6+
}

0 commit comments

Comments
 (0)