Expose container via provider

This commit is contained in:
Alejandro Celaya
2025-11-15 10:20:53 +01:00
parent 6094994cfa
commit f301513f5b
15 changed files with 92 additions and 53 deletions

View File

@@ -1,5 +1,4 @@
import { changeThemeInMarkup, getSystemPreferredTheme } from '@shlinkio/shlink-frontend-kit';
import type { HttpClient } from '@shlinkio/shlink-js-sdk';
import { clsx } from 'clsx';
import type { FC } from 'react';
import { useEffect } from 'react';
@@ -26,7 +25,6 @@ type AppDeps = {
ShlinkWebComponentContainer: FC;
CreateServer: FC;
ManageServers: FC;
HttpClient: HttpClient;
};
const App: FCWithDeps<AppProps, AppDeps> = ({ appUpdated, resetAppUpdate }) => {
@@ -35,10 +33,9 @@ const App: FCWithDeps<AppProps, AppDeps> = ({ appUpdated, resetAppUpdate }) => {
ShlinkWebComponentContainer,
CreateServer,
ManageServers,
HttpClient: httpClient,
} = useDependencies(App);
useLoadRemoteServers(httpClient);
useLoadRemoteServers();
const location = useLocation();
const isHome = location.pathname === '/';
@@ -92,5 +89,4 @@ export const AppFactory = componentFactory(App, [
'ShlinkWebComponentContainer',
'CreateServer',
'ManageServers',
'HttpClient',
]);