From 4e05c77732064eddacc6b334b09f42c8fdd04548 Mon Sep 17 00:00:00 2001 From: Calum Date: Wed, 12 Feb 2025 16:42:53 +0000 Subject: [PATCH 01/20] Improve revenue information --- .../src/pages/dashboard/revenue/index.vue | 145 +++++++++++++----- apps/frontend/src/pages/legal/cmp-info.vue | 123 ++++++++++----- apps/frontend/src/plugins/dayjs.js | 2 + packages/utils/utils.ts | 8 + 4 files changed, 196 insertions(+), 82 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 25e5d9825..c8294310a 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -2,38 +2,68 @@

Revenue

+
+
+
Current Balance
+
+ {{ $formatMoney(userBalance.available) }} +
+
+
+
Total Pending
+
+ {{ $formatMoney(userBalance.pending) }} +
+
+
+
Pending In Transit +
+
+ ≈{{ $formatMoney(totalTwoMonthsAgo) }} +
+ + + accessible on {{ formatDate(deadlineEnding)}} + +
+
+

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

- You have made - {{ $formatMoney(userBalance.available) }}, which is under the minimum of ${{ minWithdraw }} to withdraw. - {{ $formatMoney(userBalance.pending) }} of your balance is - pending. + Your current balance is under the minimum of ${{ minWithdraw }} to 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 + Rewards Program Terms + . For more information on how the rewards system works, see our information page - here. + here + .

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

diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index a7c6da794..5a9fd35ad 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -82,42 +82,47 @@

Modrinth receives ad revenue from our ad providers on a NET 60 day basis. Due to this, not all revenue is immediately available to withdraw. We pay creators as soon as we receive the money - from our ad providers, which is 60 days after the last day of each month. This table outlines - some example dates of how NET 60 payments are made: + from our ad providers, which is 60 days after the last day of each month.

+ +

+ Pending In Transit: This is an estimate of the total amount of pending + revenue that + you can expect to move into your current balance - it is essentially the revenue you earned 2 + months ago - +

+ +

+ To understand when revenue becomes available, you can use this calculator to estimate when + revenue earned on a specific date will be available for withdrawal. +

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
DatePayment available date
January 1stMarch 31st
January 15thMarch 31st
March 3rdMay 30th
June 30thAugust 29th
July 14thSeptember 29th
October 12thDecember 30th
TimelineDate
Revenue earned on + + +
End of the month{{ formatDate(endOfMonthDayjs) }}
NET 60 policy applied+ 60 days
Available for withdrawal{{ formatDate(withdrawalDateDayjs) }}

How do I know Modrinth is being transparent about revenue?

@@ -127,19 +132,55 @@ revenue distribution system. We also have an API route that allows users - to query exact daily revenue for the site. + to query exact daily revenue for the site - so far, Modrinth has generated + {{ formatMoney(platformRevenue) }} in revenue.

