Skip to content

Commit

Permalink
fix: App URL (#39)
Browse files Browse the repository at this point in the history
* appUrl is config-based

* layout

* getNetworkAppUrl

* rm image
  • Loading branch information
gbarkhatov authored Aug 7, 2024
1 parent 576853d commit 63c9a12
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
11 changes: 6 additions & 5 deletions src/app/components/Modals/Terms/data/terms.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { getNetworkAppUrl } from "@/config";

export const Terms = () => {
const url = getNetworkAppUrl();

return (
<div className="rounded-2xl border border-neutral-content p-6 dark:border-neutral-content/20 overflow-y-scroll no-scrollbar max-h-[100vh] terms-container">
<p className="italic">Last updated [27 May 2024]</p>
<br />
<p>
<a
href="https://btcstaking.testnet.babylonchain.io/"
className="text-primary italic"
>
https://btcstaking.testnet.babylonchain.io/
<a href={url} className="text-primary italic">
{url}
</a>{" "}
is a website-hosted user interface (the{" "}
<i className="text-primary">“Interface”</i>).{" "}
Expand Down
12 changes: 4 additions & 8 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -27,17 +29,11 @@ export default function RootLayout({
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="2048" />
<meta property="og:image:height" content="1170" />
<meta
property="og:image"
content="https://btcstaking.babylonchain.io/og.png"
/>
<meta property="og:image" content={`${getNetworkAppUrl()}/og.png`} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="BTC Staking Dashboard" />
<meta name="twitter:description" content="BTC Staking Dashboard" />
<meta
name="twitter:image"
content="https://btcstaking.babylonchain.io/og.png"
/>
<meta name="twitter:image" content={`${getNetworkAppUrl()}/og.png`} />
<meta name="twitter:image:type" content="image/png" />
<meta name="twitter:image:width" content="2048" />
<meta name="twitter:image:height" content="1170" />
Expand Down
7 changes: 7 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

0 comments on commit 63c9a12

Please sign in to comment.