Skip to content

Commit a2c5468

Browse files
author
Andréas Brey
committed
upgraded wallets list (added ledge + safepal) + cleaned App.css file
1 parent e37f6b4 commit a2c5468

File tree

9 files changed

+279
-250
lines changed

9 files changed

+279
-250
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ REACT_APP_CANDY_MACHINE_ID=__PLACEHOLDER__
22
REACT_APP_SOLANA_NETWORK=devnet
33
REACT_APP_SOLANA_RPC_HOST=https://api.devnet.solana.com
44

5-
# Params to set if Spl-Token to mint is enabled
5+
6+
# Params to set if using custom Spl-Token to mint
67
# Spl-Token symbol to display next the price
8+
79
REACT_APP_SPL_TOKEN_NAME=
810

911
# Spl-token decimals place defined on creation (default is 9)
12+
1013
REACT_APP_SPL_TOKEN_DECIMALS=

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
**31 Jan 2022**
2+
3+
REQUIRE A YARN INSTALL
4+
5+
Upgraded wallets list. Supported wallets are :
6+
7+
- Phantom
8+
- Slope
9+
- Solflare
10+
- Solflare Web
11+
- Sollet
12+
- Sollet Extension
13+
- Solong
14+
- Ledger
15+
- SafePal
16+
117
**25 Jan 2022**
218

319
Fixed MINTING using spl-token functionality :

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ But that's not all, I share with you a **Prod-ready Responsive UI** which can be
55

