feat(journal): add JournalContext to allow closing panel on mobile

This commit is contained in:
2026-07-08 00:11:16 +08:00
parent 57ffb35f2b
commit 3d957706e9
4 changed files with 68 additions and 39 deletions
+18
View File
@@ -0,0 +1,18 @@
/**
* Journal context — provides `onClose` to message renderers so that
* clicking a link message can close the panel on mobile.
*/
import { createContext, useContext } from "solid-js";
export interface JournalContextValue {
onClose: () => void;
}
const JournalContext = createContext<JournalContextValue>();
export function useJournalContext(): JournalContextValue | undefined {
return useContext(JournalContext);
}
export { JournalContext };