Skip to content

Commit

Permalink
feat: add compact mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Sep 10, 2024
1 parent dc8caed commit eff3e46
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/components/Button/ButtonToggleFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
import { computed } from 'vue'
import ButtonIcon from '@/components/Button/ButtonIcon'
import { useBreakpoints } from '@/composables/breakpoints'
const active = defineModel('active', { type: Boolean })
defineProps({
const props = defineProps({
loading: {
type: Boolean
},
compactBreakpoint: {
type: String,
default: 'sm'
}
})
Expand All @@ -18,13 +23,21 @@ const toggle = () => {
const variant = computed(() => {
return active.value ? 'action' : 'outline-tertiary'
})
const { breakpointDown } = useBreakpoints()
const compact = computed(() => {
return breakpointDown.value[props.compactBreakpoint]
})
</script>

<template>
<button-icon
class="button-toggle-filters"
:label="$t('buttonToggleFilters.label')"
icon-left="funnel"
:square="compact"
:hide-label="compact"
:loading="loading"
:variant="variant"
@click="toggle"
Expand Down
2 changes: 1 addition & 1 deletion src/stories/components/Project/ProjectLink.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ProjectLink from '@/components/Project/ProjectLink'
const routes = [
{
path: '/project/:name',
name: 'project.view'
name: 'project.view.insights'
}
]

Expand Down

0 comments on commit eff3e46

Please sign in to comment.