diff --git a/src/app/components/EditorInterface.tsx b/src/app/components/EditorInterface.tsx index 8960e38..11e700b 100644 --- a/src/app/components/EditorInterface.tsx +++ b/src/app/components/EditorInterface.tsx @@ -70,6 +70,7 @@ interface IEditorInterface { token: string font: string customLabels?: CustomLabels + pauseUpdates?: boolean } const EditorInterface = ({ @@ -77,6 +78,7 @@ const EditorInterface = ({ token, font, customLabels, + pauseUpdates, }: IEditorInterface) => { const appState = useAppState() @@ -341,6 +343,7 @@ const EditorInterface = ({ appState?.setToken(token) appState?.setFont(font) appState?.setCustomLabels(customLabels) + appState?.setPauseUpdates(!!pauseUpdates) } appState?.setLoading(false) })() diff --git a/src/app/components/Footer.tsx b/src/app/components/Footer.tsx index eed8dd4..310c824 100644 --- a/src/app/components/Footer.tsx +++ b/src/app/components/Footer.tsx @@ -174,6 +174,26 @@ export const Footer = () => { return () => clearTimeout(t) }, []) + if (appState?.appState.pauseUpdates && appState?.appState.changesCreated) { + return ( +
+

+ Client Home is currently under maintenance - you will not be able to + make any changes to your content or settings in the meanwhile. +

+

+ Clients will be able to view the Client Home content as usual without + any interruptions during this time. +

+
+ ) + } + return (
void setCustomLabels: (customLabels?: CustomLabels) => void setBrandName: (brandName?: string | null) => void + setPauseUpdates: (v: boolean) => void /* eslint-enable no-unused-vars */ } @@ -103,6 +105,7 @@ export const AppContextProvider: FC = ({ children }) => { tasks: undefined, customLabels: undefined, brandName: '', + pauseUpdates: false, }) useEffect(() => { @@ -210,6 +213,10 @@ export const AppContextProvider: FC = ({ children }) => { setState((prev) => ({ ...prev, brandName: brandName || '' })) } + const setPauseUpdates = (v: boolean) => { + setState((prev) => ({ ...prev, pauseUpdates: v })) + } + return ( = ({ children }) => { setTasks, setCustomLabels, setBrandName, + setPauseUpdates, }} > {children}