deps: update webui deps
This commit is contained in:
5
apps/webui/src/infra/di/inject.ts
Normal file
5
apps/webui/src/infra/di/inject.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { type InjectionToken, Injector, inject } from '@outposts/injection-js';
|
||||
|
||||
export function injectInjector(): Injector {
|
||||
return inject(Injector as any as InjectionToken<Injector>);
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
import * as React from "react"
|
||||
import React from 'react';
|
||||
|
||||
const MOBILE_BREAKPOINT = 768
|
||||
const MOBILE_BREAKPOINT = 768;
|
||||
|
||||
export function useIsMobile() {
|
||||
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
||||
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
|
||||
undefined
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
||||
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
||||
const onChange = () => {
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
||||
}
|
||||
mql.addEventListener("change", onChange)
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
||||
return () => mql.removeEventListener("change", onChange)
|
||||
}, [])
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
||||
};
|
||||
mql.addEventListener('change', onChange);
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
||||
return () => mql.removeEventListener('change', onChange);
|
||||
}, []);
|
||||
|
||||
return !!isMobile
|
||||
return !!isMobile;
|
||||
}
|
||||
|
||||
7
apps/webui/src/infra/http/http.service.ts
Normal file
7
apps/webui/src/infra/http/http.service.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Injectable, inject } from '@outposts/injection-js';
|
||||
import { OidcSecurityService } from 'oidc-client-rx';
|
||||
|
||||
@Injectable()
|
||||
export class HttpService {
|
||||
authService = inject(OidcSecurityService);
|
||||
}
|
||||
Reference in New Issue
Block a user