Skip to content

Commit cc41385

Browse files
authored
Merge pull request #1504 from scroll-tech/layout-unit
fix: use svh
2 parents bf0e7ac + 1126d57 commit cc41385

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

src/app/SCR-sSCR/Header/GetSCRDialog.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const GetSCRDialog = props => {
2424
"& .MuiDialog-paper": {
2525
width: "54.4rem",
2626
maxWidth: "100%",
27-
padding: "4rem 3.2rem",
2827
borderRadius: "2rem",
2928
},
3029
},
@@ -33,11 +32,10 @@ const GetSCRDialog = props => {
3332
"& .MuiDialog-paper": {
3433
margin: 0,
3534
borderRadius: 0,
36-
height: "calc(var(--vh, 1vh) * 100)",
35+
height: "100dvh",
3736
maxHeight: "unset",
3837
minWidth: "unset",
3938
width: "100%",
40-
padding: "1.6rem 2rem 2rem",
4139
},
4240
},
4341
}),
@@ -48,18 +46,18 @@ const GetSCRDialog = props => {
4846
<DialogTitle
4947
sx={{
5048
position: "relative",
51-
height: ["3.2rem", "3.6rem"],
49+
height: ["4.8rem", "7.6rem"],
5250
fontSize: ["2rem", "2.4rem"],
5351
lineHeight: "3.6rem",
5452
fontWeight: 600,
55-
p: 0,
53+
p: ["1.6rem 2rem 0", "4rem 3.2rem 0"],
5654
mb: ["0.8rem", "2.4rem"],
5755
textAlign: "center",
5856
}}
5957
>
6058
<span>Get SCR</span>
6159
<IconButton
62-
sx={{ position: "absolute", right: "-0.8rem", top: ["-0.1rem", "-1.6rem"], "&:hover": { backgroundColor: "unset" } }}
60+
sx={{ position: "absolute", right: ["0.8rem", "1.6rem"], top: ["0.8rem", "1.6rem"], "&:hover": { backgroundColor: "unset" } }}
6361
onClick={onClose}
6462
>
6563
<SvgIcon sx={{ fontSize: "1.8rem" }} component={CloseSvg} inheritViewBox></SvgIcon>
@@ -68,8 +66,9 @@ const GetSCRDialog = props => {
6866

6967
<DialogContent
7068
sx={{
71-
p: 0,
7269
minHeight: "50rem",
70+
p: ["0 2rem 2rem", "0 3.2rem 3.2rem"],
71+
7372
"&::-webkit-scrollbar-thumb": {
7473
backgroundColor: "rgba(209, 205, 204, 0.6)",
7574
borderRadius: "8px",

src/app/globals.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ object {
2727
}
2828

2929
:root {
30-
--vh: 100vh;
3130
--theme-bg: #fff8f3;
3231
}
3332

src/app/template.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Box } from "@mui/material"
66

77
import Footer from "@/components/Footer"
88
import Header from "@/components/Header"
9-
import useCheckTheme from "@/components/Header/useCheckTheme"
109
import useHideFooter from "@/hooks/useHideFooter"
1110
import { isSepolia } from "@/utils"
1211

@@ -15,18 +14,6 @@ import "./global"
1514
export default function RootTemplate({ children }: { children: ReactNode }) {
1615
const hideFooter = useHideFooter()
1716

18-
// useEffect(() => {
19-
// function setVh() {
20-
// const vh = window.innerHeight * 0.01
21-
// document.documentElement.style.setProperty("--vh", `${vh}px`)
22-
// }
23-
// setVh()
24-
// window.addEventListener("resize", setVh)
25-
// return () => {
26-
// window.removeEventListener("resize", setVh)
27-
// }
28-
// }, [])
29-
3017
return (
3118
<Box sx={{ minHeight: "100vh" }}>
3219
<Header></Header>

0 commit comments

Comments
 (0)