41db1 submission editor theme fix (#500)

* fix password reset bug

* fix: themes on submission editor
This commit is contained in:
Favour Olayinka 2024-07-24 08:50:42 +01:00 committed by GitHub
parent 91037ab242
commit 5f320fbc23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 39 additions and 13 deletions

View File

@ -98,11 +98,20 @@
<script>
import Webcam from "webcam-easy"
import { themes } from "~/lib/forms/themes/form-themes.js"
import CachedDefaultTheme from "~/lib/forms/themes/CachedDefaultTheme.js"
export default {
name: "FileInput",
props: {
theme: { type: Object, default: () => themes.default },
theme: {
type: Object, default: () => {
const theme = inject("theme", null)
if (theme) {
return theme.value
}
return CachedDefaultTheme.getInstance()
}
},
},
emits: ['stopWebcam', 'uploadImage'],
data: () => ({

View File

@ -28,11 +28,20 @@
<script setup>
import { ref, defineProps, defineEmits } from "vue"
import OpenForm from "../forms/OpenForm.vue"
import { themes } from "~/lib/forms/themes/form-themes.js"
import CachedDefaultTheme from "~/lib/forms/themes/CachedDefaultTheme.js"
const props = defineProps({
show: { type: Boolean, required: true },
form: { type: Object, required: true },
theme: { type: Object, default: themes.default },
theme: {
type: Object, default: () => {
const theme = inject("theme", null)
if (theme) {
return theme.value
}
return CachedDefaultTheme.getInstance()
}
},
submission: { type: Object },
})

View File

@ -141,14 +141,14 @@ export default {
required: true
},
theme: {
type: Object, default: () => {
const theme = inject("theme", null)
if (theme) {
return theme.value
type: Object, default: () => {
const theme = inject("theme", null)
if (theme) {
return theme.value
}
return CachedDefaultTheme.getInstance()
}
return CachedDefaultTheme.getInstance()
}
},
},
loading: {
type: Boolean,
required: true

View File

@ -1,4 +1,4 @@
import { themes } from "~/lib/forms/themes/form-themes.js"
import CachedDefaultTheme from "~/lib/forms/themes/CachedDefaultTheme.js"
import { default as _has } from "lodash/has"
export default {
@ -14,7 +14,15 @@ export default {
uppercaseLabels: { type: Boolean, default: false },
help: { type: String, default: null },
helpPosition: { type: String, default: "below_input" },
theme: { type: Object, default: () => themes.default },
theme: {
type: Object, default: () => {
const theme = inject("theme", null)
if (theme) {
return theme.value
}
return CachedDefaultTheme.getInstance()
}
},
color: { type: String, default: "#3B82F6" },
wrapperClass: { type: String, default: "relative mb-3" },
},