You've already forked AstralRinth
forked from didirus/AstralRinth
NormalPage component w/ Collections refactor (#4873)
* Refactor search page, migrate to /discover/ * Add NormalPage component for common layouts, refactor Collections page as an example, misc ui pkg cleanup * intl:extract * lint * lint * remove old components * Refactor search page, migrate to /discover/ * Add NormalPage component for common layouts, refactor Collections page as an example, misc ui pkg cleanup * intl:extract * lint * lint * remove old components
This commit is contained in:
@@ -79,6 +79,7 @@ export function createContext<ContextValue>(
|
||||
}
|
||||
|
||||
export * from './api-client'
|
||||
export * from './page-context'
|
||||
export * from './project-page'
|
||||
export * from './server-context'
|
||||
export * from './web-notifications'
|
||||
|
||||
14
packages/ui/src/providers/page-context.ts
Normal file
14
packages/ui/src/providers/page-context.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
import { createContext } from '.'
|
||||
|
||||
export interface PageContext {
|
||||
// pages may render sidebar content in #sidebar-teleport-target instead of in the main layout when true
|
||||
hierarchicalSidebarAvailable: Ref<boolean>
|
||||
showAds: Ref<boolean>
|
||||
}
|
||||
|
||||
export const [injectPageContext, providePageContext] = createContext<PageContext>(
|
||||
'root',
|
||||
'pageContext',
|
||||
)
|
||||
13
packages/ui/src/providers/user-page.ts
Normal file
13
packages/ui/src/providers/user-page.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Labrinth } from '@modrinth/api-client'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
import { createContext } from '.'
|
||||
|
||||
export interface UserPageContext {
|
||||
user: Ref<Labrinth.Users.v3.User>
|
||||
}
|
||||
|
||||
export const [injectUserPageContext, provideUserPageContext] = createContext<UserPageContext>(
|
||||
'root',
|
||||
'userPageContext',
|
||||
)
|
||||
Reference in New Issue
Block a user