mkdir apps/web/scripts
mv scripts/{cleanup.sh,ci_package.sh,copy-res.ts,deploy.py,package.sh} apps/web/scripts
And a couple of gitignore tweaks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
35 lines
995 B
TypeScript
35 lines
995 B
TypeScript
/*
|
|
Copyright 2025 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import React, { createContext } from "react";
|
|
|
|
import { useCurrentPhase } from "../hooks/right-panel/useCurrentPhase";
|
|
import { type RightPanelPhases } from "../stores/right-panel/RightPanelStorePhases";
|
|
|
|
type Context = {
|
|
isPanelOpen: boolean;
|
|
currentPhase: RightPanelPhases | null;
|
|
};
|
|
|
|
export const CurrentRightPanelPhaseContext = createContext<Context | null>(null);
|
|
|
|
type Props = {
|
|
roomId: string;
|
|
};
|
|
|
|
export const CurrentRightPanelPhaseContextProvider: React.FC<React.PropsWithChildren<Props>> = ({
|
|
roomId,
|
|
children,
|
|
}) => {
|
|
const { currentPhase, isOpen } = useCurrentPhase(roomId);
|
|
return (
|
|
<CurrentRightPanelPhaseContext.Provider value={{ currentPhase, isPanelOpen: isOpen }}>
|
|
{children}
|
|
</CurrentRightPanelPhaseContext.Provider>
|
|
);
|
|
};
|