mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 17:14: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>
59 lines
1.9 KiB
Vue
59 lines
1.9 KiB
Vue
<template>
|
|
<div class="flex flex-col gap-2.5">
|
|
<div class="flex items-center justify-between">
|
|
<span class="font-semibold text-contrast">{{
|
|
heading ?? formatMessage(messages.sharedInstance)
|
|
}}</span>
|
|
<Button type="quiet" @click="emit('viewContents')">
|
|
<EyeIcon />
|
|
{{ formatMessage(messages.viewContents) }}
|
|
</Button>
|
|
</div>
|
|
<div class="flex items-center gap-3 rounded-2xl bg-surface-2 p-3">
|
|
<Avatar
|
|
:src="preview.iconUrl"
|
|
:alt="preview.name"
|
|
size="56px"
|
|
no-shadow
|
|
class="!rounded-2xl"
|
|
/>
|
|
<div class="flex min-w-0 flex-col gap-0.5">
|
|
<span class="truncate font-semibold text-contrast">{{ preview.name }}</span>
|
|
<span class="truncate text-sm font-medium text-secondary">
|
|
{{ loaderDisplay }} {{ preview.gameVersion }}
|
|
<template v-if="preview.modCount">
|
|
· {{ formatMessage(messages.modCount, { count: preview.modCount }) }}
|
|
</template>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { EyeIcon } from '@modrinth/assets'
|
|
import { Avatar, Button, defineMessages, formatLoader, useVIntl } from '@modrinth/ui'
|
|
import { computed, toRefs } from 'vue'
|
|
|
|
import type { SharedInstanceInstallPreview } from '@/helpers/install'
|
|
|
|
const props = defineProps<{ preview: SharedInstanceInstallPreview; heading?: string }>()
|
|
const { preview, heading } = toRefs(props)
|
|
const emit = defineEmits<{ viewContents: [] }>()
|
|
const { formatMessage } = useVIntl()
|
|
const loaderDisplay = computed(() =>
|
|
preview.value.loader ? formatLoader(formatMessage, preview.value.loader) : '',
|
|
)
|
|
const messages = defineMessages({
|
|
sharedInstance: {
|
|
id: 'app.modal.install-to-play.shared-instance',
|
|
defaultMessage: 'Shared instance',
|
|
},
|
|
viewContents: { id: 'app.modal.install-to-play.view-contents', defaultMessage: 'View contents' },
|
|
modCount: {
|
|
id: 'app.modal.install-to-play.mod-count',
|
|
defaultMessage: '{count, plural, one {# mod} other {# mods}}',
|
|
},
|
|
})
|
|
</script>
|