UPD: Optionally foldable sections
This commit is contained in:
@@ -5,6 +5,8 @@ import ConfigPane from '@/components/config/ConfigPane.vue'
|
|||||||
import Navbar from '@/components/Navbar.vue'
|
import Navbar from '@/components/Navbar.vue'
|
||||||
import ConfigSelect from '@/components/config/ConfigSelect.vue'
|
import ConfigSelect from '@/components/config/ConfigSelect.vue'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
import ConfigSection from '@/components/config/ConfigSection.vue'
|
||||||
|
import { Bolt } from 'lucide-vue-next'
|
||||||
|
|
||||||
const currentConfigPage = ref('profile_settings')
|
const currentConfigPage = ref('profile_settings')
|
||||||
|
|
||||||
@@ -16,7 +18,9 @@ const currentConfigPage = ref('profile_settings')
|
|||||||
<ProfileManager class="border-solid border-0 border-r bg-zinc-900 bg-opacity-30" style="width: 20rem" />
|
<ProfileManager class="border-solid border-0 border-r bg-zinc-900 bg-opacity-30" style="width: 20rem" />
|
||||||
<div class="border-solid border-0 border-r" style="width: 25rem">
|
<div class="border-solid border-0 border-r" style="width: 25rem">
|
||||||
<DevicePreview />
|
<DevicePreview />
|
||||||
|
<ConfigSection :title="$t('config_options.title')" :foldable="false" :icon-component="Bolt">
|
||||||
<ConfigSelect v-model="currentConfigPage" />
|
<ConfigSelect v-model="currentConfigPage" />
|
||||||
|
</ConfigSection>
|
||||||
</div>
|
</div>
|
||||||
<ConfigPane
|
<ConfigPane
|
||||||
:page="currentConfigPage"
|
:page="currentConfigPage"
|
||||||
|
|||||||
@@ -5,14 +5,13 @@
|
|||||||
class="flex-1 flex items-center px-4"
|
class="flex-1 flex items-center px-4"
|
||||||
:class="{'cursor-pointer hover:bg-zinc-800': showToggle}"
|
:class="{'cursor-pointer hover:bg-zinc-800': showToggle}"
|
||||||
@click="toggle = !toggle">
|
@click="toggle = !toggle">
|
||||||
<component :is="iconComponent" class="h-4 w-4" />
|
<component :is="iconComponent" v-if="iconComponent" class="h-4 w-4 mr-2" />
|
||||||
<h2 class="text-sm px-2 py-4">{{ title }}</h2>
|
<h2 class="text-sm py-4">{{ title }}</h2>
|
||||||
<Switch
|
<Switch
|
||||||
v-if="showToggle" :checked="toggle"
|
v-if="showToggle" :checked="toggle"
|
||||||
class="ml-auto" @click.stop="toggle=!toggle" />
|
class="ml-auto" @click.stop="toggle=!toggle" />
|
||||||
</div>
|
</div>
|
||||||
|
<CollapsibleTrigger v-if="foldable" class="flex items-center justify-center h-12 aspect-square hover:bg-zinc-800">
|
||||||
<CollapsibleTrigger class="flex items-center justify-center h-12 aspect-square hover:bg-zinc-800">
|
|
||||||
<ChevronLeft class="chevrot h-4 w-4 mt-0.5 transition-transform text-muted-foreground" />
|
<ChevronLeft class="chevrot h-4 w-4 mt-0.5 transition-transform text-muted-foreground" />
|
||||||
</CollapsibleTrigger>
|
</CollapsibleTrigger>
|
||||||
</div>
|
</div>
|
||||||
@@ -41,12 +40,16 @@ defineProps({
|
|||||||
},
|
},
|
||||||
iconComponent: {
|
iconComponent: {
|
||||||
type: [String, Object],
|
type: [String, Object],
|
||||||
default: 'div',
|
default: undefined,
|
||||||
},
|
},
|
||||||
showToggle: {
|
showToggle: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
foldable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -31,9 +31,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row h-12 items-center px-4 text-sm bg-zinc-900">
|
|
||||||
<h2>{{ $t('config_options.title') }}</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Reference in New Issue
Block a user