Skip to content

Commit 7be66e3

Browse files
refactor: widgets and chat
1 parent e928af7 commit 7be66e3

File tree

6 files changed

+42
-65
lines changed

6 files changed

+42
-65
lines changed

src/components/dashboard/chat/conversations/List.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</v-list-item>
2121
</template>
2222

23-
<app-dashboard-chat-settings ref="settings" />
23+
<chat-settings ref="settings" />
2424

2525
<v-divider color="grey-darken-1" />
2626

@@ -94,7 +94,7 @@ import { onMounted } from 'vue'
9494
import { storeToRefs } from 'pinia'
9595
import { useAuthStore } from '@/stores/auth'
9696
import { useChatStore } from '@/stores/chats'
97-
import AppDashboardChatSettings from '@/components/dashboard/chat/Settings.vue'
97+
import ChatSettings from '@/components/dashboard/chat/Settings.vue'
9898
9999
const authStore = useAuthStore()
100100
const chatStore = useChatStore()

src/components/dashboard/chat/messages/Message.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<!-- Voice message -->
3939
<div v-else>
4040
<div class="d-inline-block rounded-pill" :class="{ 'ms-4': !current, 'me-4': current }">
41-
<app-dashboard-chat-messages-audio-player :source="data.source" />
41+
<chat-messages-audio-player :source="data.source" />
4242
</div>
4343
</div>
4444

@@ -69,7 +69,7 @@
6969
<script setup>
7070
import { computed } from 'vue'
7171
import { useUser } from '@/composables/useUser'
72-
import AppDashboardChatMessagesAudioPlayer from './AudioPlayer.vue'
72+
import ChatMessagesAudioPlayer from './AudioPlayer.vue'
7373
7474
const props = defineProps({ data: Object })
7575
const user = useUser()

src/components/dashboard/chat/sender/Sender.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</template>
3939
</v-text-field>
4040

41-
<app-dashboard-chat-sender-recorder
41+
<chat-sender-recorder
4242
@abort="isRecording = false"
4343
@recorded=";(isRecording = false), send('voice', $event)"
4444
:is-recording="isRecording"
@@ -58,7 +58,7 @@ import { useChatStore } from '@/stores/chats'
5858
import { useAuthStore } from '@/stores/auth'
5959
import { useAppStore } from '@/stores/app'
6060
import EmojiesPicker from './EmojiesPicker.vue'
61-
import AppDashboardChatSenderRecorder from './Recorder.vue'
61+
import ChatSenderRecorder from './Recorder.vue'
6262
6363
const message = ref(null)
6464
const loading = ref(false)

src/pages/dashboard/chat.vue

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<source src="/message.mp3" type="audio/mpeg" />
55
</audio>
66

7-
<app-dashboard-chat-conversations-list />
7+
<chat-conversations-list />
88

99
<!--
1010
Equation: (Screen height - Navbar height - Top & Bottom paddings)
@@ -15,10 +15,7 @@
1515
class="position-relative h-100 ms-0 ms-lg-5"
1616
rounded="lg"
1717
>
18-
<app-dashboard-chat-toolbar
19-
:conversation="chatStore.activeConversation"
20-
:isLoadingChat="isLoadingChat"
21-
/>
18+
<chat-toolbar :conversation="chatStore.activeConversation" :isLoadingChat="isLoadingChat" />
2219

2320
<v-divider color="grey-darken-1" />
2421

@@ -46,11 +43,8 @@
4643
</div>
4744

4845
<ul v-else>
49-
<app-dashboard-chat-messages-message v-for="data in chat" :data="data" />
50-
<app-dashboard-chat-typing
51-
v-if="chat.length && isPartnerTyping"
52-
:partner="activeConversation"
53-
/>
46+
<chat-messages-message v-for="data in chat" :data="data" />
47+
<chat-typing v-if="chat.length && isPartnerTyping" :partner="activeConversation" />
5448
</ul>
5549
</div>
5650

@@ -59,11 +53,11 @@
5953
class="d-flex align-center position-absolute w-100 pa-5"
6054
style="bottom: 0; left: 0; height: 84px"
6155
>
62-
<app-dashboard-chat-sender />
56+
<chat-sender />
6357
</div>
6458
</v-sheet>
6559

