Billing / plus frontend (#2130)

* [wip] initial

* [wip] subscriptions/plus frontend

* [wip] finish payment flow

* Charges page

* finish most subscriptions work

* Finish

* update eslint

* Fix issues

* fix intl extract

* fix omorphia locale extract

* fix responsiveness

* fix lint
This commit is contained in:
Geometrically
2024-08-15 23:21:30 -07:00
committed by GitHub
parent 1b3744baa2
commit 3a4843fb46
44 changed files with 2353 additions and 201 deletions

View File

@@ -77,6 +77,13 @@ export default defineNuxtConfig({
title: "Modrinth mods",
},
],
script: [
{
src: "https://js.stripe.com/v3/",
defer: true,
async: true,
},
],
},
},
vite: {
@@ -125,6 +132,7 @@ export default defineNuxtConfig({
homePageProjects?: any[];
homePageSearch?: any[];
homePageNotifs?: any[];
products?: any[];
} = {};
try {
@@ -165,6 +173,7 @@ export default defineNuxtConfig({
homePageProjects,
homePageSearch,
homePageNotifs,
products,
] = await Promise.all([
$fetch(`${API_URL}tag/category`, headers),
$fetch(`${API_URL}tag/loader`, headers),
@@ -174,6 +183,8 @@ export default defineNuxtConfig({
$fetch(`${API_URL}projects_random?count=60`, headers),
$fetch(`${API_URL}search?limit=3&query=leave&index=relevance`, headers),
$fetch(`${API_URL}search?limit=3&query=&index=updated`, headers),
// TODO: dehardcode
$fetch(`${API_URL.replace("/v2/", "/_internal/")}billing/products`, headers),
]);
state.categories = categories;
@@ -184,6 +195,7 @@ export default defineNuxtConfig({
state.homePageProjects = homePageProjects;
state.homePageSearch = homePageSearch;
state.homePageNotifs = homePageNotifs;
state.products = products;
await fs.writeFile("./src/generated/state.json", JSON.stringify(state));
@@ -236,7 +248,7 @@ export default defineNuxtConfig({
const omorphiaLocales: string[] = [];
const omorphiaLocaleSets = new Map<string, { files: { from: string }[] }>();
for await (const localeDir of globIterate("node_modules/omorphia/locales/*", {
for await (const localeDir of globIterate("node_modules/@modrinth/ui/src/locales/*", {
posix: true,
})) {
const tag = basename(localeDir);