Skip to content

Commit

Permalink
add extra slot in AtomCheckbox
Browse files Browse the repository at this point in the history
  • Loading branch information
arrogant-ant committed Sep 26, 2024
1 parent e0b845b commit 6606c8c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
6 changes: 4 additions & 2 deletions src/components/atoms/AtomCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
type="box-color"
>
{{ value }}
<slot name="extra"></slot>
</b-checkbox>
</div>
</template>
Expand Down Expand Up @@ -42,8 +43,9 @@ export default {
</script>

<style>
.block .b-checkbox.checkbox input[type=checkbox]:checked + .check.box-color {
background: var(--primary-color) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'%3E%3Cpath d='M.04.627L.146.52.43.804.323.91zm.177.177L.854.167.96.273.323.91z' fill='rgba(0,0,0,.7)'/%3E%3C/svg%3E");
.block .b-checkbox.checkbox input[type='checkbox']:checked + .check.box-color {
background: var(--primary-color)
url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'%3E%3Cpath d='M.04.627L.146.52.43.804.323.91zm.177.177L.854.167.96.273.323.91z' fill='rgba(0,0,0,.7)'/%3E%3C/svg%3E");
border-color: var(--primary-color);
}
</style>
7 changes: 5 additions & 2 deletions src/components/molecules/MoleculeCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
@change.native="handleChange"
:values="values"
class="mb-5"
></AtomCheckbox>
<slot name="extra"></slot>
>
<template slot="extra">
<slot name="extra"></slot>
</template>
</AtomCheckbox>
<span class="has-text-danger is-size-7">{{ errors[0] }}</span>
</ValidationProvider>
</template>
Expand Down
20 changes: 6 additions & 14 deletions src/components/organisms/OrganismPreferenceForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@
@data="updateTermsData"
>
<template v-slot:extra>
<p class="custom-terms">
<a
href="https://www.parkspot.in/terms-and-conditions"
target="_blank"
>T&C</a
>
</p>
<a
href="https://www.parkspot.in/terms-and-conditions"
target="_blank"
>T&C
</a>
</template>
</MoleculeCheckbox>
</ValidationObserver>
Expand Down Expand Up @@ -122,10 +120,4 @@ export default {
},
};
</script>
<style lang="scss" scoped>
.custom-terms {
position: absolute;
top: -2px;
left: 111px;
}
</style>
<style lang="scss" scoped></style>

0 comments on commit 6606c8c

Please sign in to comment.