Skip to content

Commit e7ce79f

Browse files
fix: better typography, hide slider when maxPerTx=1, added font CSS import
1 parent d5f3132 commit e7ce79f

File tree

4 files changed

+32
-17
lines changed

4 files changed

+32
-17
lines changed

src/components/MintModal.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import { isMobile } from "../utils";
66

77
const DialogTitleWithClose = ({ children, onClose }) => {
88
return <DialogTitle>
9-
<Box sx={{ mr: 4 }}>{children}</Box>
9+
<Box sx={{ textAlign: "center" }}>
10+
{children}
11+
</Box>
1012
{onClose ? (
1113
<IconButton
1214
aria-label="close"
@@ -60,13 +62,15 @@ export const MintModal = (props, ref) => {
6062
}}>
6163
👀
6264
</span>}
63-
<Typography sx={{mt: 3}} variant="subtitle1">{
64-
txHash
65-
? `Minting ${quantity} NFT...`
66-
: 'Confirm the transaction in your wallet'
67-
}</Typography>
65+
<Typography
66+
sx={{ mt: 3, textAlign: "center" }}
67+
variant="h4">
68+
{txHash
69+
? `Minting ${quantity} NFT...`
70+
: 'Confirm the transaction in your wallet'}
71+
</Typography>
6872
{!txHash && <Typography sx={{
69-
mt: 1,
73+
mt: 3,
7074
pl: 3,
7175
pr: 3,
7276
color: "#757575",
@@ -79,7 +83,7 @@ export const MintModal = (props, ref) => {
7983
}
8084
{!isLoading && <>
8185
<DialogTitleWithClose onClose={handleClose}>
82-
{step === 1 ? "Choose how many to mint" : "Pay with"}
86+
<Typography variant="h1">Mint now</Typography>
8387
</DialogTitleWithClose>
8488
<DialogContent style={styles.mintModalContent}>
8589
{step === 1 && <QuantityModalStep
@@ -108,7 +112,8 @@ const styles = {
108112
display: "flex",
109113
flexWrap: "wrap",
110114
flexDirection: "row",
111-
overflow: "visible"
115+
overflow: "visible",
116+
minWidth: "300px"
112117
},
113118
mintOption: {
114119
padding: "16px",

src/components/QuantityModalStep.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { parseTxError, roundToDecimal } from '../utils';
1313
import { Attribution } from './Attribution';
1414
import { isEthereumContract } from "../contract";
1515

16-
export const QuantityModalStep = ({ setQuantity, setStep, setIsLoading, setTxHash }) => {
16+
export const QuantityModalStep = ({ setQuantity, setIsLoading, setTxHash, setStep }) => {
1717
const [quantityValue, setQuantityValue] = useState(1)
1818
const [maxTokens, setMaxTokens] = useState(getDefaultMaxTokensPerMint())
1919
const [mintPrice, setMintPrice] = useState(undefined)
@@ -66,11 +66,11 @@ export const QuantityModalStep = ({ setQuantity, setStep, setIsLoading, setTxHas
6666
}
6767

6868
return <div style={{ width: "100%" }}>
69-
<Box sx={{
69+
{maxTokens > 1 && <Box sx={{
7070
display: "flex",
7171
alignItems: "flex-end",
7272
width: "100%",
73-
height: 75
73+
height: 64
7474
}}>
7575
<Slider
7676
sx={{ ml: 2 }}
@@ -86,15 +86,15 @@ export const QuantityModalStep = ({ setQuantity, setStep, setIsLoading, setTxHas
8686
min={1}
8787
max={maxTokens}
8888
/>
89-
</Box>
89+
</Box>}
9090
<Button
9191
onClick={onSuccess}
92-
sx={{ mt: 4, width: "100%" }}
92+
sx={{ mt: maxTokens > 1 ? 4 : 2, width: "100%" }}
9393
variant="contained"
9494
>
9595
{mintPrice !== undefined
9696
? (mintPrice !== 0 ? `Mint for ${roundToDecimal(mintPrice * quantityValue, 4)} ETH` : "Mint for free")
97-
: "Mint now"}
97+
: "Mint"}
9898
</Button>
9999
{!window.DEFAULTS?.hideCounter && <Box
100100
sx={{

src/styles/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
2+
13
.MuiDialog-container {
24
font-family: "Inter", BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
35
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif !important;

src/styles/theme.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,23 @@ export const theme = createTheme({
112112
}
113113
},
114114
typography: {
115-
fontFamily: "Inter, San Francisco, Roboto, Helvetica, sans-serif",
115+
fontFamily: '"Inter", San Francisco, Roboto, Helvetica, sans-serif',
116116
button: {
117117
color: buttonTextColor,
118118
fontSize: "1rem !important",
119119
textTransform: "none",
120120
},
121+
h1: {
122+
color: primaryTextColor,
123+
fontWeight: 700,
124+
lineHeight: 1.4,
125+
fontSize: "2rem"
126+
},
121127
h4: {
122128
color: primaryTextColor,
123-
fontWeight: 600
129+
fontWeight: 600,
130+
fontSize: "1.3rem",
131+
lineHeight: 1.4
124132
},
125133
subtitle1: {
126134
color: primaryTextColor,

0 commit comments

Comments
 (0)