Skip to content

Commit 8a036cb

Browse files
authored
Merge pull request #64 from BinaryStudioAcademy/feature/no-content-fix
Refactor feed container, add user container no content exists logic
2 parents f0c3c1c + e265415 commit 8a036cb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

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

17-
<NoContent :show="!tweets.length" title="No tweets yet :)" />
18-
1917
<TweetPreviewList :tweets="tweets" />
2018

2119
<b-modal :active.sync="isNewTweetModalActive" has-modal-card>
@@ -27,7 +25,6 @@
2725
<script>
2826
import { mapGetters, mapActions } from 'vuex';
2927
import TweetPreviewList from '../../common/TweetPreviewList.vue';
30-
import NoContent from '../../common/NoContent.vue';
3128
import NewTweetForm from './NewTweetForm.vue';
3229
import { pusher } from '@/services/Pusher';
3330
import { SET_TWEET } from '@/store/modules/tweet/mutationTypes';
@@ -41,7 +38,6 @@ export default {
4138
components: {
4239
TweetPreviewList,
4340
NewTweetForm,
44-
NoContent
4541
},
4642
4743
data: () => ({

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="user-container">
33
<TweetPreviewList :tweets="tweets" />
4-
<NoContent :show="!tweets.length" title="No tweets yet :)" />
4+
<NoContent :show="noContent" title="No tweets yet :)" />
55
</div>
66
</template>
77

@@ -20,11 +20,16 @@ export default {
2020
2121
data: () => ({
2222
tweets: [],
23+
noContent: false
2324
}),
2425
2526
async created() {
2627
try {
2728
this.tweets = await this.fetchTweetsByUserId(this.$route.params.id);
29+
30+
if (!this.tweets.length) {
31+
this.noContent = true;
32+
}
2833
} catch (error) {
2934
console.error(error.message);
3035
}

0 commit comments

Comments
 (0)