Skip to content

Commit

Permalink
Fix reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchoeler committed Jul 11, 2023
1 parent eb0ab60 commit 7f4b2fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export default {

export const Default: Story<ComponentProps<typeof Form>> = (args) => {
const {
// register,
handleSubmit,
// watch,
formState: { errors },
control,
reset,
Expand Down
14 changes: 5 additions & 9 deletions packages/livechat/src/routes/Register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ type department = {
[key: string]: unknown;
};

// Custom field as in the form payload
type FormPayloadCustomField = { [key: string]: string };

type ContextReturn = {
config: {
departments?: department[];
Expand Down Expand Up @@ -112,7 +115,7 @@ export const Register = ({ screenProps }: { screenProps: { [key: string]: unknow
name: string;
email: string;
department: string;
customFields: { [key: string]: string };
customFields: FormPayloadCustomField;
}) => {
const fields = {
name,
Expand Down Expand Up @@ -199,7 +202,6 @@ export const Register = ({ screenProps }: { screenProps: { [key: string]: unknow
placeholder={t('insert_your_field_here', { field: t('name') })}
disabled={loading}
field={field}
// onInput={(target: HTMLInputElement) => setName(target.value)}
/>
)}
/>
Expand Down Expand Up @@ -256,13 +258,7 @@ export const Register = ({ screenProps }: { screenProps: { [key: string]: unknow
</Screen.Content>
</div>
<Screen.Footer>
<Button
loading={loading}
form='register'
submit
full
disabled={!isDirty || !isValid || loading || isSubmitting || Object.keys(errors).length > 0}
>
<Button loading={loading} form='register' submit full disabled={!isDirty || !isValid || loading || isSubmitting}>
{t('start_chat')}
</Button>
</Screen.Footer>
Expand Down

0 comments on commit 7f4b2fa

Please sign in to comment.