mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 17:44:50 +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>
71 lines
1.9 KiB
Vue
71 lines
1.9 KiB
Vue
<template>
|
|
<Admonition
|
|
type="info"
|
|
inline-actions
|
|
:header="formatMessage(messages.sharedInstanceChangesHeader)"
|
|
>
|
|
{{ formatMessage(messages.sharedInstanceChangesBody) }}
|
|
<template #actions>
|
|
<Button
|
|
type="colored"
|
|
color="blue"
|
|
size="lg"
|
|
:disabled="isPublishButtonDisabled"
|
|
@click="reviewChanges"
|
|
>
|
|
<SpinnerIcon
|
|
v-if="isReviewingPublish || isPublishing"
|
|
class="animate-spin"
|
|
aria-hidden="true"
|
|
/>
|
|
<UploadIcon v-else aria-hidden="true" />
|
|
{{
|
|
isPublishing
|
|
? formatMessage(messages.sharedInstancePublishingButton)
|
|
: isReviewingPublish
|
|
? formatMessage(messages.sharedInstanceReviewingButton)
|
|
: formatMessage(messages.sharedInstancePublishButton)
|
|
}}
|
|
</Button>
|
|
</template>
|
|
</Admonition>
|
|
|
|
<SharedInstancePublishModal
|
|
ref="publishModal"
|
|
:instance="instance"
|
|
@published="emit('published')"
|
|
@state-change="publishState = $event"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { SpinnerIcon, UploadIcon } from '@modrinth/assets'
|
|
import { Admonition, Button, useVIntl } from '@modrinth/ui'
|
|
import { computed, ref } from 'vue'
|
|
|
|
import SharedInstancePublishModal from '@/components/ui/shared-instances/SharedInstancePublishModal.vue'
|
|
import type { GameInstance } from '@/helpers/types'
|
|
|
|
import { instanceAdmonitionsMessages as messages } from './messages'
|
|
|
|
defineProps<{
|
|
instance: GameInstance
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
published: []
|
|
}>()
|
|
|
|
const { formatMessage } = useVIntl()
|
|
const publishModal = ref<InstanceType<typeof SharedInstancePublishModal>>()
|
|
const publishState = ref<'idle' | 'reviewing' | 'publishing'>('idle')
|
|
const isPublishing = computed(() => publishState.value === 'publishing')
|
|
const isReviewingPublish = computed(() => publishState.value === 'reviewing')
|
|
|
|
const isPublishButtonDisabled = computed(() => isPublishing.value || isReviewingPublish.value)
|
|
|
|
function reviewChanges(e?: MouseEvent) {
|
|
publishModal.value?.show(e)
|
|
}
|
|
</script>
|