Skip to content

Commit 44e7721

Browse files
committed
add env
1 parent 52004ac commit 44e7721

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

app/pages/_app.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@ import {
33
WalletProvider,
44
} from "@solana/wallet-adapter-react";
55
import { WalletModalProvider } from "@solana/wallet-adapter-react-ui";
6+
import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
67
import {
78
PhantomWalletAdapter,
89
} from "@solana/wallet-adapter-wallets";
910
import { useMemo } from "react";
1011
import { AppProvider } from "../context/context";
1112
import "../styles/globals.css";
13+
import { clusterApiUrl } from "@solana/web3.js";
1214

1315
require("@solana/wallet-adapter-react-ui/styles.css");
1416

1517
import { useRouter } from 'next/router';
1618
import Header from "../components/Header";
1719
import style from "../styles/Home.module.css";
1820
function MyApp({ Component, pageProps }) {
19-
// const endpoint = clusterApiUrl(WalletAdapterNetwork.Devnet);
21+
22+
const endpoint = process.env.NEXT_PUBLIC_TEST_NETWORK === 'true' ? "http://127.0.0.1:8899" : clusterApiUrl(WalletAdapterNetwork.Devnet);
2023
const router = useRouter();
21-
const endpoint = "http://127.0.0.1:8899";
24+
25+
// const endpoint = "http://127.0.0.1:8899";
2226

2327
const wallets = useMemo(
2428
() => [

app/styles/Proposal.module.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@
5050
color: #333;
5151
}
5252
.error, .success {
53-
color: red;
5453
margin-bottom: 0.5em;
5554
display: inline-block;
5655
}
56+
.error {
57+
color: red;
58+
}
59+
.succes {
60+
color: green;
61+
}
5762
.listChoices {
5863
display: grid;
5964
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));

app/utils/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PublicKey } from "@solana/web3.js";
22

33
export const PROGRAM_ID = new PublicKey(
4-
"4AEtDMG3A5rFTFwj6KyA6K41dxxpagemC4CaG5w9oABc"//"8KcDj4FdPm6Dq6KoLFCAgPrAYEMbXtE9Ruc7B62UGeyJ"
4+
process.env.NEXT_PUBLIC_PROGRAM_ADDRESS
55
);

0 commit comments

Comments
 (0)