Skip to content

Commit

Permalink
Merge pull request #60 from doroudi:doroudi/issue59
Browse files Browse the repository at this point in the history
Change Theme in Login Page
  • Loading branch information
doroudi authored Mar 23, 2024
2 parents 32b2f32 + eab9225 commit 52203e9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ declare module 'vue' {
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Sidebar: typeof import('./components/Sidebar.vue')['default']
ThemeSwitch: typeof import('./components/ThemeSwitch.vue')['default']
UserProfile: typeof import('./components/UserProfile.vue')['default']
}
}
23 changes: 1 addition & 22 deletions src/components/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import {
PanelLeftContract16Regular as CollapseIcon,
WeatherMoon48Regular as MoonIcon,
PanelLeftExpand20Regular as OpenIcon,
WeatherSunny48Regular as SunIcon,
} from '@vicons/fluent'
const layoutStore = useLayoutStore()
const { collapsed } = storeToRefs(layoutStore)

Check warning on line 5 in src/components/Navbar.vue

View workflow job for this annotation

GitHub Actions / lint

'collapsed' is assigned a value but never used. Allowed unused vars must match /^_/u
Expand All @@ -14,25 +8,10 @@ const { collapsed } = storeToRefs(layoutStore)
<template>
<n-page-header class="p-2 navbar">
<template #title>
<n-button mx-2 text size="small" circle @click="layoutStore.toggleSidebar">
<template #icon>
<n-icon size="1.4rem">
<OpenIcon v-if="collapsed" />
<CollapseIcon v-else />
</n-icon>
</template>
</n-button>
<ThemeSwitch />
</template>
<template #extra>
<div class="flex items-center">
<n-button text circle @click="layoutStore.toggleTheme()">
<template #icon>
<NIcon size="1.4rem">
<SunIcon v-if="isDark" />
<MoonIcon v-else />
</NIcon>
</template>
</n-button>
<div class="mx-2">
<LanguageSelect />
</div>
Expand Down
21 changes: 21 additions & 0 deletions src/components/ThemeSwitch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script setup lang='ts'>
import {
WeatherMoon48Regular as MoonIcon,
WeatherSunny48Regular as SunIcon,
} from '@vicons/fluent'
const layoutStore = useLayoutStore()
</script>

<template>
<n-button text circle @click="layoutStore.toggleTheme()">
<template #icon>
<NIcon size="1.4rem">
<SunIcon v-if="isDark" />
<MoonIcon v-else />
</NIcon>
</template>
</n-button>
</template>

<style scoped lang='scss'></style>
3 changes: 2 additions & 1 deletion src/pages/Account/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ meta:
</div>
</div>
</div>
<div class="mt-3">
<div class="mt-3 flex justify-between items-center">
<LanguageSelect />
<ThemeSwitch class="mr-2" />
</div>
</div>
</div>
Expand Down

0 comments on commit 52203e9

Please sign in to comment.