mirror of
https://github.com/wassname/talk.git
synced 2026-09-13 13:10:43 +08:00
More refactoring
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user