Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import {
MonitorIcon,
WrenchIcon,
} from '@modrinth/assets'
import { Avatar, defineMessage, TabbedModal, type TabbedModalTab, useVIntl } from '@modrinth/ui'
import {
Avatar,
commonMessages,
defineMessage,
TabbedModal,
type TabbedModalTab,
useVIntl,
} from '@modrinth/ui'
import { convertFileSrc } from '@tauri-apps/api/core'
import { ref } from 'vue'

Expand Down Expand Up @@ -74,11 +81,6 @@ function show() {
}

defineExpose({ show })

const titleMessage = defineMessage({
id: 'instance.settings.title',
defaultMessage: 'Settings',
})
</script>
<template>
<ModalWrapper ref="modal">
Expand All @@ -90,7 +92,9 @@ const titleMessage = defineMessage({
:tint-by="props.instance.path"
/>
{{ instance.name }} <ChevronRightIcon />
<span class="font-extrabold text-contrast">{{ formatMessage(titleMessage) }}</span>
<span class="font-extrabold text-contrast">{{
formatMessage(commonMessages.settingsLabel)
}}</span>
</span>
</template>

Expand Down
29 changes: 7 additions & 22 deletions apps/frontend/src/components/ui/ProjectMemberHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<ButtonStyled color="brand">
<button class="brand-button" @click="acceptInvite()">
<CheckIcon />
{{ getFormattedMessage(messages.accept) }}
{{ getFormattedMessage(commonMessages.acceptButton) }}
</button>
</ButtonStyled>
<ButtonStyled color="red">
<button @click="declineInvite">
<XIcon />
{{ getFormattedMessage(messages.decline) }}
{{ getFormattedMessage(commonMessages.declineButton) }}
</button>
</ButtonStyled>
</div>
Expand All @@ -26,6 +26,7 @@
import { CheckIcon, XIcon } from '@modrinth/assets'
import {
ButtonStyled,
commonMessages,
defineMessages,
injectNotificationManager,
type MessageDescriptor,
Expand Down Expand Up @@ -81,14 +82,6 @@ const messages = defineMessages({
defaultMessage:
"You've been invited to join this project. Please accept or decline the invitation.",
},
accept: {
id: 'project-member-header.accept',
defaultMessage: 'Accept',
},
decline: {
id: 'project-member-header.decline',
defaultMessage: 'Decline',
},
successJoin: {
id: 'project-member-header.success-join',
defaultMessage: 'You have joined the project team',
Expand All @@ -105,14 +98,6 @@ const messages = defineMessages({
id: 'project-member-header.error-decline',
defaultMessage: 'Failed to decline team invitation',
},
success: {
id: 'project-member-header.success',
defaultMessage: 'Success',
},
error: {
id: 'project-member-header.error',
defaultMessage: 'Error',
},
})

const { formatMessage } = useVIntl()
Expand Down Expand Up @@ -171,13 +156,13 @@ async function acceptInvite(): Promise<void> {
await acceptTeamInvite(props.project.team)
await handleUpdateMembers()
addNotification({
title: formatMessage(messages.success),
title: formatMessage(commonMessages.successLabel),
text: formatMessage(messages.successJoin),
type: 'success',
})
} catch {
addNotification({
title: formatMessage(messages.error),
title: formatMessage(commonMessages.errorLabel),
text: formatMessage(messages.errorJoin),
type: 'error',
})
Expand All @@ -192,13 +177,13 @@ async function declineInvite(): Promise<void> {
await removeTeamMember(props.project.team, props.auth.user.id)
await handleUpdateMembers()
addNotification({
title: formatMessage(messages.success),
title: formatMessage(commonMessages.successLabel),
text: formatMessage(messages.successDecline),
type: 'success',
})
} catch {
addNotification({
title: formatMessage(messages.error),
title: formatMessage(commonMessages.errorLabel),
text: formatMessage(messages.errorDecline),
type: 'error',
})
Expand Down
13 changes: 3 additions & 10 deletions apps/frontend/src/components/ui/create/CollectionCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<ButtonStyled class="w-24">
<button @click="modal.hide()">
<XIcon aria-hidden="true" />
{{ formatMessage(messages.cancel) }}
{{ formatMessage(commonMessages.cancelButton) }}
</button>
</ButtonStyled>
<ButtonStyled color="brand" class="w-36">
Expand All @@ -60,6 +60,7 @@
import { PlusIcon, XIcon } from '@modrinth/assets'
import {
ButtonStyled,
commonMessages,
defineMessages,
injectNotificationManager,
NewModal,
Expand Down Expand Up @@ -102,18 +103,10 @@ const messages = defineMessages({
defaultMessage:
'Your new collection will be created as a public collection with {count, plural, =0 {no projects} one {# project} other {# projects}}.',
},
cancel: {
id: 'create.collection.cancel',
defaultMessage: 'Cancel',
},
createCollection: {
id: 'create.collection.create-collection',
defaultMessage: 'Create collection',
},
errorTitle: {
id: 'create.collection.error-title',
defaultMessage: 'An error occurred',
},
})

const name = ref('')
Expand Down Expand Up @@ -150,7 +143,7 @@ async function create() {
await router.push(`/collection/${result.id}`)
} catch (err) {
addNotification({
title: formatMessage(messages.errorTitle),
title: formatMessage(commonMessages.errorNotificationTitle),
text: err?.data?.description || err?.message || err,
type: 'error',
})
Expand Down
13 changes: 3 additions & 10 deletions apps/frontend/src/components/ui/create/OrganizationCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<ButtonStyled class="w-24">
<button @click="hide">
<XIcon aria-hidden="true" />
{{ formatMessage(messages.cancel) }}
{{ formatMessage(commonMessages.cancelButton) }}
</button>
</ButtonStyled>
<ButtonStyled color="brand" class="w-40">
Expand All @@ -83,6 +83,7 @@
import { PlusIcon, XIcon } from '@modrinth/assets'
import {
ButtonStyled,
commonMessages,
defineMessages,
injectNotificationManager,
NewModal,
Expand Down Expand Up @@ -130,18 +131,10 @@ const messages = defineMessages({
defaultMessage:
'You will be the owner of this organization, but you can invite other members and transfer ownership at any time.',
},
cancel: {
id: 'create.organization.cancel',
defaultMessage: 'Cancel',
},
createOrganization: {
id: 'create.organization.create-organization',
defaultMessage: 'Create organization',
},
errorTitle: {
id: 'create.organization.error-title',
defaultMessage: 'An error occurred',
},
})

const name = ref<string>('')
Expand Down Expand Up @@ -172,7 +165,7 @@ async function createOrganization(): Promise<void> {
} catch (err: any) {
console.error(err)
addNotification({
title: formatMessage(messages.errorTitle),
title: formatMessage(commonMessages.errorNotificationTitle),
text: err.data ? err.data.description : err,
type: 'error',
})
Expand Down
19 changes: 4 additions & 15 deletions apps/frontend/src/components/ui/create/ProjectCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="flex flex-col gap-2">
<label for="visibility" class="flex flex-col gap-1">
<span class="text-lg font-semibold text-contrast">
{{ formatMessage(messages.visibilityLabel) }}
{{ formatMessage(commonMessages.visibilityLabel) }}
<span class="text-brand-red">*</span>
</span>
<span>{{ formatMessage(messages.visibilityDescription) }}</span>
Expand Down Expand Up @@ -79,7 +79,7 @@
<ButtonStyled class="w-24">
<button @click="cancel">
<XIcon aria-hidden="true" />
{{ formatMessage(messages.cancel) }}
{{ formatMessage(commonMessages.cancelButton) }}
</button>
</ButtonStyled>
<ButtonStyled color="brand" class="w-32">
Expand All @@ -98,6 +98,7 @@ import { PlusIcon, XIcon } from '@modrinth/assets'
import {
ButtonStyled,
Chips,
commonMessages,
defineMessages,
injectNotificationManager,
NewModal,
Expand Down Expand Up @@ -127,10 +128,6 @@ const messages = defineMessages({
id: 'create.project.url-label',
defaultMessage: 'URL',
},
visibilityLabel: {
id: 'create.project.visibility-label',
defaultMessage: 'Visibility',
},
visibilityDescription: {
id: 'create.project.visibility-description',
defaultMessage: 'The visibility of your project after it has been approved.',
Expand All @@ -147,18 +144,10 @@ const messages = defineMessages({
id: 'create.project.summary-placeholder',
defaultMessage: 'This project adds...',
},
cancel: {
id: 'create.project.cancel',
defaultMessage: 'Cancel',
},
createProject: {
id: 'create.project.create-project',
defaultMessage: 'Create project',
},
errorTitle: {
id: 'create.project.error-title',
defaultMessage: 'An error occurred',
},
visibilityPublic: {
id: 'create.project.visibility-public',
defaultMessage: 'Public',
Expand Down Expand Up @@ -256,7 +245,7 @@ async function createProject() {
await router.push(`/project/${slug.value}/settings`)
} catch (err) {
addNotification({
title: formatMessage(messages.errorTitle),
title: formatMessage(commonMessages.errorNotificationTitle),
text: err.data ? err.data.description : err,
type: 'error',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
v-model="isUSCitizen"
:items="['yes', 'no']"
:format-label="
(item) => (item === 'yes' ? formatMessage(messages.yes) : formatMessage(messages.no))
(item) => (item === 'yes' ? formatMessage(commonMessages.yesLabel) : formatMessage(commonMessages.noLabel))
"
:never-empty="false"
:capitalize="true"
Expand Down Expand Up @@ -162,6 +162,7 @@ import {
Admonition,
ButtonStyled,
Chips,
commonMessages,
defineMessages,
injectNotificationManager,
IntlFormatted,
Expand Down Expand Up @@ -228,8 +229,6 @@ const messages = defineMessages({
id: 'dashboard.creator-tax-form-modal.us-citizen.question',
defaultMessage: 'Are you a US citizen?',
},
yes: { id: 'common.yes', defaultMessage: 'Yes' },
no: { id: 'common.no', defaultMessage: 'No' },
entityQuestion: {
id: 'dashboard.creator-tax-form-modal.entity.question',
defaultMessage: 'Are you a private individual or part of a foreign entity?',
Expand Down
26 changes: 3 additions & 23 deletions apps/frontend/src/components/ui/dashboard/CreatorWithdrawModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}}</span>
<ChevronRightIcon class="size-5 text-secondary" stroke-width="3" />
<span class="text-lg text-secondary sm:text-xl">{{
formatMessage(messages.detailsLabel)
formatMessage(commonMessages.detailsLabel)
}}</span>
</template>
<template v-else-if="isDetailsStage">
Expand All @@ -33,7 +33,7 @@
</button>
<ChevronRightIcon class="size-5 text-secondary" stroke-width="3" />
<span class="text-lg font-bold text-contrast sm:text-xl">{{
formatMessage(messages.detailsLabel)
formatMessage(commonMessages.detailsLabel)
}}</span>
</template>
</div>
Expand All @@ -60,7 +60,7 @@
<div v-if="currentStage === 'completion'" class="mt-4 flex w-full gap-3">
<ButtonStyled class="flex-1">
<button class="w-full text-contrast" @click="handleClose">
{{ formatMessage(messages.closeButton) }}
{{ formatMessage(commonMessages.closeButton) }}
</button>
</ButtonStyled>
<ButtonStyled class="flex-1">
Expand Down Expand Up @@ -601,26 +601,10 @@ const messages = defineMessages({
id: 'dashboard.creator-withdraw-modal.stage.method-selection',
defaultMessage: 'Method',
},
tremendousDetailsStage: {
id: 'dashboard.creator-withdraw-modal.stage.tremendous-details',
defaultMessage: 'Details',
},
muralpayKycStage: {
id: 'dashboard.creator-withdraw-modal.stage.muralpay-kyc',
defaultMessage: 'Verification',
},
muralpayDetailsStage: {
id: 'dashboard.creator-withdraw-modal.stage.muralpay-details',
defaultMessage: 'Account Details',
},
completionStage: {
id: 'dashboard.creator-withdraw-modal.stage.completion',
defaultMessage: 'Complete',
},
detailsLabel: {
id: 'dashboard.creator-withdraw-modal.details-label',
defaultMessage: 'Details',
},
completeTaxForm: {
id: 'dashboard.creator-withdraw-modal.complete-tax-form',
defaultMessage: 'Complete tax form',
Expand All @@ -633,10 +617,6 @@ const messages = defineMessages({
id: 'dashboard.creator-withdraw-modal.withdraw-button',
defaultMessage: 'Withdraw',
},
closeButton: {
id: 'dashboard.withdraw.completion.close-button',
defaultMessage: 'Close',
},
transactionsButton: {
id: 'dashboard.withdraw.completion.transactions-button',
defaultMessage: 'Transactions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,5 @@ const messages = defineMessages({
defaultMessage:
"You'll receive an email at <b>{email}</b> with instructions to redeem your withdrawal.",
},
closeButton: {
id: 'dashboard.withdraw.completion.close-button',
defaultMessage: 'Close',
},
transactionsButton: {
id: 'dashboard.withdraw.completion.transactions-button',
defaultMessage: 'Transactions',
},
})
</script>
Loading