This repository has been archived by the owner on Aug 25, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add light mode and more setting list
- Loading branch information
Showing
9 changed files
with
123 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script setup lang="ts"> | ||
const searchStore = useSearchStore() | ||
const settingsStore = useSettingsStore() | ||
function handleGoToSettings() { | ||
searchStore.toggleModal() | ||
settingsStore.toggleModalShow() | ||
} | ||
</script> | ||
|
||
<template> | ||
<SidebarSearchItem @click="handleGoToSettings"> | ||
<template #icon> | ||
<Icon name="carbon:arrow-right" class="shrink-0 select-none" /> | ||
</template> | ||
Go to Settings | ||
</SidebarSearchItem> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
const colorMode = useColorMode() | ||
const settingColorModeList = ref<{ | ||
label: string | ||
value: string | ||
handle: () => void | ||
}[]>([ | ||
{ | ||
label: 'Change Colour Mode to System', | ||
value: 'system', | ||
handle: () => { | ||
colorMode.preference = 'system' | ||
}, | ||
}, | ||
{ | ||
label: 'Change Colour Mode to Dark', | ||
value: 'dark', | ||
handle: () => { | ||
colorMode.preference = 'dark' | ||
}, | ||
}, | ||
{ | ||
label: 'Change Colour Mode to Light', | ||
value: 'light', | ||
handle: () => { | ||
colorMode.preference = 'light' | ||
}, | ||
}, | ||
]) | ||
</script> | ||
|
||
<template> | ||
<template v-for="setting in settingColorModeList" :key="setting.label"> | ||
<SidebarSearchListSettingList | ||
v-if="setting.value !== colorMode.preference" | ||
:label="setting.label" | ||
:handle="setting.handle" | ||
/> | ||
</template> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
label: string | ||
handle: () => void | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<SidebarSearchItem @click="props.handle"> | ||
<template #icon> | ||
<Icon name="carbon:settings" class="shrink-0 select-none" /> | ||
</template> | ||
{{ props.label }} | ||
</SidebarSearchItem> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script setup lang="ts"> | ||
const searchStore = useSearchStore() | ||
const showSidebar = useSidebarStore() | ||
const { metaSymbol } = useShortcuts() | ||
function handleToggleLeftSidebar() { | ||
showSidebar.handleToggleSidebar() | ||
searchStore.toggleModal() | ||
} | ||
</script> | ||
|
||
<template> | ||
<SidebarSearchItem @click="handleToggleLeftSidebar()"> | ||
<template #icon> | ||
<GlobalLeftSidebar class="shrink-0 select-none" /> | ||
</template> | ||
{{ showSidebar.show ? 'Collapse' : 'Expand' }} Left Sidebar | ||
<template #suffix> | ||
<Kbd :label="metaSymbol" /> | ||
<Kbd label="/" /> | ||
</template> | ||
</SidebarSearchItem> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters