Skip to content

Commit

Permalink
Add beta and alpha badges (#2929)
Browse files Browse the repository at this point in the history
Co-authored-by: Prospector <[email protected]>
  • Loading branch information
Geometrically and Prospector authored Nov 9, 2024
1 parent aae00e1 commit ae2cd94
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
12 changes: 12 additions & 0 deletions apps/frontend/src/assets/images/badges/alpha-tester.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions apps/frontend/src/assets/images/badges/beta-tester.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion apps/frontend/src/pages/user/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@
</nuxt-link>
<TenMClubBadge v-else-if="badge === '10m-club'" class="h-14 w-14" />
<EarlyAdopterBadge v-else-if="badge === 'early-adopter'" class="h-14 w-14" />
<AlphaTesterBadge v-else-if="badge === 'alpha-tester'" class="h-14 w-14" />
<BetaTesterBadge v-else-if="badge === 'beta-tester'" class="h-14 w-14" />
</div>
</div>
</div>
Expand Down Expand Up @@ -272,6 +274,8 @@ import ModBadge from "~/assets/images/badges/mod.svg?component";
import PlusBadge from "~/assets/images/badges/plus.svg?component";
import TenMClubBadge from "~/assets/images/badges/10m-club.svg?component";
import EarlyAdopterBadge from "~/assets/images/badges/early-adopter.svg?component";
import AlphaTesterBadge from "~/assets/images/badges/alpha-tester.svg?component";
import BetaTesterBadge from "~/assets/images/badges/beta-tester.svg?component";
import ReportIcon from "~/assets/images/utils/report.svg?component";
import UpToDate from "~/assets/images/illustrations/up_to_date.svg?component";
Expand Down Expand Up @@ -463,6 +467,10 @@ const sumDownloads = computed(() => {
return sum;
});
const joinDate = computed(() => new Date(user.value.created));
const MODRINTH_BETA_END_DATE = new Date("2022-02-27T08:00:00.000Z");
const MODRINTH_ALPHA_END_DATE = new Date("2020-11-30T08:00:00.000Z");
const badges = computed(() => {
const badges = [];
Expand Down Expand Up @@ -490,8 +498,10 @@ const badges = computed(() => {
badges.push("early-adopter");
}
if (isPermission(user.value.badges, 1 << 4)) {
if (isPermission(user.value.badges, 1 << 4) || joinDate.value < MODRINTH_ALPHA_END_DATE) {
badges.push("alpha-tester");
} else if (isPermission(user.value.badges, 1 << 4) || joinDate.value < MODRINTH_BETA_END_DATE) {
badges.push("beta-tester");
}
if (isPermission(user.value.badges, 1 << 5)) {
Expand Down

0 comments on commit ae2cd94

Please sign in to comment.