From a67c93969ba8ac2b3dc43f450ce39c3ccb1be70c Mon Sep 17 00:00:00 2001 From: Matheus Date: Fri, 20 Sep 2024 12:11:23 -0300 Subject: [PATCH 1/2] refactor: remove border and fix the design to be the same as figma --- src/layouts/pages/PetVet/images/check.svg | 3 +++ src/layouts/pages/PetVet/index.js | 12 +++++++---- src/layouts/pages/PetVet/index.scss | 26 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 src/layouts/pages/PetVet/images/check.svg diff --git a/src/layouts/pages/PetVet/images/check.svg b/src/layouts/pages/PetVet/images/check.svg new file mode 100644 index 00000000..b2c1c369 --- /dev/null +++ b/src/layouts/pages/PetVet/images/check.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/layouts/pages/PetVet/index.js b/src/layouts/pages/PetVet/index.js index e9b2d28f..b3f52464 100644 --- a/src/layouts/pages/PetVet/index.js +++ b/src/layouts/pages/PetVet/index.js @@ -25,7 +25,7 @@ const html = `

O seu pet amigo foi castrado?

-
+
@@ -38,7 +38,7 @@ const html = `

Cuidados especiais

-
+
@@ -68,8 +68,8 @@ function getBooleanValue(value) { return value in radiosValue ? radiosValue[value] : false; } -function createAndMount({ name, text, mountTo, value }) { - const radio = new Radio({ name, text, value }); +function createAndMount({ name, text, mountTo, value, borderless }) { + const radio = new Radio({ name, text, value, borderless }); radio.selected .get('radio-button') .setAttribute('aria-label', `${getAriaLabel(name)}-${text.toLowerCase()}`); @@ -94,24 +94,28 @@ export default function PetVetPage({ vaccines = [] } = {}) { text: 'Não', mountTo: $specialCareRadio, value: 'notSpecialCare', + borderless: true, }); const specialCare = createAndMount({ name: 'specialCare', text: 'Sim', mountTo: $specialCareRadio, value: 'specialCare', + borderless: true, }); createAndMount({ name: 'neutered', text: 'Não', mountTo: $neuteredRadio, value: 'notNeutered', + borderless: true, }); createAndMount({ name: 'neutered', text: 'Sim', mountTo: $neuteredRadio, value: 'neutered', + borderless: true, }); this.specialCareText = new TextArea({ diff --git a/src/layouts/pages/PetVet/index.scss b/src/layouts/pages/PetVet/index.scss index 3b25cd52..227e4c1d 100644 --- a/src/layouts/pages/PetVet/index.scss +++ b/src/layouts/pages/PetVet/index.scss @@ -80,6 +80,32 @@ gap: 2rem; } + &__neutered-radio, + &__special-care-radio { + display: flex; + gap: 2.9rem; + + .radio-container { + &__input { + border-radius: 0.3rem; + + &:checked { + border-color: colors.$primary500; + background-color: colors.$primary500; + + background-image: url('./images/check.svg'); + background-position: center; + background-repeat: no-repeat; + background-size: 70% 70%; + } + + &:checked + .radio-container__dot { + color: colors.$gray800; + } + } + } + } + &__img { max-width: 5.4rem; max-height: 5.4rem; From 216bb93c65261d0375ce6c05e91323009b29668f Mon Sep 17 00:00:00 2001 From: Matheus Date: Fri, 20 Sep 2024 12:19:06 -0300 Subject: [PATCH 2/2] refactor: fix background color input and border --- src/layouts/pages/PetVet/index.scss | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/layouts/pages/PetVet/index.scss b/src/layouts/pages/PetVet/index.scss index 227e4c1d..591e42a1 100644 --- a/src/layouts/pages/PetVet/index.scss +++ b/src/layouts/pages/PetVet/index.scss @@ -90,12 +90,13 @@ border-radius: 0.3rem; &:checked { - border-color: colors.$primary500; - background-color: colors.$primary500; + border-color: colors.$primary200; + + background-color: colors.$primary200; background-image: url('./images/check.svg'); - background-position: center; background-repeat: no-repeat; + background-position: center; background-size: 70% 70%; }