feat: fix register page layout.

This commit is contained in:
Ahmed Bouhuolia
2020-10-10 15:05:18 +02:00
parent 31a267a560
commit b8060010d6
18 changed files with 315 additions and 290 deletions

View File

@@ -0,0 +1,8 @@
const CLASSES = {
DATATABLE_EDITOR: 'DATATABLE_EDITOR'
};
export {
CLASSES,
}

View File

View File

@@ -9,6 +9,7 @@ import PrivateRoute from 'components/PrivateRoute';
import Authentication from 'components/Authentication'; import Authentication from 'components/Authentication';
import Dashboard from 'components/Dashboard/Dashboard'; import Dashboard from 'components/Dashboard/Dashboard';
import GlobalErrors from 'containers/GlobalErrors/GlobalErrors'; import GlobalErrors from 'containers/GlobalErrors/GlobalErrors';
import RegisterWizardPage from 'containers/Authentication/Register/RegisterPage';
import messages from 'lang/en'; import messages from 'lang/en';
import 'style/App.scss'; import 'style/App.scss';
@@ -31,6 +32,10 @@ function App({ locale }) {
<Authentication /> <Authentication />
</Route> </Route>
<Route path={'/register'}>
<RegisterWizardPage />
</Route>
<Route path={'/'}> <Route path={'/'}>
<PrivateRoute component={Dashboard} /> <PrivateRoute component={Dashboard} />
</Route> </Route>

View File

@@ -10,10 +10,10 @@ export default function AuthInsider({
return ( return (
<div class="authentication-insider"> <div class="authentication-insider">
<div className={'authentication-insider__logo-section'}> <div className={'authentication-insider__logo-section'}>
{/* <Icon icon="bigcapital" height={37} width={214} /> */} <Icon icon="bigcapital" height={37} width={214} />
</div> </div>
<div class="authentication-insider__content">{children}</div> <div class="authentication-insider__content">{ children }</div>
<div class="authentication-insider__footer"> <div class="authentication-insider__footer">
<AuthCopyright /> <AuthCopyright />

View File

@@ -103,7 +103,7 @@ function Login({
<div className={'authentication-page__label-section'}> <div className={'authentication-page__label-section'}>
<h3><T id={'log_in'} /></h3> <h3><T id={'log_in'} /></h3>
<T id={'need_bigcapital_account'} /> <T id={'need_bigcapital_account'} />
<Link to='/auth/register'> <T id={'create_an_account'} /></Link> <Link to='/register'> <T id={'create_an_account'} /></Link>
</div> </div>
<form onSubmit={handleSubmit} className={'authentication-page__form'}> <form onSubmit={handleSubmit} className={'authentication-page__form'}>

View File

@@ -0,0 +1,57 @@
import React, { useState } from 'react';
import { Icon } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function RegisterLeftSection({
}) {
const [org] = useState('LibyanSpider');
return (
<section className={'register-page__left-section'}>
<div className={'content'}>
<div className={'content-logo'}>
<Icon
icon={'bigcapital'}
width={165}
height={28}
className="bigcapital--alt"
/>
</div>
<h1 className={'content-title'}>
<T id={'register_a_new_organization_now'} />
</h1>
<p className={'content-text'}>
<T id={'you_have_a_bigcapital_account'} />
</p>
<div className={'content-org'}>
<span>
<T id={'welcome'} />
{org},
</span>
<span>
<a href={'#!'}>
<T id={'sign_out'} />
</a>
</span>
</div>
<div className={'content-contact'}>
<a href={'#!'}>
<p>
<T id={'we_re_here_to_help'} /> {'+21892-791-8381'}
</p>
</a>
<a href={'#!'}>
<p>
<T id={'contact_us_technical_support'} />
</p>
</a>
</div>
</div>
</section>
)
}

View File

@@ -21,7 +21,7 @@ import AppToaster from 'components/AppToaster';
import { ListSelect, ErrorMessage, FieldRequiredHint } from 'components'; import { ListSelect, ErrorMessage, FieldRequiredHint } from 'components';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import withSettingsActions from 'containers/Settings/withSettingsActions'; import withSettingsActions from 'containers/Settings/withSettingsActions';
import withRegisterOrganizationActions from './withRegisterOrganizationActions'; import withRegisterOrganizationActions from 'containers/Authentication/withRegisterOrganizationActions';
import { compose, optionsMapToArray } from 'utils'; import { compose, optionsMapToArray } from 'utils';
function RegisterOrganizationForm({ requestSubmitOptions, requestSeedTenant }) { function RegisterOrganizationForm({ requestSubmitOptions, requestSeedTenant }) {

View File

@@ -0,0 +1,14 @@
import React from 'react';
import RegisterRightSection from './RegisterRightSection';
import RegisterLeftSection from './RegisterLeftSection';
function RegisterWizardPage() {
return (
<div class="register-page">
<RegisterLeftSection />
<RegisterRightSection />
</div>
);
}
export default RegisterWizardPage;

View File

@@ -0,0 +1,26 @@
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import RegisterWizardSteps from './RegisterWizardSteps';
import registerRoutes from 'routes/register';
export default function RegisterRightSection () {
return (
<section className={'register-page__right-section'}>
<RegisterWizardSteps />
<div class="register-page-form">
<Switch>
{ registerRoutes.map((route, index) => (
<Route
exact={route.exact}
key={index}
path={`${route.path}`}
component={route.component}
/>
)) }
</Switch>
</div>
</section>
)
}

View File

@@ -17,12 +17,11 @@ import AppToaster from 'components/AppToaster';
import ErrorMessage from 'components/ErrorMessage'; import ErrorMessage from 'components/ErrorMessage';
import Icon from 'components/Icon'; import Icon from 'components/Icon';
import { If } from 'components'; import { If } from 'components';
import AuthInsider from 'containers/Authentication/AuthInsider'; import withAuthenticationActions from 'containers/Authentication/withAuthenticationActions';
import withAuthenticationActions from './withAuthenticationActions';
import { compose } from 'utils'; import { compose } from 'utils';
function Register({ requestRegister, requestLogin }) { function RegisterUserForm({ requestRegister, requestLogin }) {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const history = useHistory(); const history = useHistory();
const [shown, setShown] = useState(false); const [shown, setShown] = useState(false);
@@ -146,7 +145,6 @@ function Register({ requestRegister, requestLogin }) {
); );
return ( return (
<AuthInsider>
<div className={'register-form'}> <div className={'register-form'}>
<div className={'authentication-page__label-section'}> <div className={'authentication-page__label-section'}>
<h3> <h3>
@@ -283,8 +281,7 @@ function Register({ requestRegister, requestLogin }) {
</div> </div>
</If> </If>
</div> </div>
</AuthInsider>
); );
} }
export default compose(withAuthenticationActions)(Register); export default compose(withAuthenticationActions)(RegisterUserForm);

View File

@@ -3,7 +3,7 @@ import { FormattedMessage as T, useIntl } from 'react-intl';
function RegisterWizardSteps() { function RegisterWizardSteps() {
return ( return (
<div> <div className={'register-wizard-steps'}>
<div className={'wizard-container'}> <div className={'wizard-container'}>
<ul className={'wizard-wrapper'}> <ul className={'wizard-wrapper'}>
<li> <li>

View File

@@ -1,75 +0,0 @@
import React, { useState } from 'react';
import Icon from 'components/Icon';
import { FormattedMessage as T, useIntl } from 'react-intl';
import RegisterWizardSteps from './RegisterWizardSteps';
import RegisterOrganizationForm from './RegisterOrganizationForm';
import Register from './Register';
import Login from './Login';
import RegisterSubscriptionForm from './RegisterSubscriptionForm';
function RegisterLeftSidebar() {
const { formatMessage } = useIntl();
const [org] = useState('LibyanSpider');
console.log(org, 'EE');
return (
<div>
<section>
<div className={'wizard-left-side'}>
<div className={'content'}>
<div className={'content-logo'}>
<Icon
icon={'bigcapital'}
width={165}
height={28}
className="bigcapital--alt"
/>
</div>
<h1 className={'content-title'}>
<T id={'register_a_new_organization_now'} />
</h1>
<p className={'content-text'}>
<T id={'you_have_a_bigcapital_account'} />
</p>
<div className={'content-org'}>
<span>
<T id={'welcome'} />
{org},
</span>
<span>
<a href={'#!'}>
<T id={'sign_out'} />
</a>
</span>
</div>
<div className={'content-contact'}>
<a href={'#!'}>
<p>
<T id={'we_re_here_to_help'} /> {'+21892-791-8381'}
</p>
</a>
<a href={'#!'}>
<p>
<T id={'contact_us_technical_support'} />
</p>
</a>
</div>
</div>
</div>
</section>
<section>
<div className={'wizard-right-side'}>
{/* <RegisterWizardSteps /> */}
{/* <Register /> */}
{/* <Login/> */}
<RegisterOrganizationForm />
{/* <RegisterSubscriptionForm /> */}
</div>
</section>
</div>
);
}
export default RegisterLeftSidebar;

View File

@@ -1,17 +0,0 @@
import React from 'react';
import { Redirect, Route, Switch, Link } from 'react-router-dom';
import RegisterLeftSidebar from './RegisterLeftSidebar';
function RegisterWizardPage() {
return (
<>
<Switch>
<div>
<RegisterLeftSidebar />
</div>
</Switch>
</>
);
}
export default RegisterWizardPage;

View File

@@ -3,7 +3,7 @@ import { omit } from 'lodash';
import { Button, Intent, Position, Tooltip } from '@blueprintjs/core'; import { Button, Intent, Position, Tooltip } from '@blueprintjs/core';
import { FormattedMessage as T, useIntl } from 'react-intl'; import { FormattedMessage as T, useIntl } from 'react-intl';
import CLASSES from 'components/classes'; import { CLASSES } from 'common/classes';
import DataTable from 'components/DataTable'; import DataTable from 'components/DataTable';
import Icon from 'components/Icon'; import Icon from 'components/Icon';
import { import {

View File

@@ -9,12 +9,6 @@ export default [
loader: () => import('containers/Authentication/Login'), loader: () => import('containers/Authentication/Login'),
}), }),
}, },
{
path: `${BASE_URL}/register`,
component: LazyLoader({
loader: () => import('containers/Authentication/Register'),
}),
},
{ {
path: `${BASE_URL}/send_reset_password`, path: `${BASE_URL}/send_reset_password`,
component: LazyLoader({ component: LazyLoader({
@@ -32,11 +26,5 @@ export default [
component: LazyLoader({ component: LazyLoader({
loader: () => import('containers/Authentication/InviteAccept'), loader: () => import('containers/Authentication/InviteAccept'),
}), }),
}, }
{
path: `${BASE_URL}/wizard`,
component: LazyLoader({
loader: () => import('containers/Authentication/RegisterWizardPage'),
}),
},
]; ];

View File

@@ -0,0 +1,23 @@
import LazyLoader from 'components/LazyLoader';
export default [
{
path: '/register/subscription',
component: LazyLoader({
loader: () => import('containers/Authentication/Register/RegisterSubscriptionForm'),
}),
},
{
path: '/register/organization',
component: LazyLoader({
loader: () => import('containers/Authentication/Register/RegisterOrganizationForm'),
}),
},
{
path: `/`,
component: LazyLoader({
loader: () => import('containers/Authentication/Register/RegisterUserForm'),
}),
},
];

View File

@@ -1,11 +1,11 @@
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
// Register Left Sidebar .register-page {
.wizard-left-side {
&__right-section {
padding-left: 25%;
}
&__left-section{
position: fixed; position: fixed;
background: #778cab; background: #778cab;
overflow: auto; overflow: auto;
@@ -57,10 +57,9 @@
} }
} }
} }
}
} }
.wizard-right-side {
padding-left: 25%;
}
// Register Wizard Steps // Register Wizard Steps
.wizard-container { .wizard-container {