refactor: update color-mode usage to new composable
This commit is contained in:
@@ -4,8 +4,8 @@
|
|||||||
title="Star Hoppscotch"
|
title="Star Hoppscotch"
|
||||||
href="https://github.com/hoppscotch/hoppscotch"
|
href="https://github.com/hoppscotch/hoppscotch"
|
||||||
:data-color-scheme="
|
:data-color-scheme="
|
||||||
$colorMode.value != 'light'
|
colorMode.value != 'light'
|
||||||
? $colorMode.value == 'black'
|
? colorMode.value == 'black'
|
||||||
? 'dark'
|
? 'dark'
|
||||||
: 'dark_dimmed'
|
: 'dark_dimmed'
|
||||||
: 'light'
|
: 'light'
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import GithubButton from "vue-github-button"
|
import GithubButton from "vue-github-button"
|
||||||
|
import { useColorMode } from "~/helpers/utils/composables"
|
||||||
|
|
||||||
|
const colorMode = useColorMode()
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
size: {
|
size: {
|
||||||
|
|||||||
@@ -57,7 +57,11 @@ import { logPageView } from "~/helpers/fb/analytics"
|
|||||||
import { hookKeybindingsListener } from "~/helpers/keybindings"
|
import { hookKeybindingsListener } from "~/helpers/keybindings"
|
||||||
import { defineActionHandler } from "~/helpers/actions"
|
import { defineActionHandler } from "~/helpers/actions"
|
||||||
import useWindowSize from "~/helpers/utils/useWindowSize"
|
import useWindowSize from "~/helpers/utils/useWindowSize"
|
||||||
|
<<<<<<< HEAD
|
||||||
import { useSentry } from "~/helpers/sentry"
|
import { useSentry } from "~/helpers/sentry"
|
||||||
|
=======
|
||||||
|
import { useColorMode } from "~/helpers/utils/composables"
|
||||||
|
>>>>>>> refactor: update color-mode usage to new composable
|
||||||
|
|
||||||
function appLayout() {
|
function appLayout() {
|
||||||
const rightSidebar = useSetting("SIDEBAR")
|
const rightSidebar = useSetting("SIDEBAR")
|
||||||
@@ -99,7 +103,7 @@ function setupSentry() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateThemes() {
|
function updateThemes() {
|
||||||
const { $colorMode } = useContext() as any
|
const $colorMode = useColorMode()
|
||||||
|
|
||||||
// Apply theme updates
|
// Apply theme updates
|
||||||
const themeColor = useSetting("THEME_COLOR")
|
const themeColor = useSetting("THEME_COLOR")
|
||||||
|
|||||||
@@ -3,17 +3,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import { onBeforeMount, watch, defineComponent } from "@nuxtjs/composition-api"
|
||||||
useContext,
|
import { useColorMode } from "~/helpers/utils/composables"
|
||||||
onBeforeMount,
|
|
||||||
watch,
|
|
||||||
defineComponent,
|
|
||||||
} from "@nuxtjs/composition-api"
|
|
||||||
import { setupLocalPersistence } from "~/newstore/localpersistence"
|
import { setupLocalPersistence } from "~/newstore/localpersistence"
|
||||||
import { useSetting } from "~/newstore/settings"
|
import { useSetting } from "~/newstore/settings"
|
||||||
|
|
||||||
function updateThemes() {
|
function updateThemes() {
|
||||||
const { $colorMode } = useContext() as any
|
const $colorMode = useColorMode()
|
||||||
|
|
||||||
// Apply theme updates
|
// Apply theme updates
|
||||||
const themeColor = useSetting("THEME_COLOR")
|
const themeColor = useSetting("THEME_COLOR")
|
||||||
|
|||||||
Reference in New Issue
Block a user