Skip to content

Commit

Permalink
Add a flag to show the account screen button (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre authored Jan 22, 2025
1 parent 7e3f0ba commit bc8f30a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/app/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NEXT_PUBLIC_ACCOUNT_SCREEN=false
NEXT_PUBLIC_DEMO_MODE=false
NEXT_PUBLIC_VERCEL_ANALYTICS=false
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=1
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/src/comps/ProtocolStats/ProtocolStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { TokenSymbol } from "@/src/types";

import { Amount } from "@/src/comps/Amount/Amount";
import { Logo } from "@/src/comps/Logo/Logo";
import { LIQUITY_STATS_URL } from "@/src/env";
import { ACCOUNT_SCREEN, LIQUITY_STATS_URL } from "@/src/env";
import { useAccount } from "@/src/services/Ethereum";
import { usePrice } from "@/src/services/Prices";
import { css } from "@/styled-system/css";
Expand Down Expand Up @@ -101,7 +101,7 @@ export function ProtocolStats() {
symbol={symbol}
/>
))}
{account.address && (
{account.address && ACCOUNT_SCREEN && (
<Link
id="footer-account-button"
href={`/account?address=${account.address}`}
Expand Down
3 changes: 3 additions & 0 deletions frontend/app/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const CollateralSymbolSchema = v.union([

export const EnvSchema = v.pipe(
v.object({
ACCOUNT_SCREEN: v.optional(vEnvFlag(), "false"),
APP_VERSION: v.string(),
APP_COMMIT_HASH: v.string(),
CONTRACTS_COMMIT_HASH: v.string(),
Expand Down Expand Up @@ -205,6 +206,7 @@ export const EnvSchema = v.pipe(
export type Env = v.InferOutput<typeof EnvSchema>;

const parsedEnv = v.safeParse(EnvSchema, {
ACCOUNT_SCREEN: process.env.NEXT_PUBLIC_ACCOUNT_SCREEN,
APP_VERSION: (
process.env.NEXT_PUBLIC_APP_VERSION
// APP_VERSION_FROM_BUILD is set in next.config.js
Expand Down Expand Up @@ -302,6 +304,7 @@ if (!parsedEnv.success) {
}

export const {
ACCOUNT_SCREEN,
APP_COMMIT_HASH,
APP_VERSION,
BLOCKING_LIST,
Expand Down

0 comments on commit bc8f30a

Please sign in to comment.