Skip to content

hack: safe area に対応 #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/app/chat/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<ModalProvider>
<Header title="チャット" />
<NavigateByAuthState type="toLoginForUnauthenticated">
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
{children}
</div>
</NavigateByAuthState>
<BottomBar activeTab="3_chat" />
</ModalProvider>
Expand Down
4 changes: 3 additions & 1 deletion web/app/friends/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<ModalProvider>
<Header title="フレンド" />
<NavigateByAuthState type="toLoginForUnauthenticated">
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
{children}
</div>
</NavigateByAuthState>
<BottomBar activeTab="1_friends" />
</ModalProvider>
Expand Down
5 changes: 5 additions & 0 deletions web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@
.cm-li-btn {
@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;
}

/* Bottom Bar の分の幅 */
.cm-pb-footer {
padding-bottom: calc(3rem + env(safe-area-inset-bottom));
}
2 changes: 1 addition & 1 deletion web/app/home/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Layout({
<>
<Header />
<NavigateByAuthState type="toLoginForUnauthenticated">
<div className="h-full pt-12 pb-12">{children}</div>
<div className="cm-pb-footer h-full pt-12">{children}</div>
</NavigateByAuthState>
<BottomBar activeTab="0_home" />
</>
Expand Down
5 changes: 3 additions & 2 deletions web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ export default function RootLayout({
<head>
<meta charSet="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/course-mate-icon.svg" />
<meta
{/* TODO: 上書きされる*/}
{/* <meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
/> */}
<title>CourseMate</title>
</head>
<body className="h-full">
Expand Down
4 changes: 3 additions & 1 deletion web/app/search/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<ModalProvider>
<Header title="検索" />
<NavigateByAuthState type="toLoginForUnauthenticated">
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
{children}
</div>
</NavigateByAuthState>
<BottomBar activeTab="2_search" />
</ModalProvider>
Expand Down
4 changes: 3 additions & 1 deletion web/app/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default function Layout({
<>
<Header title="設定" />
<NavigateByAuthState type="toLoginForUnauthenticated">
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
<div className="cm-pb-footer h-full overflow-y-auto pt-12">
{children}
</div>
</NavigateByAuthState>
<BottomBar activeTab="4_settings" />
</>
Expand Down
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "next dev -p 5173",
"build": "next build",
"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' {} +",
"preview": "next start"
},
"dependencies": {
Expand Down
Loading