File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ a:hover {
9898 padding : var (--vertical-padding ) var (--side-padding );
9999 position : relative;
100100 height : 100% ;
101+ display : flex;
102+ flex-direction : column;
101103
102104 & + & {
103105 border-left : 1px solid var (--color-grey-200 );
@@ -299,7 +301,27 @@ a:hover {
299301}
300302
301303.feed-list-loader {
302- margin : calc (var (--grid-step ) * 2 ) calc (var (--grid-step ) * 3 ) calc (var (--grid-step ) * 3 );;
304+ margin : calc (var (--grid-step ) * 2 ) calc (var (--grid-step ) * 3 ) calc (var (--grid-step ) * 3 );
305+ }
306+
307+ .feed-list-empty-container {
308+ margin : calc (var (--grid-step ) * 2 ) calc (var (--grid-step ) * 3 ) calc (var (--grid-step ) * 3 );
309+ display : flex;
310+ flex : 1 ;
311+ justify-content : center;
312+ align-items : center;
313+ }
314+
315+ .feed-list-empty-icon {
316+ width : calc (var (--grid-step ) * 6 );
317+ }
318+
319+ .feed-list-empty {
320+ display : flex;
321+ flex-direction : column;
322+ align-items : center;
323+ color : var (--color-grey-200 );
324+ gap : calc (var (--grid-step ) * 1 );
303325}
304326
305327.feed-list {
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import FeedItem from '@/components/FeedItem.vue'
33import { useFeedStore } from ' @/stores/feed.ts'
44import { computed , ref , watchEffect } from ' vue'
55import { useRoute } from ' vue-router'
6+ import IconInboxEmpty from ' @/components/icons/IconInboxEmpty.vue'
67
78const { fetchUrl } = defineProps ({ fetchUrl: String })
89const nextLink = ref (null )
@@ -59,6 +60,12 @@ watchEffect(async () => {
5960
6061<template >
6162 <div class =" feed-list-loader" v-if =" feedStore.isLoading" >Loading...</div >
63+ <div v-else-if =" feedStore.isEmpty" class =" feed-list-empty-container" >
64+ <div class =" feed-list-empty" >
65+ <IconInboxEmpty class="feed-list-empty-icon" />
66+ <p >There is nothing new yet.</p >
67+ </div >
68+ </div >
6269 <ul v-else class =" feed-list-wrapper" >
6370 <FeedItem
6471 v-for =" (feedItem , idx ) in feedStore .items "
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+
3+ </script >
4+
5+ <template >
6+ <svg xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 -960 960 960" fill =" currentColor" ><path d =" M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-120H640q-30 38-71.5 59T480-240q-47 0-88.5-21T320-320H200v120Zm280-120q38 0 69-22t43-58h168v-360H200v360h168q12 36 43 58t69 22ZM200-200h560-560Z" /></svg >
7+ </template >
8+
9+ <style scoped>
10+
11+ </style >
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export const useFeedStore = defineStore('feed', {
4949
5050 return state . filters [ category ]
5151 } ,
52+ isEmpty : ( state : FeedState ) => state . items . length === 0 ,
5253 } ,
5354 actions : {
5455 setItems ( items : FeedItem [ ] ) {
You can’t perform that action at this time.
0 commit comments