feat: support to move sidebar to left - fixed #1933

This commit is contained in:
liyasthomas
2021-11-04 09:58:15 +05:30
parent 45e508fc36
commit d3a1898dad
14 changed files with 107 additions and 111 deletions

View File

@@ -4,10 +4,11 @@
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="LEFT_SIDEBAR ? $t('hide.sidebar') : $t('show.sidebar')" :title="EXPAND_NAVIGATION ? $t('hide.sidebar') : $t('show.sidebar')"
svg="sidebar" svg="sidebar"
:class="{ 'transform -rotate-180': !LEFT_SIDEBAR }" class="transform"
@click.native="LEFT_SIDEBAR = !LEFT_SIDEBAR" :class="{ '-rotate-180': !EXPAND_NAVIGATION }"
@click.native="EXPAND_NAVIGATION = !EXPAND_NAVIGATION"
/> />
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
@@ -133,14 +134,21 @@
:class="{ 'rotate-90': !COLUMN_LAYOUT }" :class="{ 'rotate-90': !COLUMN_LAYOUT }"
@click.native="COLUMN_LAYOUT = !COLUMN_LAYOUT" @click.native="COLUMN_LAYOUT = !COLUMN_LAYOUT"
/> />
<ButtonSecondary <span
v-tippy="{ theme: 'tooltip' }" class="transform transition"
:title="RIGHT_SIDEBAR ? $t('hide.sidebar') : $t('show.sidebar')" :class="{
svg="sidebar" 'rotate-180': SIDEBAR_ON_LEFT,
class="transform rotate-180" }"
:class="{ 'rotate-360': !RIGHT_SIDEBAR }" >
@click.native="RIGHT_SIDEBAR = !RIGHT_SIDEBAR" <ButtonSecondary
/> v-tippy="{ theme: 'tooltip' }"
:title="SIDEBAR ? $t('hide.sidebar') : $t('show.sidebar')"
svg="sidebar"
class="transform"
:class="{ 'rotate-180': !SIDEBAR }"
@click.native="SIDEBAR = !SIDEBAR"
/>
</span>
</div> </div>
</div> </div>
<AppShortcuts :show="showShortcuts" @close="showShortcuts = false" /> <AppShortcuts :show="showShortcuts" @close="showShortcuts = false" />
@@ -168,10 +176,11 @@ export default defineComponent({
}) })
return { return {
LEFT_SIDEBAR: useSetting("LEFT_SIDEBAR"), EXPAND_NAVIGATION: useSetting("EXPAND_NAVIGATION"),
RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), SIDEBAR: useSetting("SIDEBAR"),
ZEN_MODE: useSetting("ZEN_MODE"), ZEN_MODE: useSetting("ZEN_MODE"),
COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
navigatorShare: !!navigator.share, navigatorShare: !!navigator.share,
@@ -181,7 +190,7 @@ export default defineComponent({
}, },
watch: { watch: {
ZEN_MODE() { ZEN_MODE() {
this.LEFT_SIDEBAR = !this.ZEN_MODE this.EXPAND_NAVIGATION = !this.ZEN_MODE
}, },
}, },
methods: { methods: {

View File

@@ -14,9 +14,9 @@
<div v-if="navigation.svg"> <div v-if="navigation.svg">
<SmartIcon :name="navigation.svg" class="svg-icons" /> <SmartIcon :name="navigation.svg" class="svg-icons" />
</div> </div>
<span v-if="LEFT_SIDEBAR">{{ navigation.title }}</span> <span v-if="EXPAND_NAVIGATION">{{ navigation.title }}</span>
<tippy <tippy
v-if="!LEFT_SIDEBAR" v-if="!EXPAND_NAVIGATION"
:placement="windowInnerWidth.x.value >= 768 ? 'right' : 'bottom'" :placement="windowInnerWidth.x.value >= 768 ? 'right' : 'bottom'"
theme="tooltip" theme="tooltip"
:content="navigation.title" :content="navigation.title"
@@ -35,7 +35,7 @@ export default defineComponent({
setup() { setup() {
return { return {
windowInnerWidth: useWindowSize(), windowInnerWidth: useWindowSize(),
LEFT_SIDEBAR: useSetting("LEFT_SIDEBAR"), EXPAND_NAVIGATION: useSetting("EXPAND_NAVIGATION"),
} }
}, },
data() { data() {

View File

@@ -28,7 +28,7 @@
'border border-divider hover:border-dividerDark focus-visible:border-dividerDark': 'border border-divider hover:border-dividerDark focus-visible:border-dividerDark':
outline, outline,
}, },
{ 'bg-primaryDark': filled }, { '!bg-primaryDark': filled },
]" ]"
:disabled="disabled" :disabled="disabled"
tabindex="0" tabindex="0"

View File

@@ -1,15 +1,14 @@
<template> <template>
<Splitpanes <Splitpanes
class="smart-splitter" class="smart-splitter"
:dbl-click-splitter="false" :rtl="SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768"
:class="{
'!flex-row-reverse': SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768,
}"
:horizontal="!(windowInnerWidth.x.value >= 768)" :horizontal="!(windowInnerWidth.x.value >= 768)"
> >
<Pane class="hide-scrollbar !overflow-auto"> <Pane size="75" min-size="65" class="hide-scrollbar !overflow-auto">
<Splitpanes <Splitpanes class="smart-splitter" :horizontal="COLUMN_LAYOUT">
class="smart-splitter"
:dbl-click-splitter="false"
:horizontal="COLUMN_LAYOUT"
>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<AppSection label="request"> <AppSection label="request">
<div class="bg-primary flex p-4 top-0 z-10 sticky"> <div class="bg-primary flex p-4 top-0 z-10 sticky">
@@ -60,8 +59,7 @@
</Splitpanes> </Splitpanes>
</Pane> </Pane>
<Pane <Pane
v-if="RIGHT_SIDEBAR" v-if="SIDEBAR"
max-size="35"
size="25" size="25"
min-size="20" min-size="20"
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
@@ -160,8 +158,9 @@ export default defineComponent({
setup() { setup() {
return { return {
windowInnerWidth: useWindowSize(), windowInnerWidth: useWindowSize(),
RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), SIDEBAR: useSetting("SIDEBAR"),
COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
} }
}, },
data() { data() {

View File

@@ -1,15 +1,14 @@
<template> <template>
<Splitpanes <Splitpanes
class="smart-splitter" class="smart-splitter"
:dbl-click-splitter="false" :rtl="SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768"
:class="{
'!flex-row-reverse': SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768,
}"
:horizontal="!(windowInnerWidth.x.value >= 768)" :horizontal="!(windowInnerWidth.x.value >= 768)"
> >
<Pane class="hide-scrollbar !overflow-auto"> <Pane size="75" min-size="65" class="hide-scrollbar !overflow-auto">
<Splitpanes <Splitpanes class="smart-splitter" :horizontal="COLUMN_LAYOUT">
class="smart-splitter"
:dbl-click-splitter="false"
:horizontal="COLUMN_LAYOUT"
>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<AppSection label="request"> <AppSection label="request">
<div class="bg-primary flex p-4 top-0 z-10 sticky"> <div class="bg-primary flex p-4 top-0 z-10 sticky">
@@ -127,8 +126,7 @@
</Splitpanes> </Splitpanes>
</Pane> </Pane>
<Pane <Pane
v-if="RIGHT_SIDEBAR" v-if="SIDEBAR"
max-size="35"
size="25" size="25"
min-size="20" min-size="20"
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
@@ -233,8 +231,9 @@ export default defineComponent({
setup() { setup() {
return { return {
windowInnerWidth: useWindowSize(), windowInnerWidth: useWindowSize(),
RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), SIDEBAR: useSetting("SIDEBAR"),
COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
socketIoClients, socketIoClients,
} }
}, },

View File

@@ -1,9 +1,5 @@
<template> <template>
<Splitpanes <Splitpanes class="smart-splitter" :horizontal="COLUMN_LAYOUT">
class="smart-splitter"
:dbl-click-splitter="false"
:horizontal="COLUMN_LAYOUT"
>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<div class="bg-primary flex p-4 top-0 z-10 sticky"> <div class="bg-primary flex p-4 top-0 z-10 sticky">
<div class="space-x-2 flex-1 inline-flex"> <div class="space-x-2 flex-1 inline-flex">

View File

@@ -1,15 +1,14 @@
<template> <template>
<Splitpanes <Splitpanes
class="smart-splitter" class="smart-splitter"
:dbl-click-splitter="false" :rtl="SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768"
:class="{
'!flex-row-reverse': SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768,
}"
:horizontal="!(windowInnerWidth.x.value >= 768)" :horizontal="!(windowInnerWidth.x.value >= 768)"
> >
<Pane class="hide-scrollbar !overflow-auto"> <Pane size="75" min-size="65" class="hide-scrollbar !overflow-auto">
<Splitpanes <Splitpanes class="smart-splitter" :horizontal="COLUMN_LAYOUT">
class="smart-splitter"
:dbl-click-splitter="false"
:horizontal="COLUMN_LAYOUT"
>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<AppSection label="request"> <AppSection label="request">
<div class="bg-primary flex p-4 top-0 z-10 sticky"> <div class="bg-primary flex p-4 top-0 z-10 sticky">
@@ -175,8 +174,7 @@
</Splitpanes> </Splitpanes>
</Pane> </Pane>
<Pane <Pane
v-if="RIGHT_SIDEBAR" v-if="SIDEBAR"
max-size="35"
size="25" size="25"
min-size="20" min-size="20"
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
@@ -231,8 +229,9 @@ export default defineComponent({
setup() { setup() {
return { return {
windowInnerWidth: useWindowSize(), windowInnerWidth: useWindowSize(),
RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), SIDEBAR: useSetting("SIDEBAR"),
COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
} }
}, },
data() { data() {

View File

@@ -60,7 +60,7 @@ import { defineActionHandler } from "~/helpers/actions"
import useWindowSize from "~/helpers/utils/useWindowSize" import useWindowSize from "~/helpers/utils/useWindowSize"
function appLayout() { function appLayout() {
const rightSidebar = useSetting("RIGHT_SIDEBAR") const rightSidebar = useSetting("SIDEBAR")
const columnLayout = useSetting("COLUMN_LAYOUT") const columnLayout = useSetting("COLUMN_LAYOUT")
const windowInnerWidth = useWindowSize() const windowInnerWidth = useWindowSize()

View File

@@ -330,6 +330,7 @@
"account_name_description": "This is your display name.", "account_name_description": "This is your display name.",
"background": "Background", "background": "Background",
"black_mode": "Black", "black_mode": "Black",
"sidebar_on_left": "Sidebar on left",
"change_font_size": "Change font size", "change_font_size": "Change font size",
"choose_language": "Choose language", "choose_language": "Choose language",
"dark_mode": "Dark", "dark_mode": "Dark",
@@ -347,7 +348,7 @@
"interceptor_description": "Middleware between application and APIs.", "interceptor_description": "Middleware between application and APIs.",
"language": "Language", "language": "Language",
"light_mode": "Light", "light_mode": "Light",
"navigation_sidebar": "Navigation sidebar", "expand_navigation": "Expand navigation",
"official_proxy_hosting": "Official Proxy is hosted by Hoppscotch.", "official_proxy_hosting": "Official Proxy is hosted by Hoppscotch.",
"profile": "Profile", "profile": "Profile",
"profile_description": "Update you profile details", "profile_description": "Update you profile details",

View File

@@ -35,7 +35,6 @@ export type SettingsType = {
PROXY_ENABLED: boolean PROXY_ENABLED: boolean
PROXY_URL: string PROXY_URL: string
PROXY_KEY: string
EXTENSIONS_ENABLED: boolean EXTENSIONS_ENABLED: boolean
URL_EXCLUDES: { URL_EXCLUDES: {
auth: boolean auth: boolean
@@ -47,8 +46,9 @@ export type SettingsType = {
THEME_COLOR: HoppAccentColor THEME_COLOR: HoppAccentColor
BG_COLOR: HoppBgColor BG_COLOR: HoppBgColor
TELEMETRY_ENABLED: boolean TELEMETRY_ENABLED: boolean
LEFT_SIDEBAR: boolean EXPAND_NAVIGATION: boolean
RIGHT_SIDEBAR: boolean SIDEBAR: boolean
SIDEBAR_ON_LEFT: boolean
ZEN_MODE: boolean ZEN_MODE: boolean
FONT_SIZE: HoppFontSize FONT_SIZE: HoppFontSize
COLUMN_LAYOUT: boolean COLUMN_LAYOUT: boolean
@@ -61,7 +61,6 @@ export const defaultSettings: SettingsType = {
PROXY_ENABLED: false, PROXY_ENABLED: false,
PROXY_URL: "https://proxy.hoppscotch.io/", PROXY_URL: "https://proxy.hoppscotch.io/",
PROXY_KEY: "",
EXTENSIONS_ENABLED: true, EXTENSIONS_ENABLED: true,
URL_EXCLUDES: { URL_EXCLUDES: {
auth: true, auth: true,
@@ -73,8 +72,9 @@ export const defaultSettings: SettingsType = {
THEME_COLOR: "indigo", THEME_COLOR: "indigo",
BG_COLOR: "system", BG_COLOR: "system",
TELEMETRY_ENABLED: true, TELEMETRY_ENABLED: true,
LEFT_SIDEBAR: true, EXPAND_NAVIGATION: true,
RIGHT_SIDEBAR: true, SIDEBAR: true,
SIDEBAR_ON_LEFT: false,
ZEN_MODE: false, ZEN_MODE: false,
FONT_SIZE: "small", FONT_SIZE: "small",
COLUMN_LAYOUT: true, COLUMN_LAYOUT: true,

View File

@@ -1,15 +1,14 @@
<template> <template>
<Splitpanes <Splitpanes
class="smart-splitter" class="smart-splitter"
:dbl-click-splitter="false" :rtl="SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768"
:class="{
'!flex-row-reverse': SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768,
}"
:horizontal="!(windowInnerWidth.x.value >= 768)" :horizontal="!(windowInnerWidth.x.value >= 768)"
> >
<Pane class="hide-scrollbar !overflow-auto"> <Pane size="75" min-size="65" class="hide-scrollbar !overflow-auto">
<Splitpanes <Splitpanes class="smart-splitter" :horizontal="COLUMN_LAYOUT">
class="smart-splitter"
:dbl-click-splitter="false"
:horizontal="COLUMN_LAYOUT"
>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<AppSection label="import"> <AppSection label="import">
<div class="flex p-4 items-start justify-between"> <div class="flex p-4 items-start justify-between">
@@ -157,8 +156,7 @@
</Splitpanes> </Splitpanes>
</Pane> </Pane>
<Pane <Pane
v-if="RIGHT_SIDEBAR" v-if="SIDEBAR"
max-size="35"
size="25" size="25"
min-size="20" min-size="20"
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
@@ -193,9 +191,10 @@ export default defineComponent({
setup() { setup() {
return { return {
windowInnerWidth: useWindowSize(), windowInnerWidth: useWindowSize(),
RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), SIDEBAR: useSetting("SIDEBAR"),
COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"),
currentUser: useReadonlyStream(currentUser$, null), currentUser: useReadonlyStream(currentUser$, null),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
} }
}, },
data() { data() {

View File

@@ -1,15 +1,14 @@
<template> <template>
<Splitpanes <Splitpanes
class="smart-splitter" class="smart-splitter"
:dbl-click-splitter="false" :rtl="SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768"
:class="{
'!flex-row-reverse': SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768,
}"
:horizontal="!(windowInnerWidth.x.value >= 768)" :horizontal="!(windowInnerWidth.x.value >= 768)"
> >
<Pane class="hide-scrollbar !overflow-auto"> <Pane size="75" min-size="65" class="hide-scrollbar !overflow-auto">
<Splitpanes <Splitpanes class="smart-splitter" :horizontal="COLUMN_LAYOUT">
class="smart-splitter"
:dbl-click-splitter="false"
:horizontal="COLUMN_LAYOUT"
>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<GraphqlRequest :conn="gqlConn" /> <GraphqlRequest :conn="gqlConn" />
<GraphqlRequestOptions :conn="gqlConn" /> <GraphqlRequestOptions :conn="gqlConn" />
@@ -20,8 +19,7 @@
</Splitpanes> </Splitpanes>
</Pane> </Pane>
<Pane <Pane
v-if="RIGHT_SIDEBAR" v-if="SIDEBAR"
max-size="35"
size="25" size="25"
min-size="20" min-size="20"
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
@@ -62,8 +60,9 @@ export default defineComponent({
return { return {
windowInnerWidth: useWindowSize(), windowInnerWidth: useWindowSize(),
RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), SIDEBAR: useSetting("SIDEBAR"),
COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
gqlConn, gqlConn,
} }
}, },

View File

@@ -1,15 +1,14 @@
<template> <template>
<Splitpanes <Splitpanes
class="smart-splitter" class="smart-splitter"
:dbl-click-splitter="false" :rtl="SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768"
:class="{
'!flex-row-reverse': SIDEBAR_ON_LEFT && windowInnerWidth.x.value >= 768,
}"
:horizontal="!(windowInnerWidth.x.value >= 768)" :horizontal="!(windowInnerWidth.x.value >= 768)"
> >
<Pane class="hide-scrollbar !overflow-auto"> <Pane size="75" min-size="65" class="hide-scrollbar !overflow-auto">
<Splitpanes <Splitpanes class="smart-splitter" :horizontal="COLUMN_LAYOUT">
class="smart-splitter"
:dbl-click-splitter="false"
:horizontal="COLUMN_LAYOUT"
>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<HttpRequest /> <HttpRequest />
<SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10"> <SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
@@ -59,8 +58,7 @@
</Splitpanes> </Splitpanes>
</Pane> </Pane>
<Pane <Pane
v-if="RIGHT_SIDEBAR" v-if="SIDEBAR"
max-size="35"
size="25" size="25"
min-size="20" min-size="20"
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
@@ -296,8 +294,9 @@ export default defineComponent({
), ),
null null
), ),
RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), SIDEBAR: useSetting("SIDEBAR"),
COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
confirmSync, confirmSync,
syncRequest, syncRequest,
oAuthURL, oAuthURL,

View File

@@ -72,28 +72,27 @@
<div class="flex items-center"> <div class="flex items-center">
<SmartToggle :on="TELEMETRY_ENABLED" @change="showConfirmModal"> <SmartToggle :on="TELEMETRY_ENABLED" @change="showConfirmModal">
{{ $t("settings.telemetry") }} {{ $t("settings.telemetry") }}
{{
TELEMETRY_ENABLED
? $t("state.enabled")
: $t("state.disabled")
}}
</SmartToggle> </SmartToggle>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<SmartToggle <SmartToggle
:on="LEFT_SIDEBAR" :on="EXPAND_NAVIGATION"
@change="toggleSetting('LEFT_SIDEBAR')" @change="toggleSetting('EXPAND_NAVIGATION')"
> >
{{ $t("settings.navigation_sidebar") }} {{ $t("settings.expand_navigation") }}
{{ </SmartToggle>
LEFT_SIDEBAR ? $t("state.enabled") : $t("state.disabled") </div>
}} <div class="flex items-center">
<SmartToggle
:on="SIDEBAR_ON_LEFT"
@change="toggleSetting('SIDEBAR_ON_LEFT')"
>
{{ $t("settings.sidebar_on_left") }}
</SmartToggle> </SmartToggle>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<SmartToggle :on="ZEN_MODE" @change="toggleSetting('ZEN_MODE')"> <SmartToggle :on="ZEN_MODE" @change="toggleSetting('ZEN_MODE')">
{{ $t("layout.zen_mode") }} {{ $t("layout.zen_mode") }}
{{ ZEN_MODE ? $t("state.enabled") : $t("state.disabled") }}
</SmartToggle> </SmartToggle>
</div> </div>
</div> </div>
@@ -258,11 +257,10 @@ export default defineComponent({
return { return {
PROXY_ENABLED: useSetting("PROXY_ENABLED"), PROXY_ENABLED: useSetting("PROXY_ENABLED"),
PROXY_URL: useSetting("PROXY_URL"), PROXY_URL: useSetting("PROXY_URL"),
PROXY_KEY: useSetting("PROXY_KEY"),
EXTENSIONS_ENABLED: useSetting("EXTENSIONS_ENABLED"), EXTENSIONS_ENABLED: useSetting("EXTENSIONS_ENABLED"),
EXPERIMENTAL_URL_BAR_ENABLED: useSetting("EXPERIMENTAL_URL_BAR_ENABLED"),
TELEMETRY_ENABLED: useSetting("TELEMETRY_ENABLED"), TELEMETRY_ENABLED: useSetting("TELEMETRY_ENABLED"),
LEFT_SIDEBAR: useSetting("LEFT_SIDEBAR"), EXPAND_NAVIGATION: useSetting("EXPAND_NAVIGATION"),
SIDEBAR_ON_LEFT: useSetting("SIDEBAR_ON_LEFT"),
ZEN_MODE: useSetting("ZEN_MODE"), ZEN_MODE: useSetting("ZEN_MODE"),
} }
}, },
@@ -287,22 +285,20 @@ export default defineComponent({
} }
}, },
computed: { computed: {
proxySettings(): { url: string; key: string } { proxySettings(): { url: string } {
return { return {
url: this.PROXY_URL, url: this.PROXY_URL,
key: this.PROXY_KEY,
} }
}, },
}, },
watch: { watch: {
ZEN_MODE(ZEN_MODE) { ZEN_MODE(ZEN_MODE) {
this.applySetting("LEFT_SIDEBAR", !ZEN_MODE) this.applySetting("EXPAND_NAVIGATION", !ZEN_MODE)
}, },
proxySettings: { proxySettings: {
deep: true, deep: true,
handler({ url, key }) { handler({ url }) {
this.applySetting("PROXY_URL", url) this.applySetting("PROXY_URL", url)
this.applySetting("PROXY_KEY", key)
}, },
}, },
}, },