Skip to content

Commit 8de7f62

Browse files
committed
fix(pali-v2): add disclaimer to to remove default wallet
1 parent eca06f5 commit 8de7f62

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

components/Bridge/hooks/useFeatureFlags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ type FeatureFlags = {
44
foundationFundingAvailable: boolean;
55
adminEnabled: boolean;
66
isSys5Enabled: boolean;
7+
isPaliV2NevmEnabled: boolean;
78
};
89

910
export const useFeatureFlags = () => {

components/Home/PaliV2Bridge.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1-
import { Box, Button } from "@mui/material";
1+
import { Alert, Box, Button } from "@mui/material";
22
import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
33

44
import Link from "next/link";
5+
import { useFeatureFlags } from "components/Bridge/hooks/useFeatureFlags";
56

67
export const PaliV2Bridge = () => {
8+
const { isEnabled } = useFeatureFlags();
9+
10+
const isPaliV2NevmEnabled = isEnabled("isPaliV2NevmEnabled");
11+
12+
if (!isPaliV2NevmEnabled) {
13+
return (
14+
<Box display="flex" justifyContent="space-between">
15+
<Alert severity="warning">
16+
Pali V2 or V3 NEVM Contract Calls are not supported yet. <br />
17+
Please set your default wallet to Metamask. <br />
18+
See instructions below.
19+
</Alert>
20+
</Box>
21+
);
22+
}
23+
724
return (
825
<Box display="flex" justifyContent="space-between">
926
<Link href={`/bridge/sys-to-nevm`}>

pages/api/flags.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ function handler(req: NextApiRequest, res: NextApiResponse) {
44
const foundationFundingAvailable = process.env.FOUNDATION_FUNDED === "true";
55
const adminEnabled = process.env.ADMIN_API_KEY !== undefined;
66
const isSys5Enabled = process.env.SYS5_ENABLED === "true";
7+
const isPaliV2NevmEnabled = process.env.PALI_V2_NEVM_ENABLED === "true";
78
return res
89
.status(200)
9-
.json({ foundationFundingAvailable, adminEnabled, isSys5Enabled });
10+
.json({
11+
foundationFundingAvailable,
12+
adminEnabled,
13+
isSys5Enabled,
14+
isPaliV2NevmEnabled,
15+
});
1016
}
1117

1218
export default handler;

0 commit comments

Comments
 (0)