mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 19:46:33 +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>
95 lines
2.3 KiB
Vue
95 lines
2.3 KiB
Vue
<template>
|
|
<NewModal ref="modal" :header="formatMessage(messages.header)" fade="warning" max-width="500px">
|
|
<p class="m-0 text-secondary">
|
|
<IntlFormatted :message-id="messages.body" :values="{ instanceName }">
|
|
<template #bold="{ children }">
|
|
<span class="font-medium text-contrast"><component :is="() => children" /></span>
|
|
</template>
|
|
</IntlFormatted>
|
|
</p>
|
|
|
|
<template #actions>
|
|
<div class="flex justify-end gap-2">
|
|
<Button type="outlined" @click="handleCancel">
|
|
<XIcon />
|
|
{{ formatMessage(commonMessages.cancelButton) }}
|
|
</Button>
|
|
<Button @click="handleGoToInstance">
|
|
{{ formatMessage(messages.instance) }}
|
|
<RightArrowIcon />
|
|
</Button>
|
|
<Button type="colored" color="orange" @click="handleInstallAnyway">
|
|
<DownloadIcon />
|
|
{{ formatMessage(messages.installAnyway) }}
|
|
</Button>
|
|
</div>
|
|
</template>
|
|
</NewModal>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { DownloadIcon, RightArrowIcon, XIcon } from '@modrinth/assets'
|
|
import {
|
|
Button,
|
|
commonMessages,
|
|
defineMessages,
|
|
IntlFormatted,
|
|
NewModal,
|
|
useVIntl,
|
|
} from '@modrinth/ui'
|
|
import { ref } from 'vue'
|
|
|
|
const { formatMessage } = useVIntl()
|
|
|
|
const messages = defineMessages({
|
|
header: {
|
|
id: 'app.instance.shared-instance-already-installed.header',
|
|
defaultMessage: 'Shared instance already installed',
|
|
},
|
|
body: {
|
|
id: 'app.instance.shared-instance-already-installed.body',
|
|
defaultMessage:
|
|
'This shared instance is already installed as <bold>{instanceName}</bold>. Are you sure you want to install another copy?',
|
|
},
|
|
instance: {
|
|
id: 'app.instance.shared-instance-already-installed.instance',
|
|
defaultMessage: 'Instance',
|
|
},
|
|
installAnyway: {
|
|
id: 'app.instance.shared-instance-already-installed.install-anyway',
|
|
defaultMessage: 'Install anyway',
|
|
},
|
|
})
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'cancel' | 'go-to-instance' | 'install-anyway'): void
|
|
}>()
|
|
|
|
const modal = ref<InstanceType<typeof NewModal>>()
|
|
const instanceName = ref('')
|
|
|
|
function show(name: string) {
|
|
instanceName.value = name
|
|
modal.value?.show()
|
|
}
|
|
|
|
function handleCancel() {
|
|
modal.value?.hide()
|
|
emit('cancel')
|
|
}
|
|
|
|
function handleGoToInstance() {
|
|
modal.value?.hide()
|
|
emit('go-to-instance')
|
|
}
|
|
|
|
function handleInstallAnyway() {
|
|
modal.value?.hide()
|
|
emit('install-anyway')
|
|
}
|
|
|
|
defineExpose({
|
|
show,
|
|
})
|
|
</script>
|