66-
<app-dashboard-chat-empty v-else />
60+
<chat-empty v-else />
6761
</v-main>
6862
</v-layout>
6963
</template>
@@ -77,12 +71,12 @@ import { useChatStore } from '@/stores/chats'
7771
import { useLoader } from '@/composables/useLoader'
7872
import { useUser } from '@/composables/useUser'
7973
import axios from '@/plugins/axios'
80-
import AppDashboardChatMessagesMessage from '@/components/dashboard/chat/messages/Message.vue'
81-
import AppDashboardChatSender from '@/components/dashboard/chat/sender/Sender.vue'
82-
import AppDashboardChatConversationsList from '@/components/dashboard/chat/conversations/List.vue'
83-
import AppDashboardChatTyping from '@/components/dashboard/chat/Typing.vue'
84-
import AppDashboardChatToolbar from '@/components/dashboard/chat/Toolbar.vue'
85-
import AppDashboardChatEmpty from '@/components/dashboard/chat/Empty.vue'
74+
import ChatMessagesMessage from '@/components/dashboard/chat/messages/Message.vue'
75+
import ChatSender from '@/components/dashboard/chat/sender/Sender.vue'
76+
import ChatConversationsList from '@/components/dashboard/chat/conversations/List.vue'
77+
import ChatTyping from '@/components/dashboard/chat/Typing.vue'
78+
import ChatToolbar from '@/components/dashboard/chat/Toolbar.vue'
79+
import ChatEmpty from '@/components/dashboard/chat/Empty.vue'
8680
8781
const container = ref(null)
8882
const sender = ref(null)

src/pages/dashboard/index.vue

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<app-sheet title="Dashboard" class="mb-0">
33
<v-row no-gutters>
44
<v-col cols="12" sm="6" lg="3">
5-
<app-dashboard-widgets-stat
5+
<widgets-stat
66
title="Today Orders"
77
value="1,900"
88
percentage="25.47%"
@@ -14,18 +14,13 @@
1414
<v-divider vertical />
1515

1616
<v-col cols="12" sm="6" lg="3">
17-
<app-dashboard-widgets-stat
18-
title="Today Orders"
19-
value="2,500"
20-
percentage="5.64%"
21-
class="px-5 py-0"
22-
/>
17+
<widgets-stat title="Today Orders" value="2,500" percentage="5.64%" class="px-5 py-0" />
2318
</v-col>
2419

2520
<v-divider vertical />
2621

2722
<v-col cols="12" sm="6" lg="3">
28-
<app-dashboard-widgets-stat
23+
<widgets-stat
2924
title="Today Orders"
3025
value="564"
3126
percentage="14.47%"
@@ -37,7 +32,7 @@
3732
<v-divider vertical />
3833

3934
<v-col cols="12" sm="6" lg="3">
40-
<app-dashboard-widgets-stat
35+
<widgets-stat
4136
title="Today Orders"
4237
value="1,000"
4338
percentage="9.14%"
@@ -130,33 +125,25 @@
130125
<v-col cols="16" lg="6">
131126
<v-row>
132127
<v-col cols="12">
133-
<app-dashboard-widgets-sales-revenue />
128+
<widgets-sales-revenue />
134129
</v-col>
135130

136131
<!-- Second widget -->
137132
<v-col cols="12" lg="6">
138-
<app-dashboard-widgets-bar-simple
139-
title="Active Subscriptions"
140-
value="1.1K"
141-
percentage="25.47%"
142-
/>
133+
<widgets-bar-simple title="Active Subscriptions" value="1.1K" percentage="25.47%" />
143134
</v-col>
144135

145136
<!-- Third widget -->
146137
<v-col cols="12" lg="6">
147-
<app-dashboard-widgets-bar-simple
148-
title="AVG Subscriptions"
149-
value="341.2"
150-
percentage="10%"
151-
/>
138+
<widgets-bar-simple title="AVG Subscriptions" value="341.2" percentage="10%" />
152139
</v-col>
153140

154141
<v-col cols="6">
155-
<app-dashboard-widgets-website-performance />
142+
<widgets-website-performance />
156143
</v-col>
157144

