-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addons store: Use swiper for addon cards on mobile & Reduce size of a…
…ddon card on desktop (#2216) Fixes #2205 and fixes #1668. This slighly reduces the addon card size on desktop and uses a swiper (like in many app stores) instead of a flex on mobile. Signed-off-by: Florian Hotze <[email protected]>
- Loading branch information
1 parent
dad104e
commit 574c313
Showing
3 changed files
with
63 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
bundles/org.openhab.ui/web/src/components/addons/addons-swiper.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<addon-card class="addons-swiper" v-if="addonsList.length === 1" style="width: 66.667%" :addon="addonsList[0]" :install-action-text="installActionText" :headline="headline" @addonButtonClick="addonButtonClick" /> | ||
<f7-swiper class="addons-swiper" v-else pagination :params="{ spaceBetween: 10, slidesPerView: 1.5 }"> | ||
<f7-swiper-slide v-for="addon in addonsList" :key="addon.uid"> | ||
<addon-card :key="addon.uid" :addon="addon" :install-action-text="installActionText" :headline="headline" @addonButtonClick="addonButtonClick" /> | ||
</f7-swiper-slide> | ||
</f7-swiper> | ||
</template> | ||
|
||
<script> | ||
import AddonCard from '@/components/addons/addon-card.vue' | ||
export default { | ||
props: ['addonsList', 'installActionText', 'headline'], | ||
emits: ['addonButtonClick'], | ||
components: { | ||
AddonCard | ||
}, | ||
methods: { | ||
addonButtonClick (addon) { | ||
this.$emit('addonButtonClick', addon) | ||
} | ||
} | ||
} | ||
</script> |