File tree Expand file tree Collapse file tree 3 files changed +28
-19
lines changed Expand file tree Collapse file tree 3 files changed +28
-19
lines changed Original file line number Diff line number Diff line change 14
14
color : var (--white );
15
15
border-radius : 8px ;
16
16
@include focus-visible ;
17
+ @include text-outline ();
17
18
18
19
& :active {
19
20
background-color : var (--item-hover-bg );
Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
2
import { exit } from ' @tauri-apps/api/process'
3
3
import { Page } from ' ../constants'
4
+ import { AppStorage } from ' ../storage'
4
5
import { useStore } from ' ../stores/store'
5
6
import { Icons } from ' ./Icons'
6
7
import SidebarButton from ' ./SidebarButton.vue'
7
8
8
9
const store = useStore ()
10
+
11
+ const accessToken = AppStorage .asComputed (' accessToken' )
12
+
13
+ function handleBack() {
14
+ let page = Page .Home
15
+
16
+ if (accessToken .value == null )
17
+ page = Page .Landing
18
+
19
+ store .setPage (page )
20
+ }
9
21
</script >
10
22
11
23
<template >
12
24
<nav class =" nav" >
13
- <div
14
- v-if = " store.currentPage !== Page.Landing "
15
- class = " upper "
16
- >
17
- < SidebarButton @click = " store.setPage(Page.Home) " >
18
- <Icons .Bell16 />
25
+ <div class = " upper " >
26
+ < SidebarButton
27
+ v-if = " store.currentPage === Page.Settings "
28
+ @click = " handleBack "
29
+ >
30
+ <Icons .ChevronLeft />
19
31
</SidebarButton >
20
32
</div >
21
33
<div class =" lower" >
22
- <template v-if =" store .currentPage !== Page .Landing " >
23
- <SidebarButton @click =" store.fetchNotifications(true)" >
24
- <Icons .Sync16 />
25
- </SidebarButton >
26
-
27
- <SidebarButton @click =" store.setPage(Page.Settings)" >
28
- <Icons .Gear16 />
29
- </SidebarButton >
30
- </template >
31
-
32
34
<SidebarButton
33
- v-else
34
- @click =" exit(0 )"
35
+ v-if = " accessToken != null "
36
+ @click =" store.fetchNotifications(true )"
35
37
>
36
- <Icons .SignOut16 />
38
+ <Icons .Sync16 />
39
+ </SidebarButton >
40
+
41
+ <SidebarButton @click =" store.setPage(Page.Settings)" >
42
+ <Icons .Gear16 />
37
43
</SidebarButton >
38
44
</div >
39
45
</nav >
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import AlertIcon from 'virtual:icons/octicon/alert-24'
23
23
import QuestionIcon from 'virtual:icons/octicon/question-24'
24
24
import MailIcon from 'virtual:icons/octicon/mail-24'
25
25
import SignOutIcon16 from 'virtual:icons/octicon/sign-out-16'
26
+ import ChevronLeftIcon from 'virtual:icons/octicon/chevron-left'
26
27
27
28
export const Icons = {
28
29
More : markRaw ( MoreIcon ) ,
@@ -48,4 +49,5 @@ export const Icons = {
48
49
Bell16 : markRaw ( BellIcon16 ) ,
49
50
Gear16 : markRaw ( GearIcon16 ) ,
50
51
Sync16 : markRaw ( SyncIcon16 ) ,
52
+ ChevronLeft : markRaw ( ChevronLeftIcon ) ,
51
53
}
You can’t perform that action at this time.
0 commit comments