158145
<v-col cols="6">
159-
<app-dashboard-widgets-pie />
146+
<widgets-pie />
160147
</v-col>
161148

162149
<!-- Fourth widget -->
@@ -264,11 +251,11 @@ import { LineChart, useLineChart } from 'vue-chart-3'
264251
import { useUser } from '@/composables/useUser'
265252
import { useLoader } from '@/composables/useLoader'
266253
import { months, numbers, createGradient } from '@/assets/js/charts/utils'
267-
import AppDashboardWidgetsSalesRevenue from '@/components/dashboard/widgets/SalesRevenue.vue'
268-
import AppDashboardWidgetsBarSimple from '@/components/dashboard/widgets/BarSimple.vue'
269-
import AppDashboardWidgetsWebsitePerformance from '@/components/dashboard/widgets/WebsitePerformance.vue'
270-
import AppDashboardWidgetsStat from '@/components/dashboard/widgets/Stat.vue'
271-
import AppDashboardWidgetsPie from '@/components/dashboard/widgets/Pie.vue'
254+
import WidgetsSalesRevenue from '@/components/dashboard/widgets/SalesRevenue.vue'
255+
import WidgetsBarSimple from '@/components/dashboard/widgets/BarSimple.vue'
256+
import WidgetsWebsitePerformance from '@/components/dashboard/widgets/WebsitePerformance.vue'
257+
import WidgetsStat from '@/components/dashboard/widgets/Stat.vue'
258+
import WidgetsPie from '@/components/dashboard/widgets/Pie.vue'
272259
273260
Chart.register(...registerables)
274261

src/pages/dashboard/widgets.vue

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,23 @@
33

44
<v-row class="mt-3">
55
<v-col cols="6">
6-
<app-dashboard-widgets-sales-revenue />
6+
<widgets-sales-revenue />
77
</v-col>
88

99
<v-col cols="3">
10-
<app-dashboard-widgets-bar-simple
11-
title="Active Subscriptions"
12-
value="1.1K"
13-
percentage="25.47%"
14-
/>
10+
<widgets-bar-simple title="Active Subscriptions" value="1.1K" percentage="25.47%" />
1511
</v-col>
1612

1713
<v-col cols="3">
18-
<app-dashboard-widgets-stat title="Today Orders" value="1,900" percentage="25.47%" />
14+
<widgets-stat title="Today Orders" value="1,900" percentage="25.47%" />
1915
</v-col>
2016

2117
<v-col cols="3">
22-
<app-dashboard-widgets-website-performance />
18+
<widgets-website-performance />
2319
</v-col>
2420

2521
<v-col cols="3">
26-
<app-dashboard-widgets-pie />
22+
<widgets-pie />
2723
</v-col>
2824
</v-row>
2925
</template>
@@ -32,11 +28,11 @@
3228
import { onMounted } from 'vue'
3329
import { Chart, registerables } from 'chart.js'
3430
import { useLoader } from '@/composables/useLoader'
35-
import AppDashboardWidgetsWebsitePerformance from '@/components/dashboard/widgets/WebsitePerformance.vue'
36-
import AppDashboardWidgetsBarSimple from '@/components/dashboard/widgets/BarSimple.vue'
37-
import AppDashboardWidgetsSalesRevenue from '@/components/dashboard/widgets/SalesRevenue.vue'
38-
import AppDashboardWidgetsStat from '@/components/dashboard/widgets/Stat.vue'
39-
import AppDashboardWidgetsPie from '@/components/dashboard/widgets/Pie.vue'
31+
import WidgetsWebsitePerformance from '@/components/dashboard/widgets/WebsitePerformance.vue'
32+
import WidgetsBarSimple from '@/components/dashboard/widgets/BarSimple.vue'
33+
import WidgetsSalesRevenue from '@/components/dashboard/widgets/SalesRevenue.vue'
34+
import WidgetsStat from '@/components/dashboard/widgets/Stat.vue'
35+
import WidgetsPie from '@/components/dashboard/widgets/Pie.vue'
4036
4137
Chart.register(...registerables)
4238

0 commit comments

Comments
 (0)