import React, { Component } from 'react';
import { connect } from 'react-redux';
import { TransitionMotion, spring } from 'react-motion';
import AppInfo from 'components/auth/AppInfo';
import styles from './auth.scss';
const springConfig = [200, 20];
class AuthPage extends Component {
displayName = 'AuthPage';
render() {
var appInfo = {
name: 'TLauncher',
description: `Лучший альтернативный лаунчер для Minecraft с большим количеством версий и их модификаций, а также возмоностью входа как с лицензионным аккаунтом, так и без него.`
};
var { path, children } = this.props;
return (
{(items) => (
{Object.keys(items).map((path) => {
const {children, x} = items[path];
const style = {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
transform: `translateX(${x}%)`
};
return (
{children}
);
})}
)}
);
}
willEnter(key, styles) {
return {
...styles,
x: spring(100, springConfig)
};
}
willLeave(key, styles) {
return {
...styles,
x: spring(-100, springConfig)
};
}
}
import { FormattedMessage as Message } from 'react-intl';
import Helmet from 'react-helmet';
import panelStyles from 'components/ui/panel.scss';
import buttons from 'components/ui/buttons.scss';
import icons from 'components/ui/icons.scss';
import { Panel, PanelBody, PanelFooter, PanelHeader } from 'components/ui/Panel';
import { Input, Checkbox } from 'components/ui/Form';
import messages from 'components/auth/Login.messages';
import regMessages from 'components/auth/Register.messages';
import {helpLinks as helpLinksStyles} from 'components/auth/helpLinks.scss';
import passwordMessages from 'components/auth/Password.messages';
const opacitySpringConfig = [60, 15];
const heightSpringConfig = springConfig;
const transformSpringConfig = [400, 15];
const firstPageHeight = 70;
const secondPageHeight = 280;
class TheDemo extends Component {
state = {
isFirstPage: true
};
render() {
var {isFirstPage} = this.state;
return (
{(items) => {
var keys = Object.keys(items).filter((key) => key !== 'common');
return (
{keys.map((key) => this.getHeader(key, items[key]))}
{keys.map((key) => this.getBody(key, items[key]))}
{keys.map((key) => this.getFooter(key, items[key]))}
{keys.map((key) => this.getLinks(key, items[key]))}
);
}}
);
}
willEnter = (key, styles) => {
var sign = this.state.isFirstPage ? -1 : 1;
return {
...styles,
transformSpring: spring(sign * 100, transformSpringConfig),
opacitySpring: spring(1, opacitySpringConfig)
};
};
willLeave = (key, styles) => {
var sign = this.state.isFirstPage ? -1 : 1;
return {
...styles,
transformSpring: spring(sign * -100, transformSpringConfig),
opacitySpring: spring(0, opacitySpringConfig)
};
};
getBody(key, props) {
var {isFirstPage, transformSpring, opacitySpring} = props;
var style = {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
transform: `translateX(${transformSpring}%)`,
opacity: opacitySpring
};
return (isFirstPage ? (
) : (
)
}} />
} />
));
}
getFooter(key, props) {
var {isFirstPage, opacitySpring} = props;
var style = {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
opacity: opacitySpring
};
return (isFirstPage ? (
) : (
));
}
getHeader(key, props) {
var {isFirstPage, transformSpring} = props;
var style = {
position: 'absolute',
top: 0,
left: 0,
width: '100%'
};
var scrollStyle = {
transform: `translateY(${transformSpring}%)`
};
var sideScrollStyle = {
position: 'relative',
zIndex: 2,
transform: `translateX(${-Math.abs(transformSpring)}%)`
};
return (isFirstPage ? (
) : (
));
}
getLinks(key, props) {
var {isFirstPage, opacitySpring} = props;
var style = {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
opacity: opacitySpring
};
return (isFirstPage ? (
) : (
));
}
onSwitchViews = (event) => {
event.preventDefault();
this.setState({
isFirstPage: !this.state.isFirstPage
});
};
}
export default connect((state) => ({
path: state.routing.location.pathname
}))(AuthPage);