Skip to content

Commit e0c6c00

Browse files
committed
Implement no content component
1 parent 64c27e3 commit e0c6c00

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<template>
2+
<section class="hero is-info" v-show="show">
3+
<div class="hero-body">
4+
<div class="has-text-centered">
5+
<p class="title">
6+
{{ title }}
7+
</p>
8+
</div>
9+
</div>
10+
</section>
11+
</template>
12+
13+
<script>
14+
export default {
15+
name: 'NoContent',
16+
17+
props: {
18+
title: {
19+
default: 'No content :)',
20+
type: String
21+
},
22+
23+
show: {
24+
type: Boolean,
25+
required: true
26+
}
27+
}
28+
};
29+
</script>
30+
31+
<style scoped>
32+
33+
</style>

frontend/src/components/view/feed/FeedContainer.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
</b-button>
1515
</div>
1616

17+
<NoContent :show="!tweets.length" title="No tweets yet :)" />
18+
1719
<TweetPreviewList :tweets="tweets" />
1820

1921
<b-modal :active.sync="isNewTweetModalActive" has-modal-card>
@@ -25,6 +27,7 @@
2527
<script>
2628
import { mapGetters, mapActions } from 'vuex';
2729
import TweetPreviewList from '../../common/TweetPreviewList.vue';
30+
import NoContent from '../../common/NoContent.vue';
2831
import NewTweetForm from './NewTweetForm.vue';
2932
3033
export default {
@@ -33,6 +36,7 @@ export default {
3336
components: {
3437
TweetPreviewList,
3538
NewTweetForm,
39+
NoContent
3640
},
3741
3842
data: () => ({

frontend/src/components/view/user/UserContainer.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
<template>
2-
<TweetPreviewList :tweets="tweets" />
2+
<div class="user-container">
3+
<TweetPreviewList :tweets="tweets" />
4+
<NoContent :show="!tweets.length" title="No tweets yet :)" />
5+
</div>
36
</template>
47

58
<script>
69
import { mapActions } from 'vuex';
710
import TweetPreviewList from '@/components/common/TweetPreviewList.vue';
11+
import NoContent from '@/components/common/NoContent.vue';
812
913
export default {
1014
name: 'UserContainer',
1115
1216
components: {
1317
TweetPreviewList,
18+
NoContent
1419
},
1520
1621
data: () => ({

0 commit comments

Comments
 (0)