Skip to content

Commit ce836e4

Browse files
authored
release: PWA Manifest の追加 (#692)
2 parents 83214a6 + 49e903e commit ce836e4

File tree

13 files changed

+60
-12
lines changed

13 files changed

+60
-12
lines changed

common/lib/panic.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// unexpected error
22
export function panic(reason: string): never {
3-
throw new Error(reason, {
4-
cause: "panic",
5-
});
3+
throw new Error(reason);
4+
// TODO: 型エラーとなるため一時的にコメントアウト
5+
// throw new Error(reason, {
6+
// cause: "panic",
7+
// });
68
}

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: 4 additions & 3 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"
38-
content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
39-
/>
39+
content="width=device-width, initial-scale=1, viewport-fit=cover"
40+
/> */}
4041
<title>CourseMate</title>
4142
</head>
4243
<body className="h-full">

web/app/manifest.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { MetadataRoute } from "next";
2+
3+
export default function manifest(): MetadataRoute.Manifest {
4+
return {
5+
name: "CourseMate",
6+
short_name: "CourseMate",
7+
description: "同じ授業を履修している友達を見つけられるアプリ",
8+
start_url: "/",
9+
display: "standalone",
10+
background_color: "#ffffff",
11+
theme_color: "#ffffff",
12+
icons: [
13+
{
14+
src: "/icon-192x192.png",
15+
sizes: "192x192",
16+
type: "image/png",
17+
},
18+
{
19+
src: "/icon-512x512.png",
20+
sizes: "512x512",
21+
type: "image/png",
22+
},
23+
],
24+
};
25+
}

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/components/BottomBar.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ function BottomBarCell({
3636
export default function BottomBar(props: Props) {
3737
const { activeTab } = props;
3838
return (
39-
<div className="fixed bottom-0 z-30 flex h-12 w-full flex-row items-center justify-around border-gray-200 border-t bg-white">
39+
<div
40+
className="fixed bottom-0 z-30 flex w-full flex-row items-center justify-around border-gray-200 border-t bg-white"
41+
style={{
42+
height: "calc(3rem + env(safe-area-inset-bottom))",
43+
paddingBottom: "env(safe-area-inset-bottom)",
44+
}}
45+
>
4046
<BottomBarCell
4147
href="/home"
4248
iconComponent={

0 commit comments

Comments
 (0)