diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 25e5d9825..13a2d5ee9 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -2,38 +2,87 @@

Revenue

-
-

- You have - {{ $formatMoney(userBalance.available) }} - available to withdraw. {{ $formatMoney(userBalance.pending) }} of your - balance is pending. -

+
+
+
Available now
+
+ {{ $formatMoney(userBalance.available) }} +
+
+
+
+ Total pending + + + +
+
+ {{ $formatMoney(userBalance.pending) }} +
+
+
+

+ Available soon + + + +

+
    +
  • + + {{ $formatMoney(availableSoonDates[date]) }} + + + + {{ formatDate(dayjs(date)) }} + +
  • +
+
-

- You have made - {{ $formatMoney(userBalance.available) }}, which is under the minimum of ${{ minWithdraw }} to withdraw. - {{ $formatMoney(userBalance.pending) }} of your balance is - pending. -

- - Withdraw - + + + Withdraw + + - View transfer history + + View transfer history

- By uploading projects to Modrinth and withdrawing money from your account, you agree to the - Rewards Program Terms. For more - information on how the rewards system works, see our information page - here. + + By uploading projects to Modrinth and withdrawing money from your account, you agree to + the + Rewards Program Terms. For more + information on how the rewards system works, see our information page + here. + +

+

+ + † Ongoing revenue period, subject to change. The finalized amount will be available to + view on the last day of the current month. +

@@ -46,12 +95,13 @@ {{ auth.user.payout_data.paypal_address }}

diff --git a/apps/frontend/src/plugins/dayjs.js b/apps/frontend/src/plugins/dayjs.js index 6a0bf90be..a22b6be23 100644 --- a/apps/frontend/src/plugins/dayjs.js +++ b/apps/frontend/src/plugins/dayjs.js @@ -1,7 +1,11 @@ import dayjs from "dayjs"; import quarterOfYear from "dayjs/plugin/quarterOfYear"; +import advanced from "dayjs/plugin/advancedFormat"; +import relativeTime from "dayjs/plugin/relativeTime"; dayjs.extend(quarterOfYear); +dayjs.extend(advanced); +dayjs.extend(relativeTime); export default defineNuxtPlugin(() => { return { diff --git a/packages/utils/utils.ts b/packages/utils/utils.ts index 42b6b1c33..56f34523a 100644 --- a/packages/utils/utils.ts +++ b/packages/utils/utils.ts @@ -87,6 +87,17 @@ export const formatNumber = (number, abbreviate = true) => { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') } +export function formatDate( + date: dayjs.Dayjs, + options: Intl.DateTimeFormatOptions = { + month: 'long', + day: 'numeric', + year: 'numeric', + }, +): string { + return date.toDate().toLocaleDateString(undefined, options) +} + export function formatMoney(number, abbreviate = false) { const x = Number(number) if (x >= 1000000 && abbreviate) {