Skip to content

Commit

Permalink
feat: remove 'Company' label in setup wizard form
Browse files Browse the repository at this point in the history
Email label title and placeholder change
  • Loading branch information
guijun13 committed Apr 20, 2022
1 parent 287524c commit a20b52b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
6 changes: 3 additions & 3 deletions packages/onboarding-ui/.i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
"label": "Username",
"placeholder": "@username"
},
"companyEmail": {
"label": "Company email",
"placeholder": "Company email"
"email": {
"label": "Email",
"placeholder": "Email"
},
"password": {
"label": "Password",
Expand Down
20 changes: 8 additions & 12 deletions packages/onboarding-ui/src/forms/AdminInfoForm/AdminInfoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Form from '../../common/Form';
export type AdminInfoPayload = {
fullname: string;
username: string;
companyEmail: string;
email: string;
password: string;
keepPosted?: boolean;
};
Expand Down Expand Up @@ -53,7 +53,7 @@ const AdminInfoForm = ({

const fullnameField = useUniqueId();
const usernameField = useUniqueId(); // lgtm [js/insecure-randomness]
const companyEmailField = useUniqueId();
const emailField = useUniqueId();
const passwordField = useUniqueId(); // lgtm [js/insecure-randomness]

const {
Expand Down Expand Up @@ -119,24 +119,20 @@ const AdminInfoForm = ({
)}
</Field>
<Field>
<Field.Label htmlFor={companyEmailField}>
{t('form.adminInfoForm.fields.companyEmail.label')}
<Field.Label htmlFor={emailField}>
{t('form.adminInfoForm.fields.email.label')}
</Field.Label>
<Field.Row>
<EmailInput
{...register('companyEmail', {
{...register('email', {
required: String(t('component.form.requiredField')),
validate: validateEmail,
})}
placeholder={t(
'form.adminInfoForm.fields.companyEmail.placeholder'
)}
id={companyEmailField}
placeholder={t('form.adminInfoForm.fields.email.placeholder')}
id={emailField}
/>
</Field.Row>
{errors.companyEmail && (
<Field.Error>{errors.companyEmail.message}</Field.Error>
)}
{errors.email && <Field.Error>{errors.email.message}</Field.Error>}
</Field>
<Field>
<Field.Label htmlFor={passwordField}>
Expand Down

0 comments on commit a20b52b

Please sign in to comment.