Skip to content

Commit

Permalink
refactor: remove border and fix the design to be the same as figma (#308
Browse files Browse the repository at this point in the history
)

* refactor: remove border and fix the design to be the same as figma

* refactor: fix background color input and border
  • Loading branch information
Mathh19 authored Sep 25, 2024
1 parent 9398e3b commit 7534a42
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/layouts/pages/PetVet/images/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions src/layouts/pages/PetVet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const html = `
<div class="petvet-page__card-content">
<p>O seu pet amigo foi castrado?</p>
<form>
<fieldset data-select="neutered-radio"></fieldset>
<fieldset data-select="neutered-radio" class="petvet-page__neutered-radio"></fieldset>
</form>
</div>
</div>
Expand All @@ -38,7 +38,7 @@ const html = `
<div class="petvet-page__card-content">
<p>Cuidados especiais</p>
<form>
<fieldset data-select="special-care-radio"></fieldset>
<fieldset data-select="special-care-radio" class="petvet-page__special-care-radio"></fieldset>
</form>
</div>
</div>
Expand Down Expand Up @@ -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()}`);
Expand All @@ -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({
Expand Down
27 changes: 27 additions & 0 deletions src/layouts/pages/PetVet/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,33 @@
gap: 2rem;
}

&__neutered-radio,
&__special-care-radio {
display: flex;
gap: 2.9rem;

.radio-container {
&__input {
border-radius: 0.3rem;

&:checked {
border-color: colors.$primary200;

background-color: colors.$primary200;

background-image: url('./images/check.svg');
background-repeat: no-repeat;
background-position: center;
background-size: 70% 70%;
}

&:checked + .radio-container__dot {
color: colors.$gray800;
}
}
}
}

&__img {
max-width: 5.4rem;
max-height: 5.4rem;
Expand Down

0 comments on commit 7534a42

Please sign in to comment.