diff --git a/editor.planx.uk/src/components/TestEnvironmentBanner.tsx b/editor.planx.uk/src/components/TestEnvironmentBanner.tsx
index ef2de024ab..6f04950c78 100644
--- a/editor.planx.uk/src/components/TestEnvironmentBanner.tsx
+++ b/editor.planx.uk/src/components/TestEnvironmentBanner.tsx
@@ -6,7 +6,7 @@ import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import { visuallyHidden } from "@mui/utils";
import { useStore } from "pages/FlowEditor/lib/store";
-import React, { useState } from "react";
+import React from "react";
const TestEnvironmentWarning = styled(Box)(({ theme }) => ({
backgroundColor: theme.palette.background.paper,
@@ -17,7 +17,10 @@ const TestEnvironmentWarning = styled(Box)(({ theme }) => ({
}));
const TestEnvironmentBanner: React.FC = () => {
- const [isTestEnvBannerVisible, hideTestEnvBanner] = useStore(state => [state.isTestEnvBannerVisible, state.hideTestEnvBanner]);
+ const [isTestEnvBannerVisible, hideTestEnvBanner] = useStore((state) => [
+ state.isTestEnvBannerVisible,
+ state.hideTestEnvBanner,
+ ]);
if (!isTestEnvBannerVisible) return null;
@@ -34,13 +37,15 @@ const TestEnvironmentBanner: React.FC = () => {
- This is a testing environment for new features.
- Do not use it to make permanent content changes.
+ This is a testing environment for new features. Do
+ not use it to make permanent content changes.
diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts b/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts
index 98bdb902b9..de8a111aad 100644
--- a/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts
+++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts
@@ -55,7 +55,7 @@ export const editorUIStore: StateCreator<
set({ showPreview: !get().showPreview });
},
- isTestEnvBannerVisible: true,
+ isTestEnvBannerVisible: !window.location.href.includes(".uk"),
hideTestEnvBanner: () => set({ isTestEnvBannerVisible: false }),
});