This commit is contained in:
Simon Larsen 2023-07-17 19:47:14 +01:00
parent 4462ee9bc2
commit 687c1bbb67
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -9,7 +9,7 @@ import LoginUtil from '../Utils/Login';
import { JSONObject } from 'Common/Types/JSON';
import UserUtil from 'CommonUI/src/Utils/User';
import Navigation from 'CommonUI/src/Utils/Navigation';
import { BILLING_ENABLED, DASHBOARD_URL, IS_BILLING } from 'CommonUI/src/Config';
import { BILLING_ENABLED, DASHBOARD_URL } from 'CommonUI/src/Config';
import URL from 'Common/Types/API/URL';
import { SIGNUP_API_URL } from '../Utils/ApiPaths';
import Fields from 'CommonUI/src/Components/Forms/Types/Fields';
@ -21,7 +21,6 @@ const RegisterPage: FunctionComponent = () => {
Navigation.navigate(DASHBOARD_URL);
}
let formFields: Fields<User> = [
{
field: {
@ -40,62 +39,62 @@ const RegisterPage: FunctionComponent = () => {
placeholder: 'Jeff Smith',
required: true,
title: 'Full Name',
}];
},
];
if (BILLING_ENABLED) {
formFields = formFields.concat([{
field: {
companyName: true,
formFields = formFields.concat([
{
field: {
companyName: true,
},
fieldType: FormFieldSchemaType.Text,
placeholder: 'Acme, Inc.',
required: true,
title: 'Company Name',
},
fieldType: FormFieldSchemaType.Text,
placeholder: 'Acme, Inc.',
{
field: {
companyPhoneNumber: true,
},
fieldType: FormFieldSchemaType.Phone,
required: true,
placeholder: '+11234567890',
title: 'Phone Number',
},
]);
}
formFields = formFields.concat([
{
field: {
password: true,
},
fieldType: FormFieldSchemaType.Password,
validation: {
minLength: 6,
},
placeholder: 'Password',
title: 'Password',
required: true,
title: 'Company Name',
},
{
field: {
companyPhoneNumber: true,
confirmPassword: true,
} as any,
validation: {
minLength: 6,
toMatchField: 'password',
},
fieldType: FormFieldSchemaType.Phone,
fieldType: FormFieldSchemaType.Password,
placeholder: 'Confirm Password',
title: 'Confirm Password',
overideFieldKey: 'confirmPassword',
required: true,
placeholder: '+11234567890',
title: 'Phone Number',
}]);
}
formFields = formFields.concat([{
field: {
password: true,
forceShow: true,
},
fieldType: FormFieldSchemaType.Password,
validation: {
minLength: 6,
},
placeholder: 'Password',
title: 'Password',
required: true,
},
{
field: {
confirmPassword: true,
} as any,
validation: {
minLength: 6,
toMatchField: 'password',
},
fieldType: FormFieldSchemaType.Password,
placeholder: 'Confirm Password',
title: 'Confirm Password',
overideFieldKey: 'confirmPassword',
required: true,
forceShow: true,
},
]);
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">