+ + + + + + + + + + + + + +
DateRevenueCreator RevenueModrinth's Cut (25%)
{{ formatDate(dayjs.unix(item.time)) }}{{ formatMoney(item.revenue) }}{{ formatMoney(item.creator_revenue) }}{{ formatMoney(item.revenue - item.creator_revenue) }}
+ Modrinth's total revenue in the previous 5 days, for the entire dataset, use the + aforementioned API + route.
- diff --git a/apps/frontend/src/plugins/dayjs.js b/apps/frontend/src/plugins/dayjs.js index 6a0bf90be..8cbcb74e3 100644 --- a/apps/frontend/src/plugins/dayjs.js +++ b/apps/frontend/src/plugins/dayjs.js @@ -1,7 +1,9 @@ import dayjs from "dayjs"; import quarterOfYear from "dayjs/plugin/quarterOfYear"; +import advanced from "dayjs/plugin/advancedFormat"; dayjs.extend(quarterOfYear); +dayjs.extend(advanced); export default defineNuxtPlugin(() => { return { diff --git a/packages/utils/utils.ts b/packages/utils/utils.ts index 42b6b1c33..d872999b7 100644 --- a/packages/utils/utils.ts +++ b/packages/utils/utils.ts @@ -87,6 +87,14 @@ 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) { From 595f952de30018a73f68d003d34ea54e5ea46276 Mon Sep 17 00:00:00 2001 From: Calum Date: Wed, 12 Feb 2025 17:01:51 +0000 Subject: [PATCH 02/20] Improve NET 60 period info + show next period if current period is over. --- .idea/vcs.xml | 6 ++++++ .../src/pages/dashboard/revenue/index.vue | 15 +++++++++------ apps/frontend/src/pages/legal/cmp-info.vue | 8 ++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1ddfb..7ddfc9ed4 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,5 +1,11 @@ + + + + + + diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index c8294310a..9e1a03046 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -150,21 +150,24 @@ async function updateVenmo() { stopLoading() } +let targetDate = dayjs().subtract(2, 'month').startOf('month') +if (targetDate.endOf('month').add(60, 'days').isAfter(dayjs().startOf('day'))) { + targetDate = dayjs().subtract(1, 'month').startOf('month'); +} + const { data: pendingInTransit } = await useAsyncData('analytics/revenue', () => useBaseFetch('analytics/revenue', { apiVersion: 3, query: { - start_date: dayjs().subtract(2, 'month').startOf('month').toISOString(), - end_date: dayjs().subtract(2, 'month').endOf('month').toISOString(), + start_date: targetDate.toISOString(), + end_date: targetDate.endOf('month').toISOString(), resolution_minutes: 1140 } }) ) -const deadlineEnding = dayjs().subtract(2, 'month').endOf('month').add(60, 'days') -const totalTwoMonthsAgo = dayjs().startOf('day').isAfter(deadlineEnding) - ? 0 - : Object.values(pendingInTransit.value || {}).reduce((acc, project) => { +const deadlineEnding = targetDate.endOf('month').add(60, 'days') +const totalTwoMonthsAgo = Object.values(pendingInTransit.value || {}).reduce((acc, project) => { return acc + Object.values(project || {}).reduce((acc, value) => acc + parseFloat(value), 0) }, 0) diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index 5a9fd35ad..406a30d24 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -88,8 +88,7 @@

Pending In Transit: This is an estimate of the total amount of pending revenue that - you can expect to move into your current balance - it is essentially the revenue you earned 2 - months ago - + you can expect to move into your current balance after the next NET 60 day period has passed. The next NET 60 day period ends on {{ formatDate(deadlineEnding) }}.

@@ -175,6 +174,11 @@ const selectedDateDayjs = computed(() => dayjs(selectedDateValue.value)) const endOfMonthDayjs = computed(() => selectedDateDayjs.value.endOf('month')) const withdrawalDateDayjs = computed(() => endOfMonthDayjs.value.add(60, 'days')) +let deadlineEnding = dayjs().subtract(2, 'month').endOf('month').add(60, 'days') +if (deadlineEnding.isAfter(dayjs().startOf('day'))) { + deadlineEnding = dayjs().subtract(1, 'month').endOf('month').add(60, 'days') +} + const { data: transparencyInformation } = await useAsyncData('payout/platform_revenue', () => useBaseFetch('payout/platform_revenue', { apiVersion: 3 From bb916b8d0b305c2e680e29aa0f934d343b64f3d6 Mon Sep 17 00:00:00 2001 From: Calum Date: Wed, 12 Feb 2025 17:03:28 +0000 Subject: [PATCH 03/20] invert period check --- apps/frontend/src/pages/dashboard/revenue/index.vue | 2 +- apps/frontend/src/pages/legal/cmp-info.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 9e1a03046..6c40481a7 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -151,7 +151,7 @@ async function updateVenmo() { } let targetDate = dayjs().subtract(2, 'month').startOf('month') -if (targetDate.endOf('month').add(60, 'days').isAfter(dayjs().startOf('day'))) { +if (targetDate.endOf('month').add(60, 'days').isBefore(dayjs().startOf('day'))) { targetDate = dayjs().subtract(1, 'month').startOf('month'); } diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index 406a30d24..b7fd6c3e0 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -175,7 +175,7 @@ const endOfMonthDayjs = computed(() => selectedDateDayjs.value.endOf('month')) const withdrawalDateDayjs = computed(() => endOfMonthDayjs.value.add(60, 'days')) let deadlineEnding = dayjs().subtract(2, 'month').endOf('month').add(60, 'days') -if (deadlineEnding.isAfter(dayjs().startOf('day'))) { +if (deadlineEnding.isBefore(dayjs().startOf('day'))) { deadlineEnding = dayjs().subtract(1, 'month').endOf('month').add(60, 'days') } From 21a7b59012ec4c24631b136fd69048fe1d1c932a Mon Sep 17 00:00:00 2001 From: Calum Date: Wed, 12 Feb 2025 17:07:46 +0000 Subject: [PATCH 04/20] % --- apps/frontend/src/pages/legal/cmp-info.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index b7fd6c3e0..1c9f336f7 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -138,7 +138,7 @@ Date Revenue - Creator Revenue + Creator Revenue (75%) Modrinth's Cut (25%) From c025b3f02df13fea658e6c0dda5af382a96419ec Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 00:40:14 +0000 Subject: [PATCH 05/20] Finalize changes --- .../src/pages/dashboard/revenue/index.vue | 136 ++++++++++++------ apps/frontend/src/pages/legal/cmp-info.vue | 25 +--- apps/frontend/src/plugins/dayjs.js | 2 + 3 files changed, 101 insertions(+), 62 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 6c40481a7..24371f6cf 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -10,24 +10,19 @@

-
Total Pending
+
Total Pending
{{ $formatMoney(userBalance.pending) }}
-
-
Pending In Transit -
-
- ≈{{ $formatMoney(totalTwoMonthsAgo) }} -
- - - accessible on {{ formatDate(deadlineEnding)}} - +
+

Available Soon

+
    +
  • + {{ $formatMoney(availableSoonDates[date]) }} + {{ formatDate(dayjs(date)) }} +
  • +
@@ -36,9 +31,6 @@ You have funds available to withdraw.

-

- Your current balance is under the minimum of ${{ minWithdraw }} to withdraw. -

+

+ Your current balance is under the minimum of ${{ minWithdraw }} to withdraw. +

- 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.

@@ -114,9 +107,19 @@ diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index 1c9f336f7..b2c7878e1 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -85,12 +85,6 @@ from our ad providers, which is 60 days after the last day of each month.

-

- Pending In Transit: This is an estimate of the total amount of pending - revenue that - you can expect to move into your current balance after the next NET 60 day period has passed. The next NET 60 day period ends on {{ formatDate(deadlineEnding) }}. -

-

To understand when revenue becomes available, you can use this calculator to estimate when revenue earned on a specific date will be available for withdrawal. @@ -104,7 +98,7 @@ Revenue earned on - + @@ -112,7 +106,7 @@ End of the month - {{ formatDate(endOfMonthDayjs) }} + {{ formatDate(endOfMonthDate) }} NET 60 policy applied @@ -120,7 +114,7 @@ Available for withdrawal - {{ formatDate(withdrawalDateDayjs) }} + {{ formatDate(withdrawalDate) }}

How do I know Modrinth is being transparent about revenue?

@@ -169,15 +163,10 @@ useSeoMeta({ ogDescription: description }) -const selectedDateValue = ref(dayjs().format('YYYY-MM-DD')) -const selectedDateDayjs = computed(() => dayjs(selectedDateValue.value)) -const endOfMonthDayjs = computed(() => selectedDateDayjs.value.endOf('month')) -const withdrawalDateDayjs = computed(() => endOfMonthDayjs.value.add(60, 'days')) - -let deadlineEnding = dayjs().subtract(2, 'month').endOf('month').add(60, 'days') -if (deadlineEnding.isBefore(dayjs().startOf('day'))) { - deadlineEnding = dayjs().subtract(1, 'month').endOf('month').add(60, 'days') -} +const rawSelectedDate = ref(dayjs().format('YYYY-MM-DD')) +const selectedDate = computed(() => dayjs(rawSelectedDate.value)) +const endOfMonthDate = computed(() => selectedDate.value.endOf('month')) +const withdrawalDate = computed(() => endOfMonthDate.value.add(60, 'days')) const { data: transparencyInformation } = await useAsyncData('payout/platform_revenue', () => useBaseFetch('payout/platform_revenue', { diff --git a/apps/frontend/src/plugins/dayjs.js b/apps/frontend/src/plugins/dayjs.js index 8cbcb74e3..a22b6be23 100644 --- a/apps/frontend/src/plugins/dayjs.js +++ b/apps/frontend/src/plugins/dayjs.js @@ -1,9 +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 { From 4ed73993c0e869a3b84b56f242afdf4ee791d5ea Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 01:02:34 +0000 Subject: [PATCH 06/20] Cleanup --- .../src/pages/dashboard/revenue/index.vue | 83 +++++++++++-------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 24371f6cf..8e0c0b8cc 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -4,33 +4,43 @@

Revenue

-
Current Balance
+
Available now
{{ $formatMoney(userBalance.available) }}
-
Total Pending
+
Total pending + + + +
{{ $formatMoney(userBalance.pending) }}
-

Available Soon

+

Available soon + + + +

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

- You have funds available to withdraw. -

-
-

- Your current balance is under the minimum of ${{ minWithdraw }} to withdraw. +

+ + 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. +

@@ -112,14 +126,13 @@ import { PayPalIcon, SaveIcon, TransferIcon, - XIcon, UnknownIcon, - DownloadIcon + XIcon } from '@modrinth/assets' -import { formatDate, formatMoney } from '@modrinth/utils' +import { formatDate } from '@modrinth/utils' import dayjs from 'dayjs' import { computed } from 'vue' -import { Button } from '@modrinth/ui' +import { SpinnerIcon } from '@modrinth/assets' const auth = await useAuth() const minWithdraw = ref(0.01) @@ -134,20 +147,22 @@ const deadlineEnding = computed(() => { deadline = dayjs().subtract(1, 'month').endOf('month').add(60, 'days') } return deadline -}); +}) const availableSoonDates = computed(() => { // Get the next 3 dates from userBalance.dates that are from now to the deadline + 4 months to make sure we get all the pending ones. const dates = Object.keys(userBalance.value.dates).filter(date => { const dateObj = dayjs(date) return dateObj.isAfter(dayjs()) && dateObj.isBefore(dayjs(deadlineEnding.value).add(4, 'month')) - }).sort((a, b) => dayjs(a).diff(dayjs(b))); + }).sort((a, b) => dayjs(a).diff(dayjs(b))) return dates.reduce((acc, date) => { acc[date] = userBalance.value.dates[date] return acc }, {}) -}); +}) + +const availableSoonDateKeys = computed(() => Object.keys(availableSoonDates.value)) async function updateVenmo() { startLoading() @@ -190,14 +205,6 @@ strong { pointer-events: none; } -.grid-display__item { - .value { - flex-grow: 1; - display: flex; - align-items: center; - } -} - .available-soon { padding-top: 0; @@ -216,14 +223,20 @@ strong { justify-content: space-between; align-items: center; padding: 0.2rem 0 0; - border-bottom: 1px solid #eee; + border-bottom: 1px solid var(--color-divider); .amount { font-weight: 600; + + small { + vertical-align: top; + margin: 0; + padding: 0; + } } .date { - color: #7f8c8d; + color: var(--color-text-secondary); font-size: 0.9em; } From c745bb40696958f5fd8a531318f9d20efb2f56d6 Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 01:04:34 +0000 Subject: [PATCH 07/20] Remove .idea --- .idea/.gitignore | 8 -------- .idea/code.iml | 18 ------------------ .idea/discord.xml | 7 ------- .idea/libraries/KotlinJavaRuntime.xml | 26 -------------------------- .idea/modules.xml | 8 -------- .idea/vcs.xml | 12 ------------ 6 files changed, 79 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/code.iml delete mode 100644 .idea/discord.xml delete mode 100644 .idea/libraries/KotlinJavaRuntime.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 73f69e095..000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/code.iml b/.idea/code.iml deleted file mode 100644 index 70105a514..000000000 --- a/.idea/code.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/.idea/discord.xml b/.idea/discord.xml deleted file mode 100644 index d8e956166..000000000 --- a/.idea/discord.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml deleted file mode 100644 index 78d18789b..000000000 --- a/.idea/libraries/KotlinJavaRuntime.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index aa7113fc6..000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 7ddfc9ed4..000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file From f69611dfa0cf8f80c134e67aa02e5c631f33ef0d Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Fri, 21 Feb 2025 01:05:33 +0000 Subject: [PATCH 08/20] Discard changes to .idea/discord.xml --- .idea/discord.xml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .idea/discord.xml diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 000000000..d8e956166 --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file From f0ff3a7b13d595cb149179f76cd4d36876a8083c Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Fri, 21 Feb 2025 01:05:41 +0000 Subject: [PATCH 09/20] Discard changes to .idea/code.iml --- .idea/code.iml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .idea/code.iml diff --git a/.idea/code.iml b/.idea/code.iml new file mode 100644 index 000000000..70105a514 --- /dev/null +++ b/.idea/code.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + From f14242054165632076c279e16bbc43954008f897 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Fri, 21 Feb 2025 01:05:48 +0000 Subject: [PATCH 10/20] Discard changes to .idea/.gitignore --- .idea/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..73f69e095 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ From f8ae147b25b08cb8378e098cf0e62bba3773ba01 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Fri, 21 Feb 2025 01:05:58 +0000 Subject: [PATCH 11/20] Discard changes to .idea/libraries/KotlinJavaRuntime.xml --- .idea/libraries/KotlinJavaRuntime.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .idea/libraries/KotlinJavaRuntime.xml diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 000000000..78d18789b --- /dev/null +++ b/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 08b402b25cfec14aa646384de97bc00a8bb74762 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Fri, 21 Feb 2025 01:06:03 +0000 Subject: [PATCH 12/20] Discard changes to .idea/vcs.xml --- .idea/vcs.xml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 21ccc51fa3cb1c6268493784e1ca22c50c22d6da Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Fri, 21 Feb 2025 01:06:07 +0000 Subject: [PATCH 13/20] Discard changes to .idea/modules.xml --- .idea/modules.xml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..aa7113fc6 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + From d5aa5749fabb370b19ddcdfd1a1a7db4af0b7988 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Fri, 21 Feb 2025 01:06:11 +0000 Subject: [PATCH 14/20] Discard changes to .idea/.gitignore From e6a17d0b599ca84aa91c7e3ec59db262c2e61517 Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 01:09:06 +0000 Subject: [PATCH 15/20] fix lint issues --- .../src/pages/dashboard/revenue/index.vue | 112 ++++++++++-------- apps/frontend/src/pages/legal/cmp-info.vue | 52 ++++---- 2 files changed, 90 insertions(+), 74 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 8e0c0b8cc..237a07141 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -10,9 +10,13 @@
-
Total pending - +
+ Total pending +
@@ -21,18 +25,25 @@
-

Available soon - +

+ Available soon +

    -
  • +
  • {{ $formatMoney(availableSoonDates[date]) }} - + {{ formatDate(dayjs(date)) }} @@ -51,8 +62,8 @@ class="iconified-button brand-button" to="/dashboard/revenue/withdraw" > - Withdraw - + Withdraw + @@ -61,15 +72,17 @@

- 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 + 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. + † Ongoing revenue period, subject to change. The finalized amount will be available to + view on the last day of the current month.

@@ -132,64 +145,65 @@ import { import { formatDate } from '@modrinth/utils' import dayjs from 'dayjs' import { computed } from 'vue' -import { SpinnerIcon } from '@modrinth/assets' -const auth = await useAuth() -const minWithdraw = ref(0.01) +const auth = await useAuth(); +const minWithdraw = ref(0.01); const { data: userBalance } = await useAsyncData(`payout/balance`, () => - useBaseFetch(`payout/balance`, { apiVersion: 3 }) -) + useBaseFetch(`payout/balance`, { apiVersion: 3 }), +); const deadlineEnding = computed(() => { - let deadline = dayjs().subtract(2, 'month').endOf('month').add(60, 'days') - if (deadline.isBefore(dayjs().startOf('day'))) { - deadline = dayjs().subtract(1, 'month').endOf('month').add(60, 'days') + let deadline = dayjs().subtract(2, "month").endOf("month").add(60, "days"); + if (deadline.isBefore(dayjs().startOf("day"))) { + deadline = dayjs().subtract(1, "month").endOf("month").add(60, "days"); } - return deadline -}) + return deadline; +}); const availableSoonDates = computed(() => { // Get the next 3 dates from userBalance.dates that are from now to the deadline + 4 months to make sure we get all the pending ones. - const dates = Object.keys(userBalance.value.dates).filter(date => { - const dateObj = dayjs(date) - return dateObj.isAfter(dayjs()) && dateObj.isBefore(dayjs(deadlineEnding.value).add(4, 'month')) - }).sort((a, b) => dayjs(a).diff(dayjs(b))) + const dates = Object.keys(userBalance.value.dates) + .filter((date) => { + const dateObj = dayjs(date); + return ( + dateObj.isAfter(dayjs()) && dateObj.isBefore(dayjs(deadlineEnding.value).add(4, "month")) + ); + }) + .sort((a, b) => dayjs(a).diff(dayjs(b))); return dates.reduce((acc, date) => { - acc[date] = userBalance.value.dates[date] - return acc - }, {}) -}) + acc[date] = userBalance.value.dates[date]; + return acc; + }, {}); +}); -const availableSoonDateKeys = computed(() => Object.keys(availableSoonDates.value)) +const availableSoonDateKeys = computed(() => Object.keys(availableSoonDates.value)); async function updateVenmo() { - startLoading() + startLoading(); try { const data = { - venmo_handle: auth.value.user.payout_data.venmo_handle ?? null - } + venmo_handle: auth.value.user.payout_data.venmo_handle ?? null, + }; await useBaseFetch(`user/${auth.value.user.id}`, { - method: 'PATCH', + method: "PATCH", body: data, - apiVersion: 3 - }) - await useAuth(auth.value.token) + apiVersion: 3, + }); + await useAuth(auth.value.token); } catch (err) { - const data = useNuxtApp() + const data = useNuxtApp(); data.$notify({ - group: 'main', - title: 'An error occurred', + group: "main", + title: "An error occurred", text: err.data.description, - type: 'error' - }) + type: "error", + }); } - stopLoading() + stopLoading(); } - - diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index 4585a4fcd..e6804e64d 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -129,18 +129,22 @@ {{ formatMoney(platformRevenue) }} in revenue.

- - - - - - - - - - - - + + + + + + + + + + + + + + + +
DateRevenueCreator Revenue (75%)Modrinth's Cut (25%)
{{ formatDate(dayjs.unix(item.time)) }}{{ formatMoney(item.revenue) }}{{ formatMoney(item.creator_revenue) }}{{ formatMoney(item.revenue - item.creator_revenue) }}
DateRevenueCreator Revenue (75%)Modrinth's Cut (25%)
{{ formatDate(dayjs.unix(item.time)) }}{{ formatMoney(item.revenue) }}{{ formatMoney(item.creator_revenue) }}{{ formatMoney(item.revenue - item.creator_revenue) }}
Modrinth's total revenue in the previous 5 days, for the entire dataset, use the diff --git a/packages/utils/utils.ts b/packages/utils/utils.ts index d872999b7..56f34523a 100644 --- a/packages/utils/utils.ts +++ b/packages/utils/utils.ts @@ -87,11 +87,14 @@ 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 { +export function formatDate( + date: dayjs.Dayjs, + options: Intl.DateTimeFormatOptions = { + month: 'long', + day: 'numeric', + year: 'numeric', + }, +): string { return date.toDate().toLocaleDateString(undefined, options) } From 33d5c89fc2f7697aaedd3b9544d8afebf2925664 Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 01:22:57 +0000 Subject: [PATCH 17/20] fix responsiveness --- .../src/pages/dashboard/revenue/index.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 1463e59df..98e94a15f 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -218,6 +218,10 @@ strong { pointer-events: none; } +.grid-display { + grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); +} + .available-soon { padding-top: 0; @@ -259,11 +263,11 @@ strong { } } -@media screen and (max-width: 1085px) { - .available-soon-item { - flex-direction: column; - align-items: flex-start; - margin-right: auto; - } -} +//@media screen and (max-width: 1085px) { +// .available-soon-item { +// flex-direction: column; +// align-items: flex-start; +// margin-right: auto; +// } +//} From e87c8530fa94ded361271323e1542078dbb908bd Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 01:23:07 +0000 Subject: [PATCH 18/20] Remove comment --- apps/frontend/src/pages/dashboard/revenue/index.vue | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/frontend/src/pages/dashboard/revenue/index.vue b/apps/frontend/src/pages/dashboard/revenue/index.vue index 98e94a15f..13a2d5ee9 100644 --- a/apps/frontend/src/pages/dashboard/revenue/index.vue +++ b/apps/frontend/src/pages/dashboard/revenue/index.vue @@ -262,12 +262,4 @@ strong { } } } - -//@media screen and (max-width: 1085px) { -// .available-soon-item { -// flex-direction: column; -// align-items: flex-start; -// margin-right: auto; -// } -//} From f7e2ed0bd248e091558933ebda3ad5b718b60368 Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 01:27:45 +0000 Subject: [PATCH 19/20] utc comment --- apps/frontend/src/pages/legal/cmp-info.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index e6804e64d..a899c4c61 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -87,7 +87,7 @@

To understand when revenue becomes available, you can use this calculator to estimate when - revenue earned on a specific date will be available for withdrawal. + revenue earned on a specific date will be available for withdrawal. Please be advised that all dates within this calculator are represented at 00:00 UTC.

From 5e8b5f7e24e725f20fb3822eb31b480e3d003790 Mon Sep 17 00:00:00 2001 From: Calum Date: Fri, 21 Feb 2025 01:47:04 +0000 Subject: [PATCH 20/20] fix lint --- apps/frontend/src/pages/legal/cmp-info.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/pages/legal/cmp-info.vue b/apps/frontend/src/pages/legal/cmp-info.vue index a899c4c61..ef6072420 100644 --- a/apps/frontend/src/pages/legal/cmp-info.vue +++ b/apps/frontend/src/pages/legal/cmp-info.vue @@ -87,7 +87,8 @@

To understand when revenue becomes available, you can use this calculator to estimate when - revenue earned on a specific date will be available for withdrawal. Please be advised that all dates within this calculator are represented at 00:00 UTC. + revenue earned on a specific date will be available for withdrawal. Please be advised that all + dates within this calculator are represented at 00:00 UTC.