66
![Candy Machine Preview Image](https://i.imgur.com/WWSvkBO.png)
77

8-
I did this in a few hours, and didn't have the time to make it fully ReactJs best practices compliant. So please be kind :)
8+
### Supported Wallets
9+
10+
![Supported Wallets](https://i.ibb.co/DC6Wt66/wallets.png)
911

1012
For instructions on how to set up a V2 candy machine, please refer to Metaplex's documentation [here](https://docs.metaplex.com/candy-machine-v2/Introduction)
1113

@@ -60,7 +62,7 @@ REACT_APP_SOLANA_RPC_HOST=https://api.devnet.solana.com
6062
This identifies the RPC server your web app will access the Solana network through.
6163

6264

63-
If you are using a SPL Token to MINT, you have two additional environment parameters to set :
65+
If you are using a custom SPL Token to MINT, you have two additional environment parameters to set :
6466

6567

6668
```

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
"@material-ui/lab": "^4.0.0-alpha.60",
1212
"@project-serum/anchor": "^0.14.0",
1313
"@solana/spl-token": "^0.1.8",
14-
"@solana/wallet-adapter-base": "^0.5.2",
15-
"@solana/wallet-adapter-material-ui": "^0.14.0",
16-
"@solana/wallet-adapter-react": "^0.11.0",
17-
"@solana/wallet-adapter-react-ui": "^0.8.0",
18-
"@solana/wallet-adapter-wallets": "^0.9.0",
14+
"@solana/wallet-adapter-base": "^0.7.1",
15+
"@solana/wallet-adapter-react": "^0.13.1",
16+
"@solana/wallet-adapter-react-ui": "^0.6.1",
17+
"@solana/wallet-adapter-wallets": "^0.11.3",
1918
"@solana/web3.js": "^1.32.0",
2019
"@testing-library/dom": ">=7.21.4",
2120
"@testing-library/jest-dom": "^5.11.4",

src/App.css

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,5 @@ h3{
2121
font-weight: normal;
2222
}
2323

24-
.MuiFab-extended{
25-
height: auto;
26-
padding-right: 0 !important;
27-
}
28-
29-
.MuiFab-label{
30-
font-weight: bold;
31-
}
32-
33-
.MuiPaper-root{
34-
background-color: var(--card-background-color) !important;
35-
}
36-
37-
.MuiButton-containedPrimary:not(.MuiButton-fullWidth){
38-
border-radius: 24px !important;
39-
padding: 6px 16px;
40-
}
41-
42-
.MuiButton-label{
43-
font-size: 1.2em;
44-
}
4524

46-
.MuiLinearProgress-colorPrimary{
47-
background-color:var(--main-text-color) !important;
48-
}
4925

50-
.MuiLinearProgress-barColorPrimary{
51-
background-color:var(--title-text-color) !important;
52-
}

src/App.tsx

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
1-
import "./App.css";
2-
import Home from "./Home";
1+
import { createTheme, ThemeProvider } from "@material-ui/core";
32
import { useMemo } from "react";
3+
import {
4+
ConnectionProvider,
5+
WalletProvider,
6+
} from "@solana/wallet-adapter-react";
47
import * as anchor from "@project-serum/anchor";
58
import { clusterApiUrl } from "@solana/web3.js";
69
import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
710
import {
8-
getPhantomWallet,
9-
getSlopeWallet,
10-
getSolflareWallet,
11-
getSolletWallet,
12-
getSolletExtensionWallet,
11+
getPhantomWallet,
12+
getSlopeWallet,
13+
getSolflareWallet,
14+
getSolflareWebWallet,
15+
getSolletWallet,
16+
getSolletExtensionWallet,
17+
getSolongWallet,
18+
getLedgerWallet,
19+
getSafePalWallet,
1320
} from "@solana/wallet-adapter-wallets";
1421

1522
import {
16-
ConnectionProvider,
17-
WalletProvider,
18-
} from "@solana/wallet-adapter-react";
23+
WalletModalProvider
24+
} from '@solana/wallet-adapter-react-ui';
25+
26+
import "./App.css";
27+
import Home from "./Home";
28+
29+
require('@solana/wallet-adapter-react-ui/styles.css');
1930

20-
import { WalletDialogProvider } from "@solana/wallet-adapter-material-ui";
21-
import { createTheme, ThemeProvider } from "@material-ui/core";
2231

2332
const candyMachineId = new anchor.web3.PublicKey(
2433
process.env.REACT_APP_CANDY_MACHINE_ID!
@@ -57,31 +66,39 @@ const theme = createTheme({
5766
});
5867

5968
const App = () => {
69+
// Custom RPC endpoint.
6070
const endpoint = useMemo(() => clusterApiUrl(network), []);
6171

62-
const wallets = useMemo(
63-
() => [
64-
getPhantomWallet(),
65-
getSlopeWallet(),
66-
getSolflareWallet(),
67-
getSolletWallet({ network }),
68-
getSolletExtensionWallet({ network })
69-
],
70-
[]
71-
);
72+
// @solana/wallet-adapter-wallets includes all the adapters but supports tree shaking and lazy loading --
73+
// Only the wallets you configure here will be compiled into your application, and only the dependencies
74+
// of wallets that your users connect to will be loaded.
75+
const wallets = useMemo(
76+
() => [
77+
getPhantomWallet(),
78+
getSlopeWallet(),
79+
getSolflareWallet(),
80+
getSolflareWebWallet(),
81+
getSolletWallet({ network }),
82+
getSolletExtensionWallet({ network }),
83+
getSolongWallet(),
84+
getLedgerWallet(),
85+
getSafePalWallet(),
86+
],
87+
[]
88+
);
7289

7390
return (
7491
<ThemeProvider theme={theme}>
7592
<ConnectionProvider endpoint={endpoint}>
7693
<WalletProvider wallets={wallets} autoConnect={true}>
77-
<WalletDialogProvider>
94+
<WalletModalProvider>
7895
<Home
7996
candyMachineId={candyMachineId}
8097
connection={connection}
8198
txTimeout={txTimeout}
8299
rpcHost={rpcHost}
83100
/>
84-
</WalletDialogProvider>
101+
</WalletModalProvider>
85102
</WalletProvider>
86103
</ConnectionProvider>
87104
</ThemeProvider>

src/Home.tsx

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import confetti from "canvas-confetti";
44
import * as anchor from "@project-serum/anchor";
55
import {LAMPORTS_PER_SOL, PublicKey} from "@solana/web3.js";
66
import {useAnchorWallet} from "@solana/wallet-adapter-react";
7-
import {WalletMultiButton} from "@solana/wallet-adapter-material-ui";
7+
import {WalletMultiButton} from "@solana/wallet-adapter-react-ui";
88
import {GatewayProvider} from '@civic/solana-gateway-react';
99
import Countdown from "react-countdown";
1010
import {Snackbar, Paper, LinearProgress, Chip} from "@material-ui/core";
@@ -29,10 +29,52 @@ const WalletContainer = styled.div`
2929
flex-wrap: wrap;
3030
justify-content: center;
3131
`;
32+
33+
const WalletAmount = styled.div`
34+
color: black;
35+
width: auto;
36+
padding: 5px 5px 5px 16px;
37+
min-width: 48px;
38+
min-height: auto;
39+
border-radius: 22px;
40+
background-color: var(--main-text-color);
41+
box-shadow: 0px 3px 5px -1px rgb(0 0 0 / 20%), 0px 6px 10px 0px rgb(0 0 0 / 14%), 0px 1px 18px 0px rgb(0 0 0 / 12%);
42+
box-sizing: border-box;
43+
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
44+
font-weight: 500;
45+
line-height: 1.75;
46+
text-transform: uppercase;
47+
border: 0;
48+
margin: 0;
49+
display: inline-flex;
50+
outline: 0;
51+
position: relative;
52+
align-items: center;
53+
user-select: none;
54+
vertical-align: middle;
55+
justify-content: flex-start;
56+
gap: 10px;
57+
`;
58+
59+
const Wallet = styled.ul`
60+
flex: 0 0 auto;
61+
margin: 0;
62+
padding: 0;
63+
`;
64+
65+
const ConnectButton = styled(WalletMultiButton)`
66+
border-radius: 18px !important;
67+
padding: 6px 16px;
68+
background-color: #4E44CE;
69+
margin: 0 auto;
70+
`;
71+
3272
const NFT = styled(Paper)`
3373
min-width: 400px;
3474
padding: 5px 20px 20px 20px;
3575
flex: 1 1 auto;
76+
background-color: var(--card-background-color) !important;
77+
3678
`;
3779
const Des = styled(NFT)`
3880
text-align: left;
@@ -71,36 +113,6 @@ const MintButtonContainer = styled.div`
71113
}
72114
`;
73115

74-
const WalletAmount = styled.div`
75-
color: black;
76-
width: auto;
77-
height: 48px;
78-
padding: 0 5px 0 16px;
79-
min-width: 48px;
80-
min-height: auto;
81-
border-radius: 24px;
82-
background-color: var(--main-text-color);
83-
box-shadow: 0px 3px 5px -1px rgb(0 0 0 / 20%), 0px 6px 10px 0px rgb(0 0 0 / 14%), 0px 1px 18px 0px rgb(0 0 0 / 12%);
84-
box-sizing: border-box;
85-
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
86-
font-weight: 500;
87-
line-height: 1.75;
88-
text-transform: uppercase;
89-
border: 0;
90-
margin: 0;
91-
display: inline-flex;
92-
outline: 0;
93-
position: relative;
94-
align-items: center;
95-
user-select: none;
96-
vertical-align: middle;
97-
justify-content: flex-start;
98-
gap: 10px;
99-
100-
`;
101-
102-
const ConnectButton = styled(WalletMultiButton)`
103-
`;
104116
const Logo = styled.div`
105117
flex: 0 0 auto;
106118
@@ -157,11 +169,6 @@ const SolExplorerLink = styled.a`
157169
}
158170
`;
159171

160-
const Wallet = styled.ul`
161-
flex: 0 0 auto;
162-
margin: 0;
163-
padding: 0;
164-
`;
165172
const MainContainer = styled.div`
166173
display: flex;
167174
flex-direction: column;
@@ -208,6 +215,12 @@ const BorderLinearProgress = styled(LinearProgress)`
208215
border-radius: 30px;
209216
border: 2px solid white;
210217
box-shadow: 5px 5px 40px 5px rgba(0,0,0,0.5);
218+
background-color:var(--main-text-color) !important;
219+
220+
> div.MuiLinearProgress-barColorPrimary{
221+
background-color:var(--title-text-color) !important;
222+
}
223+
211224
> div.MuiLinearProgress-bar1Determinate {
212225
border-radius: 30px !important;
213226
background-image: linear-gradient(270deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.5));

src/MintButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export const CTAButton = styled(Button)`
1010
display: block !important;
1111
margin: 0 auto !important;
1212
background-color: var(--title-text-color) !important;
13-
font-size: 1.2em;
13+
min-width: 120px !important;
14+
font-size: 1em !important;
1415
`;
1516

1617
export const MintButton = ({

0 commit comments

Comments
 (0)