More refactoring

This commit is contained in:
Chi Vinh Le
2018-02-09 23:18:21 +01:00
parent f4fc8915e3
commit 4b6a3b5b9d
17 changed files with 352 additions and 28 deletions
@@ -1,13 +1,26 @@
import React from 'react';
import { Dialog } from 'plugin-api/beta/client/components/ui';
import styles from './Main.css';
import PropTypes from 'prop-types';
import SignIn from '../containers/SignIn';
import ForgotPassword from '../containers/ForgotPassword';
import * as views from '../enums/views';
const SignDialog = () => (
const Main = ({ view, onResetView }) => (
<Dialog className={styles.dialog} id="signInDialog" open={true}>
<SignIn />
{view !== views.SIGN_IN && (
<span className={styles.close} onClick={onResetView}>
×
</span>
)}
{view === views.SIGN_IN && <SignIn />}
{view === views.FORGOT_PASSWORD && <ForgotPassword />}
</Dialog>
);
export default SignDialog;
Main.propTypes = {
view: PropTypes.string.isRequired,
onResetView: PropTypes.func.isRequired,
};
export default Main;