mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 11:36:05 +00:00
* feat: refactor button components
* fix: qa
* fix: storybook
* a11y: pass
* fix: build
* fix: rename default ->md
* fix: lint
* docs: buttons.md
* refactor part 1
* refactor part 2
* fix: undo refactor for fresh restart
* refactor
* Revert "refactor"
This reverts commit 96d65902d7.
* refactor: part 1
* fix: qa
* fix: qa
* fix: qa
* fix: qa
* fix: qa
* fix: qa
* fix: qa
* fix: qa
* fix: remove text-contrast
* fix: qa
* fix: v-tooltip
* fix: lint
* fix: split broken
* fix: passkey qa
* fix: qa
* fix: qa
* fix: prepr
* fix: splitbutton
* improve button group seam
---------
Signed-off-by: Calum H. <calum@modrinth.com>
Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
75 lines
1.7 KiB
Vue
75 lines
1.7 KiB
Vue
<template>
|
|
<NewModal ref="modal" :header="formatMessage(messages.header)" fade="danger" max-width="500px">
|
|
<Admonition type="critical" :header="formatMessage(messages.admonitionHeader)">
|
|
{{ formatMessage(messages.admonitionBody) }}
|
|
</Admonition>
|
|
|
|
<template #actions>
|
|
<div class="flex gap-2 justify-end">
|
|
<Button type="outlined" @click="modal?.hide()">
|
|
<XIcon />
|
|
{{ formatMessage(commonMessages.cancelButton) }}
|
|
</Button>
|
|
<Button type="colored" color="red" @click="confirm">
|
|
<TrashIcon />
|
|
{{ formatMessage(messages.deleteButton) }}
|
|
</Button>
|
|
</div>
|
|
</template>
|
|
</NewModal>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { TrashIcon, XIcon } from '@modrinth/assets'
|
|
import {
|
|
Admonition,
|
|
Button,
|
|
commonMessages,
|
|
defineMessages,
|
|
NewModal,
|
|
useVIntl,
|
|
} from '@modrinth/ui'
|
|
import { ref } from 'vue'
|
|
|
|
const { formatMessage } = useVIntl()
|
|
|
|
const messages = defineMessages({
|
|
header: {
|
|
id: 'app.instance.confirm-delete.header',
|
|
defaultMessage: 'Delete instance',
|
|
},
|
|
admonitionHeader: {
|
|
id: 'app.instance.confirm-delete.admonition-header',
|
|
defaultMessage: 'This action cannot be undone',
|
|
},
|
|
admonitionBody: {
|
|
id: 'app.instance.confirm-delete.admonition-body',
|
|
defaultMessage:
|
|
'All data for your instance will be permanently deleted, including your worlds, configs, and all installed content.',
|
|
},
|
|
deleteButton: {
|
|
id: 'app.instance.confirm-delete.delete-button',
|
|
defaultMessage: 'Delete instance',
|
|
},
|
|
})
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'delete'): void
|
|
}>()
|
|
|
|
const modal = ref<InstanceType<typeof NewModal>>()
|
|
|
|
function show() {
|
|
modal.value?.show()
|
|
}
|
|
|
|
function confirm() {
|
|
modal.value?.hide()
|
|
emit('delete')
|
|
}
|
|
|
|
defineExpose({
|
|
show,
|
|
})
|
|
</script>
|