From 63c9a12b6b2ad73de7c9be8741e7dd70dad63248 Mon Sep 17 00:00:00 2001 From: Govard Barkhatov Date: Wed, 7 Aug 2024 16:30:33 +0200 Subject: [PATCH] fix: App URL (#39) * appUrl is config-based * layout * getNetworkAppUrl * rm image --- src/app/components/Modals/Terms/data/terms.tsx | 11 ++++++----- src/app/layout.tsx | 12 ++++-------- src/config/index.ts | 7 +++++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/app/components/Modals/Terms/data/terms.tsx b/src/app/components/Modals/Terms/data/terms.tsx index 8b012dfc..c75c045a 100644 --- a/src/app/components/Modals/Terms/data/terms.tsx +++ b/src/app/components/Modals/Terms/data/terms.tsx @@ -1,14 +1,15 @@ +import { getNetworkAppUrl } from "@/config"; + export const Terms = () => { + const url = getNetworkAppUrl(); + return (

Last updated [27 May 2024]


- - https://btcstaking.testnet.babylonchain.io/ + + {url} {" "} is a website-hosted user interface (the{" "} “Interface”).{" "} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3273667a..1883f113 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,6 +3,8 @@ import { Inter } from "next/font/google"; import "react-responsive-modal/styles.css"; import "react-tooltip/dist/react-tooltip.css"; +import { getNetworkAppUrl } from "@/config"; + import "./globals.css"; import Providers from "./providers"; @@ -27,17 +29,11 @@ export default function RootLayout({ - + - + diff --git a/src/config/index.ts b/src/config/index.ts index 99ae96e0..88fc21ef 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -5,3 +5,10 @@ export const shouldDisplayTestingMsg = (): boolean => { process.env.NEXT_PUBLIC_DISPLAY_TESTING_MESSAGES?.toString() !== "false" ); }; + +// getNetworkAppUrl function is used to get the network app url based on the environment +export const getNetworkAppUrl = (): string => { + return shouldDisplayTestingMsg() + ? "https://btcstaking.testnet.babylonchain.io" + : "https://btcstaking.babylonchain.io"; +};