Skip to content

Commit f3de7a9

Browse files
committed
add material ui theme (fixes styling of wallet dialog)
1 parent 214caf7 commit f3de7a9

File tree

2 files changed

+44
-14
lines changed

2 files changed

+44
-14
lines changed

Diff for: src/App.tsx

+42-14
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from "@solana/wallet-adapter-react";
2121

2222
import { WalletDialogProvider } from "@solana/wallet-adapter-material-ui";
23+
import { createTheme, ThemeProvider } from "@material-ui/core";
2324

2425
const treasury = new anchor.web3.PublicKey(
2526
process.env.REACT_APP_TREASURY_ADDRESS!
@@ -42,6 +43,31 @@ const startDateSeed = parseInt(process.env.REACT_APP_CANDY_START_DATE!, 10);
4243

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

46+
const theme = createTheme({
47+
palette: {
48+
type: 'dark',
49+
},
50+
overrides: {
51+
MuiButtonBase: {
52+
root: {
53+
justifyContent: 'flex-start',
54+
},
55+
},
56+
MuiButton: {
57+
root: {
58+
textTransform: undefined,
59+
padding: '12px 16px',
60+
},
61+
startIcon: {
62+
marginRight: 8,
63+
},
64+
endIcon: {
65+
marginLeft: 8,
66+
},
67+
},
68+
},
69+
});
70+
4571
const App = () => {
4672
const endpoint = useMemo(() => clusterApiUrl(network), []);
4773

@@ -57,20 +83,22 @@ const App = () => {
5783
);
5884

5985
return (
60-
<ConnectionProvider endpoint={endpoint}>
61-
<WalletProvider wallets={wallets} autoConnect>
62-
<WalletDialogProvider>
63-
<Home
64-
candyMachineId={candyMachineId}
65-
config={config}
66-
connection={connection}
67-
startDate={startDateSeed}
68-
treasury={treasury}
69-
txTimeout={txTimeout}
70-
/>
71-
</WalletDialogProvider>
72-
</WalletProvider>
73-
</ConnectionProvider>
86+
<ThemeProvider theme={theme}>
87+
<ConnectionProvider endpoint={endpoint}>
88+
<WalletProvider wallets={wallets} autoConnect>
89+
<WalletDialogProvider>
90+
<Home
91+
candyMachineId={candyMachineId}
92+
config={config}
93+
connection={connection}
94+
startDate={startDateSeed}
95+
treasury={treasury}
96+
txTimeout={txTimeout}
97+
/>
98+
</WalletDialogProvider>
99+
</WalletProvider>
100+
</ConnectionProvider>
101+
</ThemeProvider>
74102
);
75103
};
76104

Diff for: src/index.css

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ body {
55
sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
8+
background-color: #303030;
9+
color: #FFFFFF;
810
}
911

1012
code {

0 commit comments

Comments
 (0)