diff --git a/package.json b/package.json index 09aa2a3..f2d69b8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "react": "^0.14.0", "react-dom": "^0.14.3", "react-helmet": "^2.3.1", - "react-intl": "^2.0.0-pr-3", + "react-intl": "^2.0.0-beta-2", "react-motion": "^0.3.1", "react-redux": "^4.0.0", "react-router": "^2.0.0-rc5", diff --git a/src/index.js b/src/index.js index 3eafa7e..d97cddf 100644 --- a/src/index.js +++ b/src/index.js @@ -22,6 +22,19 @@ import routes from 'routes'; import 'index.scss'; +// TODO: временная мера против Intl, который беспощадно спамит консоль +if (process.env.NODE_ENV !== 'production') { + const originalConsoleError = console.error; + if (console.error === originalConsoleError) { + console.error = (...args) => { + if (args[0].indexOf('[React Intl] Missing message:') === 0) { + return; + } + originalConsoleError.call(console, ...args); + }; + } +} + const reducer = combineReducers({ ...reducers, routing: routeReducer diff --git a/src/pages/auth/AuthPage.jsx b/src/pages/auth/AuthPage.jsx index 372042b..82aaa0d 100644 --- a/src/pages/auth/AuthPage.jsx +++ b/src/pages/auth/AuthPage.jsx @@ -82,6 +82,7 @@ class AuthPage extends Component { import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; +import ReactHeight from 'react-height'; import panelStyles from 'components/ui/panel.scss'; import buttons from 'components/ui/buttons.scss'; @@ -97,29 +98,30 @@ import passwordMessages from 'components/auth/Password.messages'; const opacitySpringConfig = [200, 20]; const heightSpringConfig = [200, 18]; const transformSpringConfig = [500, 20]; -const firstPageHeight = 70; -const secondPageHeight = 280; // TODO: сделать более быстрый фейд на горизонтальном скролле class TheDemo extends Component { state = { - isFirstPage: true + isFirstPage: true, + height: {} }; render() { var {isFirstPage} = this.state; + var path = `page${isFirstPage ? '1' : '2'}`; + return ( { var keys = Object.keys(items).filter((key) => key !== 'common'); return ( -
+
+ -
+ ) : ( -
+ @@ -222,10 +224,19 @@ class TheDemo extends Component { ) }} /> } /> -
+ )); } + updateHeight = (height) => { + this.setState({ + height: { + ...this.state.height, + [`page${this.state.isFirstPage ? '1' : '2'}`]: height + } + }); + }; + getFooter(key, props) { var {isFirstPage, opacitySpring} = props; diff --git a/webpack.config.js b/webpack.config.js index a5f545d..6c9baf0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -14,6 +14,7 @@ var iconfontImporter = require('./webpack/node-sass-iconfont-importer'); * TODO: dev tools https://github.com/freeqaz/redux-simple-router-example/blob/master/index.jsx * https://github.com/glenjamin/ultimate-hot-reloading-example ( обратить внимание на плагины babel ) * https://github.com/gajus/react-css-modules ( + BrowserSync) + * https://github.com/reactuate/reactuate * * Inspiration projects: * https://github.com/davezuko/react-redux-starter-kit