You've already forked AstralRinth
forked from didirus/AstralRinth
feat: start of cross platform page system (#4731)
* feat: abstract api-client DI into ui package * feat: cross platform page system * feat: tanstack as cross platform useAsyncData * feat: archon servers routes + labrinth billing routes * fix: dont use partial * feat: migrate server list page to tanstack + api-client + re-enabled broken features! * feat: migrate servers manage page to api-client before page system * feat: migrate manage page to page system * fix: type issues * fix: upgrade wrapper bugs * refactor: move state types into api-client * feat: disable financial stuff on app frontend * feat: finalize cross platform page system for now * fix: lint * fix: build issues * feat: remove papaparse * fix: lint * fix: interface error --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
8
packages/ui/src/providers/api-client.ts
Normal file
8
packages/ui/src/providers/api-client.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { AbstractModrinthClient } from '@modrinth/api-client'
|
||||
|
||||
import { createContext } from './index'
|
||||
|
||||
export const [injectModrinthClient, provideModrinthClient] = createContext<AbstractModrinthClient>(
|
||||
'root',
|
||||
'modrinthClient',
|
||||
)
|
||||
@@ -78,5 +78,6 @@ export function createContext<ContextValue>(
|
||||
return [injectContext, provideContext] as const
|
||||
}
|
||||
|
||||
export * from './api-client'
|
||||
export * from './project-page'
|
||||
export * from './web-notifications'
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import type { Project, ProjectV3Partial, TeamMember } from '@modrinth/utils'
|
||||
import type { Labrinth } from '@modrinth/api-client/src/modules/types'
|
||||
// TODO: api client this shit
|
||||
import type { TeamMember } from '@modrinth/utils'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
import { createContext } from '.'
|
||||
|
||||
export interface ProjectPageContext {
|
||||
projectV2: Ref<Project>
|
||||
projectV3: Ref<ProjectV3Partial>
|
||||
projectV2: Ref<Labrinth.Projects.v2.Project>
|
||||
projectV3: Ref<Labrinth.Projects.v3.Project>
|
||||
refreshProject: () => Promise<void>
|
||||
currentMember: Ref<TeamMember>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user