File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,7 @@ export enum Landscape {
99 Local = 'LOCAL' ,
1010}
1111
12- interface FrontendConfigContextType extends FrontendConfig {
13- links : DocLinkCreator ;
14- }
15-
16- export const FrontendConfigContext =
17- createContext < FrontendConfigContextType | null > ( null ) ;
12+ export const FrontendConfigContext = createContext < FrontendConfig | null > ( null ) ;
1813
1914const fetchPromise = fetch ( '/frontend-config.json' )
2015 . then ( ( res ) => res . json ( ) )
@@ -58,6 +53,7 @@ const FrontendConfigSchema = z.object({
5853 backendUrl : z . string ( ) ,
5954 gatewayUrl : z . string ( ) ,
6055 documentationBaseUrl : z . string ( ) ,
56+ githubBaseUrl : z . string ( ) ,
6157 oidcConfig : OidcConfigSchema ,
6258 landscape : z . optional ( z . nativeEnum ( Landscape ) ) ,
6359} ) ;
Original file line number Diff line number Diff line change 11import { useFrontendConfig } from '../../context/FrontendConfigContext' ;
22
33export function useLink ( ) {
4- const { documentationBaseUrl } = useFrontendConfig ( ) ;
4+ const { documentationBaseUrl, githubBaseUrl } = useFrontendConfig ( ) ;
55
6- if ( ! documentationBaseUrl ) {
6+ if ( ! documentationBaseUrl || ! githubBaseUrl ) {
77 throw new Error ( 'useLink must be used within a FrontendConfigProvider' ) ;
88 }
9-
109 const createLink = ( path : string ) => `${ documentationBaseUrl } ${ path } ` ;
10+ const createGithubLink = ( path : string ) => `${ githubBaseUrl } ${ path } ` ;
1111
1212 return {
1313 documentationHomepage : createLink ( '/' ) ,
@@ -20,5 +20,6 @@ export function useLink() {
2020 mcpCreationGuide : createLink (
2121 '/docs/managed-control-planes/get-started/get-started-mcp#5-create-managedcontrolplane' ,
2222 ) ,
23+ githubIssuesSupportTicket : createGithubLink ( '/support/issues/new' ) ,
2324 } ;
2425}
You can’t perform that action at this time.
0 commit comments