33 - SPDX-License-Identifier: AGPL-3.0-or-later
44-->
55<template >
6- <AppItem
7- v-if =" app"
8- :app =" app"
9- category =" discover"
10- class =" app-discover-app"
11- inline
12- :list-view =" false" />
136 <a
14- v-else
7+ v-if = " !app "
158 class =" app-discover-app app-discover-app__skeleton"
169 :href =" appStoreLink"
1710 target =" _blank"
2417 <span class =" skeleton-element" />
2518 <span class =" skeleton-element" />
2619 </a >
20+
21+ <article v-else class =" app-discover-app" >
22+ <AppImage class =" app-discover-app__image" :app =" app" />
23+ <div class =" app-discover-app__wrapper" >
24+ <h3 class =" app-discover-app__name" >
25+ <AppLink :href =" `app:${app.id}`" >
26+ {{ app.name }}
27+ </AppLink >
28+ </h3 >
29+ <p >{{ app.summary }}</p >
30+ <AppScore
31+ v-if =" app.ratingNumThresholdReached"
32+ class =" app-discover-app__score"
33+ :score =" app.score" />
34+ </div >
35+ </article >
2736</template >
2837
2938<script setup lang="ts">
30- import type { IAppDiscoverApp } from ' ../../constants/AppDiscoverTypes .ts'
39+ import type { IAppDiscoverApp } from ' ../../apps-discover.d .ts'
3140
3241import { computed } from ' vue'
33- import AppItem from ' ../AppList/AppItem.vue'
34- import { useAppsStore } from ' ../../store/apps-store.ts'
42+ import AppImage from ' ../AppImage.vue'
43+ import AppLink from ' ../AppLink.vue'
44+ import AppScore from ' ../AppScore.vue'
45+ import { useAppsStore } from ' ../../store/apps.ts'
3546
3647const props = defineProps <{
3748 modelValue: IAppDiscoverApp
@@ -40,16 +51,42 @@ const props = defineProps<{
4051const store = useAppsStore ()
4152const app = computed (() => store .getAppById (props .modelValue .appId ))
4253
43- const appStoreLink = computed (() => props .modelValue .appId ? ` https://apps.nextcloud.com/apps/${props .modelValue .appId } ` : ' #' )
54+ const appStoreLink = computed (() => props .modelValue .appId
55+ ? ` https://apps.nextcloud.com/apps/${props .modelValue .appId } `
56+ : ' #' )
4457 </script >
4558
4659<style scoped lang="scss">
4760.app-discover-app {
48- width : 100% !important ; // full with of the showcase item
61+ border-radius : var (--border-radius-element );
62+ display : flex ;
63+ flex-direction : column ;
64+ overflow : hidden ;
65+ width : 100% !important ;
4966
5067 & :hover {
5168 background : var (--color-background-hover );
52- border-radius : var (--border-radius-rounded );
69+ }
70+
71+ & __image {
72+ height : 96px ;
73+ width : 100% ;
74+ }
75+
76+ & __name {
77+ margin-block : 0.5rem ;
78+ font-size : 1.2rem ;
79+ }
80+
81+ & __score {
82+ margin-top : auto ;
83+ }
84+
85+ & __wrapper {
86+ display : flex ;
87+ flex-direction : column ;
88+ padding : calc (2 * var (--default-grid-baseline ));
89+ padding-top : 0px ;
5390 }
5491
5592 & __skeleton {
0 commit comments