From a1f345a9b25b3a704bead4a6294aa10c7423787c Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Mon, 28 Oct 2024 19:49:26 -0300 Subject: [PATCH 1/4] feat(webpage): add phone field to pressure form --- .../plugins/Pressure/components/Form/index.tsx | 12 ++++++++++++ .../src/initialI18nStore/locales/pt-br.ts | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx index 1c55ec800..a0a3d4daa 100644 --- a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx +++ b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx @@ -29,6 +29,7 @@ type Props = { settings: { main_color: string; show_city?: string; + show_phone?: string; button_text: string; pressure_subject?: string; pressure_body?: string; @@ -67,6 +68,7 @@ const PressureForm = ({ settings: { show_city: showCity, show_state: showState, + show_phone: showPhone, main_color: buttonColor, button_text: buttonText, is_subject_list: isSubjectList = 'n', @@ -210,6 +212,16 @@ const PressureForm = ({ /> )} + {showPhone && showPhone == 's' && ( + + + + )} {AfterStandardFields && } {errors.length >= 1 && ( diff --git a/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts b/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts index a743187af..454283a6d 100644 --- a/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts +++ b/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts @@ -21,6 +21,8 @@ export default { "Pressure City Label": "Cidade", "Pressure City Placeholder": "Insira sua cidade", "Pressure State Label": "Estado", + "Pressure Phone Label": "Whatsapp", + "Pressure Phone Placeholder": "(DDD) X XXXX-XXXX", "Pressure Email Label": "E-mail", "Pressure Email Placeholder": "Insira seu e-mail", "Pressure Subject Label": "Assunto", @@ -32,5 +34,5 @@ export default { "Pressure Network Failed": "Houve um erro ao fazer a pressão", "Pressure TargetBlank Validation": "Ops, você precisa selecionar pelo menos um alvo para poder pressionar", "Political Filename": "politica-de-privacidade", - "Share Social Midia": "Compartilhar no {{app}}" + "Share Social Midia": "Compartilhar no {{app}}", } \ No newline at end of file From 9f3832c362632edae9a9c5a9824d2e4dfeae6976 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Tue, 29 Oct 2024 15:00:45 -0300 Subject: [PATCH 2/4] fix(webpage): change order pressure form fields --- .../Pressure/components/Form/index.tsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx index a0a3d4daa..dcb807c30 100644 --- a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx +++ b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx @@ -147,7 +147,6 @@ const PressureForm = ({ )} - {BeforeStandardFields && } + {BeforeStandardFields && } + {showPhone && showPhone == 's' && ( + + + + )} {showState && showState === 's' && ( )} - {showPhone && showPhone == 's' && ( - - - - )} {AfterStandardFields && } {errors.length >= 1 && ( From 702ca0047ecf02df083929cff7412ae62848d1a1 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Tue, 29 Oct 2024 15:18:25 -0300 Subject: [PATCH 3/4] fix(webpage): remove required validation to phone in pressure form --- .../Pressure/components/Form/index.tsx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx index dcb807c30..38106aefd 100644 --- a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx +++ b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx @@ -147,6 +147,16 @@ const PressureForm = ({ )} + {BeforeStandardFields && } + {showPhone && showPhone == 's' && ( + + + + )} - {BeforeStandardFields && } - {showPhone && showPhone == 's' && ( - - - - )} {showState && showState === 's' && ( Date: Tue, 29 Oct 2024 15:35:42 -0300 Subject: [PATCH 4/4] feat(webpage): add mask to phone field in pressure form --- .../bonde-webpage/plugins/Pressure/components/Form/index.tsx | 1 + .../webpage-client/src/initialI18nStore/locales/pt-br.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx index 38106aefd..9a1ea1abd 100644 --- a/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx +++ b/clients/packages/webpage-client/src/bonde-webpage/plugins/Pressure/components/Form/index.tsx @@ -154,6 +154,7 @@ const PressureForm = ({ label={t('Pressure Phone Label')} name="phone" placeholder={t('Pressure Phone Placeholder')} + mask="+55 (99) 9 9999-9999" /> )} diff --git a/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts b/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts index 454283a6d..e29361dd4 100644 --- a/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts +++ b/clients/packages/webpage-client/src/initialI18nStore/locales/pt-br.ts @@ -22,7 +22,7 @@ export default { "Pressure City Placeholder": "Insira sua cidade", "Pressure State Label": "Estado", "Pressure Phone Label": "Whatsapp", - "Pressure Phone Placeholder": "(DDD) X XXXX-XXXX", + "Pressure Phone Placeholder": "Insira seu número com DDD", "Pressure Email Label": "E-mail", "Pressure Email Placeholder": "Insira seu e-mail", "Pressure Subject Label": "Assunto",