diff --git a/front/src/components/ui/Modal.vue b/front/src/components/ui/Modal.vue index 3ceb0be5a..6e8eebb08 100644 --- a/front/src/components/ui/Modal.vue +++ b/front/src/components/ui/Modal.vue @@ -12,7 +12,8 @@ const props = defineProps<{ title: string, overPopover?: true, destructive?: true, - cancel?: string + cancel?: string, + icon? : string } & (ColorProps | DefaultProps)>() const isOpen = defineModel({ default: false }) @@ -52,15 +53,18 @@ onKeyboardShortcut('escape', () => isOpen.value = false) v-bind="{...$attrs, ...color(props)}" > -
- +
+
+
- + + - +
@@ -86,7 +92,6 @@ onKeyboardShortcut('escape', () => isOpen.value = false) {{ cancel }} -
diff --git a/front/ui-docs/components/ui/modal.md b/front/ui-docs/components/ui/modal.md index 1914f7136..4d4477051 100644 --- a/front/ui-docs/components/ui/modal.md +++ b/front/ui-docs/components/ui/modal.md @@ -3,6 +3,7 @@ import { ref, watchEffect } from 'vue' import Alert from '~/components/ui/Alert.vue' import Button from '~/components/ui/Button.vue' +import Input from '~/components/ui/Input.vue' import Modal from '~/components/ui/Modal.vue' import Layout from '~/components/ui/Layout.vue' @@ -25,6 +26,8 @@ const isOpen8 = ref(false) const isOpen9 = ref(false) const isOpen10 = ref(false) +const input = ref('Episcosaurus') + ```ts @@ -111,27 +114,22 @@ The `cancel` prop accepts a string and will add a cancel button. Note that the Cancel button has `autofocus`. If you want another button to auto-focus, implement the Cancel button manually inside the `#action` slot. -## Add elements to the top left corner +## Customize the title bar -Use this slot for indicators such as the user's photo. +Use the `icon` prop and/or the `#topleft` slot for indicators such as the user's photo or a search input. You can hide the title by setting it to `""`. - - Modal content + - + No information pages found for {{ input }} -## Alert inside modal + +## Add a main alert You can nest [Funkwhale alerts](./alert) to visually highlight content within the modal.