Skip to content

Commit 169cf40

Browse files
committed
chore: wip
1 parent 9a03f8e commit 169cf40

File tree

2 files changed

+68
-231
lines changed

2 files changed

+68
-231
lines changed

storage/framework/defaults/views/dashboard/inbox/activity.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { ref, computed, onMounted } from 'vue'
33
import { useHead } from '@vueuse/head'
4+
import { useRouter } from 'vue-router'
45
import { Line, Bar, Doughnut } from 'vue-chartjs'
56
import {
67
Chart as ChartJS,
@@ -35,6 +36,8 @@ useHead({
3536
title: 'Mail - Activity Dashboard',
3637
})
3738
39+
const router = useRouter()
40+
3841
// Time range state
3942
const timeRange = ref<'day' | 'week' | 'month' | 'year'>('week')
4043
const activeFolder = ref('inbox')
@@ -294,6 +297,17 @@ const changeTimeRange = async (newRange: 'day' | 'week' | 'month' | 'year') => {
294297
await updateChartData()
295298
}
296299
300+
// Function to handle folder change
301+
const handleFolderChange = (folder: string) => {
302+
// Navigate to the inbox page with the selected folder
303+
router.push(`/inbox`)
304+
}
305+
306+
// Function to handle compose
307+
const handleCompose = () => {
308+
router.push('/inbox?compose=true')
309+
}
310+
297311
// Initial load
298312
onMounted(async () => {
299313
isLoading.value = true
@@ -310,7 +324,8 @@ onMounted(async () => {
310324
:active-folder="activeFolder"
311325
:folders="folders"
312326
:unread-counts="unreadCounts"
313-
@update:active-folder="activeFolder = $event"
327+
@update:active-folder="(folder) => { activeFolder = folder; handleFolderChange(folder); }"
328+
@compose="handleCompose"
314329
/>
315330

316331
<!-- Main Content -->

0 commit comments

Comments
 (0)