Skip to content

Commit

Permalink
refactor: update color-mode usage to new composable
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBastin committed Dec 17, 2021
1 parent 6e53adb commit 65ee2eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 5 additions & 2 deletions packages/hoppscotch-app/components/app/GitHubStarButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
title="Star Hoppscotch"
href="https://github.com/hoppscotch/hoppscotch"
:data-color-scheme="
$colorMode.value != 'light'
? $colorMode.value == 'black'
colorMode.value != 'light'
? colorMode.value == 'black'
? 'dark'
: 'dark_dimmed'
: 'light'
Expand All @@ -20,6 +20,9 @@

<script setup lang="ts">
import GithubButton from "vue-github-button"
import { useColorMode } from "~/helpers/utils/composables"
const colorMode = useColorMode()
defineProps({
size: {
Expand Down
6 changes: 5 additions & 1 deletion packages/hoppscotch-app/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ import { logPageView } from "~/helpers/fb/analytics"
import { hookKeybindingsListener } from "~/helpers/keybindings"
import { defineActionHandler } from "~/helpers/actions"
import useWindowSize from "~/helpers/utils/useWindowSize"
<<<<<<< HEAD
import { useSentry } from "~/helpers/sentry"
=======
import { useColorMode } from "~/helpers/utils/composables"
>>>>>>> refactor: update color-mode usage to new composable
function appLayout() {
const rightSidebar = useSetting("SIDEBAR")
Expand Down Expand Up @@ -99,7 +103,7 @@ function setupSentry() {
}
function updateThemes() {
const { $colorMode } = useContext() as any
const $colorMode = useColorMode()
// Apply theme updates
const themeColor = useSetting("THEME_COLOR")
Expand Down
10 changes: 3 additions & 7 deletions packages/hoppscotch-app/layouts/empty.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
</template>

<script lang="ts">
import {
useContext,
onBeforeMount,
watch,
defineComponent,
} from "@nuxtjs/composition-api"
import { onBeforeMount, watch, defineComponent } from "@nuxtjs/composition-api"
import { useColorMode } from "~/helpers/utils/composables"
import { setupLocalPersistence } from "~/newstore/localpersistence"
import { useSetting } from "~/newstore/settings"
function updateThemes() {
const { $colorMode } = useContext() as any
const $colorMode = useColorMode()
// Apply theme updates
const themeColor = useSetting("THEME_COLOR")
Expand Down

0 comments on commit 65ee2eb

Please sign in to comment.