Skip to content

Commit

Permalink
Up-to-date with Metaplex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GottliebGlob committed Jul 4, 2022
1 parent 17f1a6f commit 7070093
Show file tree
Hide file tree
Showing 11 changed files with 1,111 additions and 802 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Intoduction
**candy-machine-ui** is a fork of [Fulgurus/candy-machine-v2-responsive-ui](https://github.com/pandao/editor.md "link") repo.

**Up-to-date with metaplex from v1.1.**
## Features

- **Auto refresh.** Every few seconds ui is updated, This allows you to track the amount of minted NFTs in real time.
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Forest Industry"
content="Candy Machine UI"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Forest Industry</title>
<title>Candy Machine UI</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 31 additions & 22 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,36 @@ import {
} from '@solana/wallet-adapter-react-ui';

import "./App.css";
import { DEFAULT_TIMEOUT } from './connection';
import {MintPage} from "./Home";

require('@solana/wallet-adapter-react-ui/styles.css');

const getCandyMachineId = (): anchor.web3.PublicKey | undefined => {
try {
const candyMachineId = new anchor.web3.PublicKey(
process.env.REACT_APP_CANDY_MACHINE_ID!,
);

const candyMachineId = new anchor.web3.PublicKey(
process.env.REACT_APP_CANDY_MACHINE_ID!
);
return candyMachineId;
} catch (e) {
console.log('Failed to construct CandyMachineId', e);
return undefined;
}
};

const candyMachineId = getCandyMachineId();

const network = process.env.REACT_APP_SOLANA_NETWORK as WalletAdapterNetwork;

const rpcHost = process.env.REACT_APP_SOLANA_RPC_HOST!;
const connection = new anchor.web3.Connection(rpcHost);

const txTimeout = 30000; // milliseconds (confirm this works for your project)


const connection = new anchor.web3.Connection(
rpcHost ? rpcHost : anchor.web3.clusterApiUrl('devnet'),
);

const App = () => {
// Custom RPC endpoint.
const endpoint = useMemo(() => clusterApiUrl(network), []);
const endpoint = useMemo(() => clusterApiUrl(network), []);

// @solana/wallet-adapter-wallets includes all the adapters but supports tree shaking and lazy loading --
// Only the wallets you configure here will be compiled into your application, and only the dependencies
Expand All @@ -63,21 +72,21 @@ const App = () => {
[]
);

return (

return (
<ConnectionProvider endpoint={endpoint}>
<WalletProvider wallets={wallets} autoConnect={true}>
<WalletModalProvider>
<MintPage
candyMachineId={candyMachineId}
connection={connection}
txTimeout={txTimeout}
rpcHost={rpcHost}
/>
</WalletModalProvider>
</WalletProvider>
<WalletProvider wallets={wallets} autoConnect={true}>
<WalletModalProvider>
<MintPage
candyMachineId={candyMachineId}
connection={connection}
txTimeout={DEFAULT_TIMEOUT}
rpcHost={rpcHost}
network={network}
/>
</WalletModalProvider>
</WalletProvider>
</ConnectionProvider>
);
);
};

export default App;
Loading

0 comments on commit 7070093

Please sign in to comment.