Skip to content

Commit 2c9da39

Browse files
authored
hack: safe area に対応 (#691)
1 parent 8eda77f commit 2c9da39

File tree

8 files changed

+22
-7
lines changed

8 files changed

+22
-7
lines changed

web/app/chat/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ export default function Layout({ children }: { children: React.ReactNode }) {
99
<ModalProvider>
1010
<Header title="チャット" />
1111
<NavigateByAuthState type="toLoginForUnauthenticated">
12-
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
12+
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
13+
{children}
14+
</div>
1315
</NavigateByAuthState>
1416
<BottomBar activeTab="3_chat" />
1517
</ModalProvider>

web/app/friends/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ export default function Layout({ children }: { children: React.ReactNode }) {
99
<ModalProvider>
1010
<Header title="フレンド" />
1111
<NavigateByAuthState type="toLoginForUnauthenticated">
12-
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
12+
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
13+
{children}
14+
</div>
1315
</NavigateByAuthState>
1416
<BottomBar activeTab="1_friends" />
1517
</ModalProvider>

web/app/globals.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@
1111
.cm-li-btn {
1212
@apply no-animation h-auto w-full justify-start rounded-none border-none bg-white px-6 py-4 text-left font-normal text-base shadow-none hover:bg-zinc-100 focus:bg-zinc-300;
1313
}
14+
15+
/* Bottom Bar の分の幅 */
16+
.cm-pb-footer {
17+
padding-bottom: calc(3rem + env(safe-area-inset-bottom));
18+
}

web/app/home/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Layout({
1111
<>
1212
<Header />
1313
<NavigateByAuthState type="toLoginForUnauthenticated">
14-
<div className="h-full pt-12 pb-12">{children}</div>
14+
<div className="cm-pb-footer h-full pt-12">{children}</div>
1515
</NavigateByAuthState>
1616
<BottomBar activeTab="0_home" />
1717
</>

web/app/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ export default function RootLayout({
3333
<head>
3434
<meta charSet="UTF-8" />
3535
<link rel="icon" type="image/svg+xml" href="/course-mate-icon.svg" />
36-
<meta
36+
{/* TODO: 上書きされる*/}
37+
{/* <meta
3738
name="viewport"
3839
content="width=device-width, initial-scale=1, viewport-fit=cover"
39-
/>
40+
/> */}
4041
<title>CourseMate</title>
4142
</head>
4243
<body className="h-full">

web/app/search/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ export default function Layout({ children }: { children: React.ReactNode }) {
99
<ModalProvider>
1010
<Header title="検索" />
1111
<NavigateByAuthState type="toLoginForUnauthenticated">
12-
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
12+
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
13+
{children}
14+
</div>
1315
</NavigateByAuthState>
1416
<BottomBar activeTab="2_search" />
1517
</ModalProvider>

web/app/settings/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export default function Layout({
1111
<>
1212
<Header title="設定" />
1313
<NavigateByAuthState type="toLoginForUnauthenticated">
14-
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
14+
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
15+
{children}
16+
</div>
1517
</NavigateByAuthState>
1618
<BottomBar activeTab="4_settings" />
1719
</>

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"dev": "next dev -p 5173",
88
"build": "next build",
9+
"postbuild": "find ./out -type f \\( -name \"*.html\" -o -name \"*.txt\" \\) -exec sed -E -i '' 's/(width=device-width, initial-scale=1)([^,])/\\1, viewport-fit=cover\\2/g' {} +",
910
"preview": "next start"
1011
},
1112
"dependencies": {

0 commit comments

Comments
 (0)