mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
refactor CategoriesSelect template
This commit is contained in:
parent
1d435392ff
commit
41ef496d6b
@ -1,22 +1,18 @@
|
||||
<template>
|
||||
<div>
|
||||
<ds-flex :gutter="{ base: 'xx-small', md: 'small', lg: 'xx-small' }">
|
||||
<div v-for="category in categories" :key="category.id">
|
||||
<ds-flex-item>
|
||||
<base-button
|
||||
:data-test="categoryButtonsId(category.id)"
|
||||
@click="toggleCategory(category.id)"
|
||||
:filled="isActive(category.id)"
|
||||
:disabled="isDisabled(category.id)"
|
||||
:icon="category.icon"
|
||||
size="small"
|
||||
>
|
||||
{{ $t(`contribution.category.name.${category.slug}`) }}
|
||||
</base-button>
|
||||
</ds-flex-item>
|
||||
</div>
|
||||
</ds-flex>
|
||||
</div>
|
||||
<section class="categories-select">
|
||||
<base-button
|
||||
v-for="category in categories"
|
||||
:key="category.id"
|
||||
:data-test="categoryButtonsId(category.id)"
|
||||
@click="toggleCategory(category.id)"
|
||||
:filled="isActive(category.id)"
|
||||
:disabled="isDisabled(category.id)"
|
||||
:icon="category.icon"
|
||||
size="small"
|
||||
>
|
||||
{{ $t(`contribution.category.name.${category.slug}`) }}
|
||||
</base-button>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -77,3 +73,15 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.categories-select {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
> .base-button {
|
||||
margin-right: $space-xx-small;
|
||||
margin-bottom: $space-xx-small;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user