Skip to content

Commit

Permalink
perf: 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonpete32 committed Oct 31, 2024
1 parent a762bf9 commit fac8831
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PRODUCTION_URL=https://safe-app.abuusama.dev/
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { type Address, encodeFunctionData, parseAbiItem } from "viem";
import { useSafeAppsSDK } from "@safe-global/safe-apps-react-sdk";
import { Button } from "./components/ui/button";
import { useSendSafeTx } from "./hooks/send-safe-transaction";
import { SITE_URL } from "./constants/site";

// Mock USDC on Sepolia with a `faucet()` function
const USDC = "0x9EfEE50bea4E83447D4c0DC7c4723F1940400B8C";
Expand All @@ -20,6 +21,7 @@ const SafeApp = (): React.ReactElement => {
<div className="flex min-h-screen">
<div className="flex flex-col items-center gap-6 mx-auto mt-16">
<p className="text-2xl">Safe: {safe.safeAddress}</p>
<p className="text-sm text-gray-500">Current URL: {SITE_URL}</p>
<Button
variant="default"
color="primary"
Expand Down
7 changes: 7 additions & 0 deletions src/constants/site.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const getSiteUrl = () => {
if (process.env.PRODUCTION_URL) return `https://${process.env.PRODUCTION_URL}`;
return "http://localhost:3000";
};

export const SITE_URL = getSiteUrl();
export const APP_NAME = "Safe App Boilerplate";

0 comments on commit fac8831

Please sign in to comment.