From f38ae398ed3f23e472a57561cc26fb85b6798dae Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Tue, 6 Feb 2024 20:46:10 +0100 Subject: [PATCH 1/5] add allo version switch button to the footer --- packages/common/src/components/Footer.tsx | 32 +++++++++++++---- packages/common/src/config.ts | 34 +++++++++++++++++++ .../src/features/common/DefaultLayout.tsx | 6 ++++ 3 files changed, 65 insertions(+), 7 deletions(-) diff --git a/packages/common/src/components/Footer.tsx b/packages/common/src/components/Footer.tsx index 4a24a6a176..76f20433de 100644 --- a/packages/common/src/components/Footer.tsx +++ b/packages/common/src/components/Footer.tsx @@ -2,7 +2,7 @@ import Discord from "../icons/Discord"; import Support from "../icons/Support"; import Github from "../icons/Github"; import Gitbook from "../icons/Gitbook"; -import { getConfig } from "../config"; +import { getConfig, setLocalStorageConfigOverride } from "../config"; const navigation = [ { @@ -31,17 +31,35 @@ const navigation = [ }, ]; +const config = getConfig(); const COMMIT_HASH = process.env.REACT_APP_GIT_SHA ?? "localhost"; -const ALLO_VERSION = getConfig().allo.version; +const ALLO_VERSION = config.allo.version; + +function switchAlloVersion(version: string) { + setLocalStorageConfigOverride("allo-version", version); + window.location.reload(); +} export default function Footer() { + const alloVersionAlternative = + ALLO_VERSION === "allo-v1" ? "allo-v2" : "allo-v1"; + return ( -