fix: settings ui

This commit is contained in:
Jannat Patel
2024-08-14 12:12:13 +05:30
parent a710183bc7
commit 6b12df44a0
2 changed files with 62 additions and 70 deletions

View File

@@ -1,5 +1,5 @@
<template> <template>
<Dialog v-model="show" :options="{ size: '6xl' }"> <Dialog v-model="show" :options="{ size: '3xl' }">
<template #body> <template #body>
<div class="flex h-[calc(100vh_-_8rem)]"> <div class="flex h-[calc(100vh_-_8rem)]">
<div class="flex w-52 shrink-0 flex-col bg-gray-50 p-2"> <div class="flex w-52 shrink-0 flex-col bg-gray-50 p-2">
@@ -97,7 +97,7 @@ const tabs = computed(() => {
type: 'checkbox', type: 'checkbox',
}, },
{ {
label: 'Apply rounding on equivalent amount', label: 'Apply rounding on equivalent',
name: 'apply_rounding', name: 'apply_rounding',
type: 'checkbox', type: 'checkbox',
}, },
@@ -105,62 +105,6 @@ const tabs = computed(() => {
}, },
], ],
}, },
{
label: 'Settings',
hideLabel: true,
items: [
{
label: 'Signup',
icon: 'LogIn',
fields: [
{
label: 'Show terms of use on signup page',
name: 'terms_of_use',
type: 'checkbox',
},
{
label: 'Terms of Use Page',
name: 'terms_page',
type: 'Link',
doctype: 'Web Page',
},
{
label: 'Ask user category during signup',
name: 'user_category',
type: 'checkbox',
},
{
type: 'Column Break',
},
{
label: 'Show privacy policy on signup page',
name: 'privacy_policy',
type: 'checkbox',
},
{
label: 'Privacy Policy Page',
name: 'privacy_policy_page',
type: 'Link',
doctype: 'Web Page',
},
{
type: 'Column Break',
},
{
label: 'Show cookie policy on signup page',
name: 'cookie_policy',
type: 'checkbox',
},
{
label: 'Cookie Policy Page',
name: 'cookie_policy_page',
type: 'Link',
doctype: 'Web Page',
},
],
},
],
},
{ {
label: 'Settings', label: 'Settings',
hideLabel: true, hideLabel: true,
@@ -236,6 +180,62 @@ const tabs = computed(() => {
}, },
], ],
}, },
{
label: 'Settings',
hideLabel: true,
items: [
{
label: 'Signup',
icon: 'LogIn',
fields: [
{
label: 'Show terms of use on signup',
name: 'terms_of_use',
type: 'checkbox',
},
{
label: 'Terms of Use Page',
name: 'terms_page',
type: 'Link',
doctype: 'Web Page',
},
{
label: 'Show privacy policy on signup',
name: 'privacy_policy',
type: 'checkbox',
},
{
label: 'Privacy Policy Page',
name: 'privacy_policy_page',
type: 'Link',
doctype: 'Web Page',
},
{
type: 'Column Break',
},
{
label: 'Show cookie policy on signup',
name: 'cookie_policy',
type: 'checkbox',
},
{
label: 'Cookie Policy Page',
name: 'cookie_policy_page',
type: 'Link',
doctype: 'Web Page',
},
{
label: 'Ask user category during signup',
name: 'user_category',
type: 'checkbox',
},
],
},
],
},
/* { /* {
label: 'Settings', label: 'Settings',
hideLabel: true, hideLabel: true,

View File

@@ -1,9 +1,9 @@
<template> <template>
<div class="flex flex-col justify-between h-full p-8"> <div class="flex flex-col justify-between h-full p-8">
<div class="flex space-x-10"> <div class="flex space-x-8">
<div v-for="(column, index) in columns" :key="index"> <div v-for="(column, index) in columns" :key="index">
<div class="flex flex-col space-y-4"> <div class="flex flex-col space-y-4 w-60">
<div v-for="field in column" :class="width"> <div v-for="field in column">
<Link <Link
v-if="field.type == 'Link'" v-if="field.type == 'Link'"
v-model="field.value" v-model="field.value"
@@ -31,11 +31,9 @@
<script setup> <script setup>
import { FormControl, Button } from 'frappe-ui' import { FormControl, Button } from 'frappe-ui'
import { computed, ref } from 'vue' import { computed } from 'vue'
import Link from '@/components/Controls/Link.vue' import Link from '@/components/Controls/Link.vue'
let width = ref('w-full')
const props = defineProps({ const props = defineProps({
fields: { fields: {
type: Array, type: Array,
@@ -71,12 +69,6 @@ const columns = computed(() => {
cols.push(currentColumn) cols.push(currentColumn)
} }
if (cols.length == 3) {
width.value = 'w-64'
} else {
width.value = 'w-96'
}
return cols return cols
}) })