Skip to content

Commit 2991b60

Browse files
Merge remote-tracking branch 'origin/main' into urgent-redemptions
2 parents 95c49c1 + dfbe823 commit 2991b60

26 files changed

Lines changed: 721 additions & 162 deletions

File tree

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

README.md

Lines changed: 32 additions & 32 deletions
Large diffs are not rendered by default.

frontend/app/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,15 @@ Enable a banner warning users when one or more branches are in Safety Mode. Opti
317317
NEXT_PUBLIC_SAFETY_MODE_CHECK=false
318318
```
319319

320+
### `NEXT_PUBLIC_SHOW_DATA_SOURCES`
321+
322+
Let the user override RPC and subgraph URLs. When enabled, a "Data Sources" link is shown in the app's footer that, when clicked, opens a configuration dialog box. Optional. Defaults to false.
323+
324+
```dosini
325+
# Example
326+
NEXT_PUBLIC_SHOW_DATA_SOURCES=true
327+
```
328+
320329
### `NEXT_PUBLIC_SUBGRAPH_URL`
321330

322331
URL for The Graph protocol subgraph queries.

frontend/app/public/favicon.svg

Lines changed: 1 addition & 16 deletions
Loading

frontend/app/src/app/layout.tsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { BreakpointName } from "@/src/breakpoints";
88
import { About } from "@/src/comps/About/About";
99
import { AppLayout } from "@/src/comps/AppLayout/AppLayout";
1010
import { Blocking } from "@/src/comps/Blocking/Blocking";
11+
import { DataSources } from "@/src/comps/DataSources/DataSources";
1112
import content from "@/src/content";
1213
import { VERCEL_ANALYTICS } from "@/src/env";
1314
import { Ethereum } from "@/src/services/Ethereum";
@@ -42,21 +43,23 @@ export default function Layout({
4243
<ReactQuery>
4344
<UiKit>
4445
<StoredState>
45-
<BreakpointName>
46-
<Ethereum>
47-
<IndicatorManager>
48-
<Blocking>
49-
<TransactionFlow>
50-
<About>
51-
<AppLayout>
52-
{children}
53-
</AppLayout>
54-
</About>
55-
</TransactionFlow>
56-
</Blocking>
57-
</IndicatorManager>
58-
</Ethereum>
59-
</BreakpointName>
46+
<DataSources>
47+
<BreakpointName>
48+
<Ethereum>
49+
<IndicatorManager>
50+
<Blocking>
51+
<TransactionFlow>
52+
<About>
53+
<AppLayout>
54+
{children}
55+
</AppLayout>
56+
</About>
57+
</TransactionFlow>
58+
</Blocking>
59+
</IndicatorManager>
60+
</Ethereum>
61+
</BreakpointName>
62+
</DataSources>
6063
</StoredState>
6164
</UiKit>
6265
</ReactQuery>

frontend/app/src/comps/AppLayout/BottomBar.tsx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import type { Address, TokenSymbol } from "@/src/types";
33
import { Amount } from "@/src/comps/Amount/Amount";
44
import { LinkTextButton } from "@/src/comps/LinkTextButton/LinkTextButton";
55
import { Logo } from "@/src/comps/Logo/Logo";
6-
import { ACCOUNT_SCREEN, CHAIN_BLOCK_EXPLORER, CONTRACT_BOLD_TOKEN, CONTRACT_LQTY_TOKEN } from "@/src/env";
6+
import { useDataSources } from "@/src/comps/DataSources/DataSources";
7+
import { ACCOUNT_SCREEN, CHAIN_BLOCK_EXPLORER, CONTRACT_BOLD_TOKEN, CONTRACT_LQTY_TOKEN, SHOW_DATA_SOURCES } from "@/src/env";
78
import { fmtnum } from "@/src/formatting";
89
import { useLiquityStats } from "@/src/liquity-utils";
910
import { usePrice } from "@/src/services/Prices";
1011
import { useAccount } from "@/src/wagmi-utils";
1112
import { css } from "@/styled-system/css";
12-
import { shortenAddress, TokenIcon } from "@liquity2/uikit";
13+
import { shortenAddress, TextButton, TokenIcon } from "@liquity2/uikit";
1314
import { blo } from "blo";
1415
import Image from "next/image";
1516
import { AboutButton } from "./AboutButton";
@@ -20,9 +21,11 @@ const ENABLE_REDEEM = true;
2021
export function BottomBar() {
2122
const account = useAccount();
2223
const stats = useLiquityStats();
24+
const dataSources = useDataSources();
2325

2426
const tvl = stats.data?.totalValueLocked;
2527
const boldSupply = stats.data?.totalBoldSupply;
28+
const isUsingCustomDataSources = dataSources.isUsingCustomRpc || dataSources.isUsingCustomSubgraph;
2629

2730
return (
2831
<div
@@ -161,6 +164,30 @@ export function BottomBar() {
161164
})}
162165
/>
163166
)}
167+
{SHOW_DATA_SOURCES && (
168+
<TextButton
169+
label={
170+
<div
171+
className={css({
172+
display: "flex",
173+
alignItems: "center",
174+
gap: 4,
175+
whiteSpace: "nowrap",
176+
})}
177+
>
178+
{isUsingCustomDataSources ? "Custom Data Sources" : "Data Sources"}
179+
</div>
180+
}
181+
onClick={() => dataSources.openModal()}
182+
style={{ fontSize: 12 }}
183+
className={css({
184+
color: isUsingCustomDataSources ? "positive" : "content",
185+
borderRadius: 4,
186+
_focusVisible: { outline: "2px solid token(colors.focused)" },
187+
_active: { translate: "0 1px" },
188+
})}
189+
/>
190+
)}
164191
</div>
165192
<div
166193
className={css({

0 commit comments

Comments
 (0)