Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
	modified:   package.json
	modified:   src/app.js
	modified:   src/js/components/Avatar/index.js
	modified:   src/js/components/Loader/index.js
	modified:   src/js/components/MessageInput/Emoji/index.js
	modified:   src/js/components/MessageInput/Suggestion/index.js
	modified:   src/js/components/MessageInput/index.js
	modified:   src/js/components/Modal/index.js
	modified:   src/js/components/Offline/index.js
	modified:   src/js/components/Snackbar/index.js
	modified:   src/js/components/UserList/index.js
	modified:   src/js/pages/Footer/index.js
	modified:   src/js/pages/Layout.js
	modified:   src/js/routes.js
  • Loading branch information
trazyn committed Oct 30, 2017
1 parent d5d8a3f commit 14b86ce
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 71 deletions.
73 changes: 38 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dev": "concurrently --kill-others \"npm run hot-server\" \"npm run start-hot\""
},
"author": {
"email":"[email protected]"
"email": "[email protected]"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -55,7 +55,9 @@
"icon": "../resource",
"category": "Chat",
"target": [
"deb", "rpm", "AppImage"
"deb",
"rpm",
"AppImage"
]
},
"win": {
Expand All @@ -81,31 +83,32 @@
"dependencies": {
"@exponent/electron-cookies": "^2.0.0",
"auto-launch": "^5.0.1",
"axios": "^0.16.2",
"axios": "^0.17.0",
"classname": "^0.0.0",
"delegate": "^3.1.3",
"electron-context-menu": "^0.9.1",
"electron-json-storage": "^3.0.6",
"electron-json-storage": "^4.0.2",
"electron-window-state": "^4.1.1",
"han": "^0.0.7",
"mobx": "^3.1.16",
"mobx-react": "^4.2.1",
"moment": "^2.18.1",
"mobx": "^3.3.1",
"mobx-react": "^4.3.3",
"moment": "^2.19.1",
"play-sound": "^1.1.1",
"prop-types": "^15.6.0",
"randomcolor": "^0.5.3",
"react": "^15.6.1",
"react-addons-css-transition-group": "^15.6.0",
"react-dom": "^15.6.1",
"react-router": "2.8.1",
"react": "^16.0.0",
"react-addons-css-transition-group": "^15.6.2",
"react-dom": "^16.0.0",
"react-router-dom": "^4.2.2",
"tmp": "0.0.33"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.1",
"babel-minify-webpack-plugin": "^0.2.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-react-css-modules": "^3.0.0",
"babel-plugin-react-css-modules": "^3.3.2",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-polyfill": "^6.23.0",
Expand All @@ -116,39 +119,39 @@
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.24.1",
"concurrently": "^3.5.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^5.0.5",
"copy-webpack-plugin": "^4.2.0",
"cross-env": "^5.1.1",
"css-loader": "^0.28.4",
"electron": "^1.6.11",
"electron-builder": "^19.24.1",
"electron-updater": "^2.8.9",
"eslint": "^4.1.1",
"electron": "^1.7.9",
"electron-builder": "^19.42.2",
"electron-updater": "^2.15.0",
"eslint": "^4.10.0",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-react": "^5.0.0",
"eslint-formatter-pretty": "^1.1.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-import": "^2.6.1",
"eslint-plugin-node": "^5.1.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1",
"express": "^4.15.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"express": "^4.16.2",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.5",
"html-loader": "^0.5.1",
"html-webpack-plugin": "^2.30.1",
"json-loader": "^0.5.4",
"postcss-autoreset": "^2.0.0",
"postcss-cssnext": "^2.11.0",
"postcss-import": "^10.0.0",
"postcss-loader": "^2.0.6",
"postcss-modules": "^0.8.0",
"style-loader": "^0.18.2",
"stylelint": "^8.0.0",
"postcss-cssnext": "^3.0.2",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-modules": "^1.1.0",
"style-loader": "^0.19.0",
"stylelint": "^8.2.0",
"stylelint-config-standard": "^17.0.0",
"url-loader": "^0.5.9",
"webpack": "^3.0.0",
"url-loader": "^0.6.2",
"webpack": "^3.8.1",
"webpack-dev-middleware": "^1.11.0",
"webpack-hot-middleware": "^2.18.0"
"webpack-hot-middleware": "^2.20.0"
}
}
26 changes: 14 additions & 12 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { Component } from 'react';
import { render } from 'react-dom';
import { Provider } from 'mobx-react';
import { Router, hashHistory } from 'react-router';
import { HashRouter } from 'react-router-dom';
import ElectronCookies from '@exponent/electron-cookies';
import { ipcRenderer } from 'electron';

Expand All @@ -26,11 +26,13 @@ class App extends Component {
}

canisend() {
return this.refs.navigator.state.location.pathname === '/'
return this.refs.navigator.history.location.pathname === '/'
&& stores.chat.user;
}

