1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 12:25:22 +02:00

fix(UI): some minor fixes [EE-6667] (#11062)
Some checks failed
/ triage (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
Lint / Run linters (push) Has been cancelled

* minor tweeks for kubernetes settings

* address review comments
This commit is contained in:
Prabhat Khera 2024-02-06 12:17:35 +13:00 committed by GitHub
parent b0564b9238
commit d601d8eb7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 36 additions and 15 deletions

View file

@ -2,19 +2,23 @@ import { createContext, PropsWithChildren, useContext } from 'react';
const Context = createContext<null | boolean>(null);
Context.displayName = 'WidgetContext';
export function useWidgetContext() {
const context = useContext(Context);
if (context == null) {
throw new Error('Should be inside a Widget component');
}
}
export function Widget({ children }: PropsWithChildren<unknown>) {
export function Widget({
children,
id,
}: PropsWithChildren<{
id?: string;
}>) {
return (
<Context.Provider value>
<div className="widget">{children}</div>
<div id={id} className="widget">
{children}
</div>
</Context.Provider>
);
}