From e03807c18efa611e7272b83f7ab8ce5efa14ffe1 Mon Sep 17 00:00:00 2001 From: Bimal Gharti Magar Date: Wed, 8 Dec 2021 18:22:49 +0545 Subject: [PATCH 01/10] Updated sorting keys for channels #15 * Added channels API call fetch channels * Updated sorting keys on the featured channels component * Replaced title key with name key in channels, threads and messages * Modulaized code folder wise --- src/components/ButtonComponent.vue | 7 --- src/components/{ => Channels}/ChannelList.vue | 2 +- .../{ => Channels}/ChannelListItem.vue | 6 +-- .../{ => Channels}/CreateChannel.vue | 4 +- .../{ => Channels}/FeaturedChannelList.vue | 14 +++--- src/components/{ => Shared}/FooterSection.vue | 0 src/components/{ => Shared}/HeaderSection.vue | 2 +- src/components/{ => Threads}/ThreadList.vue | 0 .../{ => Threads}/ThreadListItem.vue | 6 +-- src/components/{ => Threads}/ThreadView.vue | 0 .../{ => Threads}/ThreadViewItem.vue | 2 +- src/composables/global/useStore.js | 43 ++++++++----------- src/composables/useChannels.js | 8 ++-- src/composables/userSorting.js | 3 +- src/layout/HomePageLayout.vue | 4 +- src/plugins/axios.js | 10 ++--- src/service/index.js | 4 ++ src/views/ChannelsPage.vue | 2 +- src/views/LandingPage.vue | 9 ++-- src/views/ThreadsPage.vue | 4 +- 20 files changed, 60 insertions(+), 70 deletions(-) delete mode 100644 src/components/ButtonComponent.vue rename src/components/{ => Channels}/ChannelList.vue (88%) rename src/components/{ => Channels}/ChannelListItem.vue (82%) rename src/components/{ => Channels}/CreateChannel.vue (81%) rename src/components/{ => Channels}/FeaturedChannelList.vue (80%) rename src/components/{ => Shared}/FooterSection.vue (100%) rename src/components/{ => Shared}/HeaderSection.vue (89%) rename src/components/{ => Threads}/ThreadList.vue (100%) rename src/components/{ => Threads}/ThreadListItem.vue (84%) rename src/components/{ => Threads}/ThreadView.vue (100%) rename src/components/{ => Threads}/ThreadViewItem.vue (97%) diff --git a/src/components/ButtonComponent.vue b/src/components/ButtonComponent.vue deleted file mode 100644 index 8e17284..0000000 --- a/src/components/ButtonComponent.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/components/ChannelList.vue b/src/components/Channels/ChannelList.vue similarity index 88% rename from src/components/ChannelList.vue rename to src/components/Channels/ChannelList.vue index 74f1824..d8ca07c 100644 --- a/src/components/ChannelList.vue +++ b/src/components/Channels/ChannelList.vue @@ -1,6 +1,6 @@ - diff --git a/src/views/ThreadsPage.vue b/src/views/ThreadsPage.vue index e6cfeef..64d9311 100644 --- a/src/views/ThreadsPage.vue +++ b/src/views/ThreadsPage.vue @@ -1,27 +1,12 @@ From 7ec00c038dce4cc743014e9bad8338e7e9714f07 Mon Sep 17 00:00:00 2001 From: Bimal Gharti Magar Date: Sat, 11 Dec 2021 05:26:12 +0545 Subject: [PATCH 08/10] Renamed component to match feature - Updated active thread text color - Added fixed height to messages div - Added scroll to bottom to messages div on load - Changed definecomponent to script setup --- src/components/Threads/ThreadListItem.vue | 3 +- src/components/Threads/ThreadView.vue | 2 +- src/components/Threads/ThreadViewItem.vue | 4 +- src/routes/index.js | 4 +- src/views/ChannelsPage.vue | 46 ------------ src/views/MessagesPage.vue | 52 ++++++++++++++ src/views/ThreadsPage.vue | 88 +++++++++++------------ 7 files changed, 100 insertions(+), 99 deletions(-) delete mode 100644 src/views/ChannelsPage.vue create mode 100644 src/views/MessagesPage.vue diff --git a/src/components/Threads/ThreadListItem.vue b/src/components/Threads/ThreadListItem.vue index 3858c97..8d52495 100644 --- a/src/components/Threads/ThreadListItem.vue +++ b/src/components/Threads/ThreadListItem.vue @@ -27,7 +27,8 @@ export default { getThreadClass(item) { var className = "grid grid-cols-12 gap-6 p-2 text-gray-700 hover:text-red-500 hover:bg-gray-100 cursor-pointer"; - if (item.name == this.$route.params.threadId) className += " bg-gray-100"; + if (item.id == this.$route.params.threadId) + className += " bg-gray-100 text-red-500"; return className; }, }, diff --git a/src/components/Threads/ThreadView.vue b/src/components/Threads/ThreadView.vue index 7fae348..5f29fa0 100644 --- a/src/components/Threads/ThreadView.vue +++ b/src/components/Threads/ThreadView.vue @@ -1,6 +1,6 @@