Skip to content
Merged
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
3 changes: 1 addition & 2 deletions apps/web-app/app/components/form/CompleteTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const { taskId } = defineProps<{

const emit = defineEmits(['success', 'submitted'])

const { t } = useI18n()
const { pop } = useConfetti()
const actionToast = useActionToast()
const userStore = useUserStore()
Expand Down Expand Up @@ -99,7 +98,7 @@ async function onSubmit(event: FormSubmitEvent<CompleteTask>) {
userStore.update(),
])

actionToast.success(toastId, t('toast.task-completed'))
actionToast.close(toastId)
pop()
emit('success')
} catch (error) {
Expand Down
5 changes: 5 additions & 0 deletions apps/web-app/app/pages/partner/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

<Content>
<template v-if="userStore.id">
<div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium">
Общий баланс: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span>
</div>
Comment on lines +6 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use i18n for consistency and internationalization.

The text "Общий баланс:" is hardcoded in Russian, while the rest of the file uses t() for internationalized strings (e.g., line 2). Additionally, the currency symbol "₽" is hardcoded and may not be appropriate for all locales or partner types.

Consider applying this diff to use i18n and potentially make the currency dynamic:

-      <div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium">
-        Общий баланс: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span>
-      </div>
+      <div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium">
+        {{ t('app.partner.total-balance') }}: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span>
+      </div>

If the currency should also be dynamic based on locale or partner data, consider using Intl.NumberFormat with a currency option instead of appending a hardcoded symbol.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium">
Общий баланс: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span>
</div>
<div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium">
{{ t('app.partner.total-balance') }}: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span>
</div>
🤖 Prompt for AI Agents
In apps/web-app/app/pages/partner/index.vue around lines 6 to 8, the label
"Общий баланс:" and the hardcoded ₽ currency are not internationalized; replace
the literal label with a call to the i18n translator (e.g.,
t('partner.totalBalance') or the existing namespace) and format the amount using
Intl.NumberFormat with the currency option (pass a dynamic currency code from
partner data or derived from locale) instead of appending "₽"; also add the new
translation key(s) to the locale files so the label is available in all
supported languages.

<div class="mb-20 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-7 2xl:grid-cols-8 gap-4.5">
<NuxtLink
v-for="partner in partnerStore.partners"
Expand All @@ -26,6 +29,8 @@ const { t } = useI18n()
const userStore = useUserStore()
const partnerStore = usePartnerStore()

const totalBalance = computed(() => partnerStore.partners.reduce((acc, partner) => acc + partner.balance, 0))

useHead({
title: t('app.menu.our-partners'),
})
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/app/composables/useActionToast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ function _useActionToast() {
})
}

function close(id: string) {
toast.remove(id)
}

return {
start,
success,
error,
close,
}
}

Expand Down
Loading