Skip to content

Commit 7ed9423

Browse files
committed
form color reset
1 parent 5020f9f commit 7ed9423

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

client/components/open/forms/components/form-components/FormCustomization.vue

+15-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,19 @@
141141
<color-input
142142
name="color"
143143
:form="form"
144-
label="Color (for buttons & inputs border)"
145-
/>
144+
>
145+
<template #help>
146+
<InputHelp>
147+
<span class="text-gray-500">
148+
For buttons & input borders - <a
149+
href="#"
150+
@click.prevent="form.color = DEFAULT_COLOR"
151+
>Reset</a>
152+
</span>
153+
</InputHelp>
154+
</template>
155+
</color-input>
156+
146157
<toggle-switch-input
147158
name="hide_title"
148159
:form="form"
@@ -204,6 +215,8 @@ import { useWorkingFormStore } from "../../../../../stores/working_form"
204215
import EditorOptionsPanel from "../../../editors/EditorOptionsPanel.vue"
205216
import GoogleFontPicker from "../../../editors/GoogleFontPicker.vue"
206217
import ProTag from "~/components/global/ProTag.vue"
218+
import { DEFAULT_COLOR } from "@/composables/forms/initForm"
219+
207220
208221
const workingFormStore = useWorkingFormStore()
209222
const subscriptionModalStore = useSubscriptionModalStore()

client/composables/forms/initForm.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { generateUUID } from "~/lib/utils.js"
2+
export const DEFAULT_COLOR = '#3B82F6'
23

34
export const initForm = (defaultValue = {}, withDefaultProperties = false) => {
45
return useForm({
@@ -13,7 +14,7 @@ export const initForm = (defaultValue = {}, withDefaultProperties = false) => {
1314
theme: "default",
1415
width: "centered",
1516
dark_mode: "auto",
16-
color: "#3B82F6",
17+
color: DEFAULT_COLOR,
1718
hide_title: false,
1819
no_branding: false,
1920
uppercase_labels: false,

0 commit comments

Comments
 (0)