Skip to content

Commit e3509cb

Browse files
committed
feat(cmd): toggle promo bg
1 parent 8c80e60 commit e3509cb

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

components/cmd/CommandMenu.vue

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const notificationsStore = useNotificationsStore()
3939
const appConfig = useAppConfig()
4040
4141
const theme = useCookie("theme", { default: () => "dark" })
42+
const showPromoBackground = useCookie("showPromoBackground", { default: () => true })
4243
4344
const route = useRoute()
4445
const router = useRouter()
@@ -766,23 +767,6 @@ const rawDeveloperActions = [
766767
})
767768
},
768769
},
769-
{
770-
type: "callback",
771-
icon: "settings",
772-
title: "Toggle Search Scoring",
773-
subtitle: "Command",
774-
runText: "Reset",
775-
callback: () => {
776-
notificationsStore.create({
777-
notification: {
778-
type: "info",
779-
icon: "info",
780-
title: `Search scoring is not available`,
781-
autoDestroy: true,
782-
},
783-
})
784-
},
785-
},
786770
{
787771
type: "callback",
788772
icon: "stars",
@@ -817,6 +801,25 @@ const developerGroup = computed(() => {
817801
})
818802
819803
const rawOtherActions = [
804+
{
805+
type: "callback",
806+
icon: "settings",
807+
title: "Toggle Promo Background",
808+
subtitle: "Command",
809+
runText: "Toggle",
810+
callback: () => {
811+
showPromoBackground.value = !showPromoBackground.value
812+
813+
notificationsStore.create({
814+
notification: {
815+
type: "info",
816+
icon: "info",
817+
title: `Promo background ${appStore.showPromoBackground ? "enabled" : "disabled"}`,
818+
autoDestroy: true,
819+
},
820+
})
821+
},
822+
},
820823
{
821824
type: "callback",
822825
icon: "terminal",

layouts/default.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import AdvBanner from "@/components/shared/AdvBanner.vue"
44
55
/** Services */
66
import { getNetworkName } from "@/services/utils/general"
7+
8+
const showPromoBackground = useCookie("showPromoBackground", { default: () => true })
79
</script>
810

911
<template>
1012
<Flex direction="column">
1113
<Flex justify="center" :class="$style.wrapper">
12-
<img v-if="getNetworkName() === 'Mammoth'" src="/img/mammoth.jpeg" :class="$style.mammoth_bg" />
14+
<img v-if="getNetworkName() === 'Mammoth' && showPromoBackground" src="/img/mammoth.jpeg" :class="$style.mammoth_bg" />
1315

1416
<LeftSidebar :class="$style.sidebar" />
1517

0 commit comments

Comments
 (0)