A pure move (git mv, history kept): 333 files leave components/, which now holds only the platform layer (ui/) and the legal pages. The shell is the frame (App, header, nav rail, palette, boot); each page lives in modules/<page>/ with its rail, store and tests; what several pages share sits in features/<name>/; the shared-link page is watch/. Domain-free helpers went straight to ui/ (ViewSwitcher, FilterRail, the confirm dialog, the language switcher, the copy rows). Every relative specifier was rewritten (imports, dynamic imports, vi.mock, new URL), and the contract tests that scan sources now scan the whole app source, not only components/ — each glob was counted before and after so none went green over fewer files. The locale-format rule matched `/src/components/` only, so the move would have taken ~300 files out from under its i18n-singleton check; it now covers every folder that holds components, with a test per folder.
21 lines
641 B
TypeScript
21 lines
641 B
TypeScript
import { createContext, useContext } from "react";
|
|
|
|
// The onboarding wizard's actions context + hook, split out of WizardProvider so that file exports
|
|
// only components (Fast Refresh).
|
|
|
|
export interface WizardActions {
|
|
openWizard: () => void;
|
|
closeWizard: () => void;
|
|
}
|
|
|
|
// Only the actions are shared — the open flag stays local to the provider (it renders the wizard
|
|
// itself), so no consumer needs to subscribe to it.
|
|
export const WizardActionsContext = createContext<WizardActions>({
|
|
openWizard: () => {},
|
|
closeWizard: () => {},
|
|
});
|
|
|
|
export function useWizard(): WizardActions {
|
|
return useContext(WizardActionsContext);
|
|
}
|