Delegate tag color storage to ShlinkWebComponent consuming app

This commit is contained in:
Alejandro Celaya
2023-08-06 13:54:57 +02:00
parent 9f9f3b6402
commit 89e75653d7
12 changed files with 53 additions and 65 deletions

View File

@@ -1,4 +1,4 @@
import type { Settings, ShlinkWebComponentType } from '@shlinkio/shlink-web-component';
import type { Settings, ShlinkWebComponentType, TagColorsStorage } from '@shlinkio/shlink-web-component';
import type { FC } from 'react';
import { useEffect } from 'react';
import type { ShlinkApiClientBuilder } from '../api/services/ShlinkApiClientBuilder';
@@ -15,6 +15,7 @@ interface ShlinkWebComponentContainerProps {
export const ShlinkWebComponentContainer = (
buildShlinkApiClient: ShlinkApiClientBuilder,
tagColorsStorage: TagColorsStorage,
ShlinkWebComponent: ShlinkWebComponentType,
ServerError: FC,
) => withSelectedServer<ShlinkWebComponentContainerProps>((
@@ -38,6 +39,7 @@ export const ShlinkWebComponentContainer = (
apiClient={buildShlinkApiClient(selectedServer)}
settings={settings}
routesPrefix={routesPrefix}
tagColorsStorage={tagColorsStorage}
createNotFound={(nonPrefixedHomePath) => (
<NotFound to={`${routesPrefix}${nonPrefixedHomePath}`}>List short URLs</NotFound>
)}

View File

@@ -32,6 +32,7 @@ export const provideServices = (bottle: Bottle, connect: ConnectDecorator) => {
'ShlinkWebComponentContainer',
ShlinkWebComponentContainer,
'buildShlinkApiClient',
'TagColorsStorage',
'ShlinkWebComponent',
'ServerError',
);