componentDidMount() {
var navigator = this.refs.navigator;

// Hide the tray icon
ipcRenderer.on('hide-tray', () => {
stores.settings.setShowOnTray(false);
Expand All @@ -40,7 +42,7 @@ class App extends Component {
ipcRenderer.on('message-chatto', (event, args) => {
var user = stores.contacts.memberList.find(e => e.UserName === args.id);

this.refs.navigator.router.push('/');
navigator.history.push('/');
setTimeout(stores.chat.chatTo(user));
});

Expand All @@ -52,12 +54,12 @@ class App extends Component {

// Shwo the settings page
ipcRenderer.on('show-settings', () => {
this.refs.navigator.router.push('/settings');
navigator.history.push('/settings');
});

// Show a modal to create a new conversation
ipcRenderer.on('show-newchat', () => {
this.refs.navigator.router.push('/');
navigator.history.push('/');
stores.newchat.toggle(true);
});

Expand All @@ -70,15 +72,15 @@ class App extends Component {

// Search in currently conversation list
ipcRenderer.on('show-search', () => {
this.refs.navigator.router.push('/');
navigator.history.push('/');
stores.chat.toggleConversation(true);

setTimeout(() => document.querySelector('#search').focus());
});

// Show the home page
ipcRenderer.on('show-messages', () => {
this.refs.navigator.router.push('/');
navigator.history.push('/');
stores.chat.toggleConversation(true);
});

Expand All @@ -96,19 +98,19 @@ class App extends Component {

// Show contacts page
ipcRenderer.on('show-contacts', () => {
this.refs.navigator.router.push('/contacts');
navigator.history.push('/contacts');
});

// Go to next conversation
ipcRenderer.on('show-next', () => {
this.refs.navigator.router.push('/');
navigator.history.push('/');
stores.chat.toggleConversation(true);
setTimeout(stores.chat.chatToNext);
});

// Go to the previous conversation
ipcRenderer.on('show-previous', () => {
this.refs.navigator.router.push('/');
navigator.history.push('/');
stores.chat.toggleConversation(true);
setTimeout(stores.chat.chatToPrev);
});
Expand All @@ -132,9 +134,9 @@ class App extends Component {
render() {
return (
<Provider {...stores}>
<Router history={hashHistory} ref="navigator">
<HashRouter ref="navigator">
{getRoutes()}
</Router>
</HashRouter>
</Provider>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/js/components/Avatar/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import './style.global.css';

Expand Down
3 changes: 2 additions & 1 deletion src/js/components/Loader/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Transition from 'react-addons-css-transition-group';
import clazz from 'classname';

Expand Down
3 changes: 2 additions & 1 deletion src/js/components/MessageInput/Emoji/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import clazz from 'classname';
import delegate from 'delegate';

Expand Down
3 changes: 2 additions & 1 deletion src/js/components/MessageInput/Suggestion/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import clazz from 'classname';

import './style.global.css';
Expand Down
3 changes: 2 additions & 1 deletion src/js/components/MessageInput/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ipcRenderer } from 'electron';
import clazz from 'classname';

Expand Down
3 changes: 2 additions & 1 deletion src/js/components/Modal/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Transition from 'react-addons-css-transition-group';
import clazz from 'classname';

Expand Down
3 changes: 2 additions & 1 deletion src/js/components/Offline/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import classes from './style.css';

Expand Down
3 changes: 2 additions & 1 deletion src/js/components/Snackbar/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import './style.global.css';
import TransitionPortal from '../TransitionPortal';
Expand Down
3 changes: 2 additions & 1 deletion src/js/components/UserList/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import clazz from 'classname';

import classes from './style.css';
Expand Down
15 changes: 11 additions & 4 deletions src/js/pages/Footer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import React, { Component } from 'react';
import { Link } from 'react-router';
import { Link } from 'react-router-dom';
import clazz from 'classname';

import classes from './style.css';
import Home from './Home';
Expand All @@ -20,19 +21,25 @@ export default class Footer extends Component {
<footer className={classes.footer}>
<nav>
<Link className="link" to="/" tabIndex="-1">
<span className={pathname === '/' && classes.active}>
<span className={clazz({
[classes.active]: pathname === '/'
})}>
<i className="icon-ion-android-chat" />
</span>
</Link>

<Link className="link" to="/contacts" tabIndex="-1">
<span className={pathname === '/contacts' && classes.active}>
<span className={clazz({
[classes.active]: pathname === '/contacts'
})}>
<i className="icon-ion-ios-book-outline" />
</span>
</Link>

<Link className="link" to="/settings" tabIndex="-1">
<span className={pathname === '/settings' && classes.active}>
<span className={clazz({
[classes.active]: pathname === '/settings'
})}>
<i className="icon-ion-android-more-vertical" />
</span>
</Link>
Expand Down
16 changes: 9 additions & 7 deletions src/js/pages/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ export default class Layout extends Component {
}

render() {
var { isLogin, loading, show, close, message, location } = this.props;

if (!window.navigator.onLine) {
return (
<Offline show={true} style={{
Expand All @@ -143,7 +145,7 @@ export default class Layout extends Component {
);
}

if (!this.props.isLogin()) {
if (!isLogin()) {
return <Login />;
}

Expand All @@ -152,16 +154,16 @@ export default class Layout extends Component {
return (
<div>
<Snackbar
close={this.props.close}
show={this.props.show}
text={this.props.message} />
close={close}
show={show}
text={message} />

<Loader show={this.props.loading} />
<Header location={this.props.location} />
<Loader show={loading} />
<Header location={location} />
<div className={classes.container} ref="viewport">
{this.props.children}
</div>
<Footer location={this.props.location} ref="footer" />
<Footer location={location} ref="footer" />
<UserInfo />
<AddFriend />
<NewChat />
Expand Down
Loading

0 comments on commit 14b86ce

Please sign in to comment.