mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
* docs: design terminal host management * feat: add work-surface host editor state * feat: add work-surface host editor layer * feat: add host creation and edit menu actions * feat: expose host management from terminal tree * feat: edit hosts without leaving terminal * fix: keep host editor subpanels interactive * fix: keep terminal host toolbar unchanged * chore: exclude internal design notes from PR * fix: preserve terminal host editor state * fix: harden terminal host editor interactions * fix: fully hide inactive host editor --------- Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
15 lines
485 B
TypeScript
15 lines
485 B
TypeScript
import React, { createContext, useContext } from 'react';
|
|
|
|
const PortalContainerContext = createContext<HTMLElement | null>(null);
|
|
|
|
export const PortalContainerProvider: React.FC<{
|
|
container: HTMLElement | null;
|
|
children: React.ReactNode;
|
|
}> = ({ container, children }) => (
|
|
<PortalContainerContext.Provider value={container}>
|
|
{children}
|
|
</PortalContainerContext.Provider>
|
|
);
|
|
|
|
export const usePortalContainer = (): HTMLElement | null => useContext(PortalContainerContext);
|