Skip to content

Commit e755325

Browse files
committed
Home のデザイン修正・モバイルでの挙動修正 (#629)
# PRの概要 #622 #627 を参照ください ## レビューリクエストを出す前にチェック! - [ ] 改めてセルフレビューしたか - [ ] 手動での動作検証を行ったか - [ ] server の機能追加ならば、テストを書いたか - 理由: 書いた | server の機能追加ではない - [ ] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか - 理由: 書いた | 間違った使い方は存在しない - [ ] わかりやすいPRになっているか <!-- レビューリクエスト後は、Slackでもメンションしてお願いすることを推奨します。 -->
1 parent 0ed8678 commit e755325

28 files changed

Lines changed: 195 additions & 328 deletions

web/README.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

web/app/chat/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 title="チャット" />
1313
<NavigateByAuthState type="toLoginForUnauthenticated">
14-
<div className="flex-1 overflow-hidden">{children}</div>
14+
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
1515
</NavigateByAuthState>
1616
<BottomBar activeTab="3_chat" />
1717
</>

web/app/friends/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 title="フレンド" />
1313
<NavigateByAuthState type="toLoginForUnauthenticated">
14-
<div className="grow overflow-y-auto">{children}</div>
14+
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
1515
</NavigateByAuthState>
1616
<BottomBar activeTab="1_friends" />
1717
</>

web/app/friends/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export default function Friends() {
1515
const [activeTab, setActiveTab] = useState("matching");
1616

1717
return (
18-
<div className="w-full">
19-
<div className="flex w-full border-gray-200 border-b">
18+
<div className="relative w-full">
19+
<div className="fixed top-12 flex h-10 w-full border-gray-200 border-b bg-white">
2020
<button
2121
type="button"
22-
className={`relative flex-1 py-3 text-center ${
22+
className={`relative flex-1 text-center ${
2323
activeTab === "matching" ? "text-primary" : "text-gray-600"
2424
}`}
2525
onClick={() => setActiveTab("matching")}
@@ -31,7 +31,7 @@ export default function Friends() {
3131
</button>
3232
<button
3333
type="button"
34-
className={`relative flex-1 py-2 text-center ${
34+
className={`relative flex-1 text-center ${
3535
activeTab === "request" ? "text-primary" : "text-gray-600"
3636
}`}
3737
onClick={() => setActiveTab("request")}
@@ -43,7 +43,7 @@ export default function Friends() {
4343
</button>
4444
</div>
4545

46-
<div className="text-center text-gray-700 text-lg">
46+
<div className="pt-10 text-center text-gray-700 text-lg">
4747
{activeTab === "matching" ? <NoSSRMatchings /> : <NoSSRRequests />}
4848
</div>
4949
</div>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
interface RoundButtonProps {
2+
onclick: () => void;
3+
icon: React.ReactNode;
4+
}
5+
6+
export default function RoundButton({ onclick, icon }: RoundButtonProps) {
7+
return (
8+
<button
9+
type="button"
10+
onClick={onclick}
11+
className="btn btn-circle bg-white shadow-md"
12+
>
13+
{icon}
14+
</button>
15+
);
16+
}

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="grow overflow-y-auto ">{children}</div>
14+
<div className="h-full pt-12 pb-12">{children}</div>
1515
</NavigateByAuthState>
1616
<BottomBar activeTab="0_home" />
1717
</>

web/app/home/page.tsx

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
"use client";
22

3-
import CloseIcon from "@mui/icons-material/Close";
43
import type { UserWithCoursesAndSubjects } from "common/types";
54
import { motion, useAnimation } from "framer-motion";
65
import { useCallback, useEffect, useState } from "react";
7-
import { MdThumbUp } from "react-icons/md";
6+
import { MdClose, MdThumbUp } from "react-icons/md";
87
import request from "~/api/request";
98
import { useAboutMe, useRecommended } from "~/api/user";
109
import { Card } from "~/components/Card";
1110
import { DraggableCard } from "~/components/DraggableCard";
1211
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
1312
import NoMoreUser from "./components/NoMoreUser";
1413
import PersonDetailedMenu from "./components/PersonDetailedMenu";
14+
import RoundButton from "./components/RoundButton";
1515

1616
export default function Home() {
1717
const { data, error } = useRecommended();
@@ -133,14 +133,14 @@ export default function Home() {
133133
</motion.div>
134134
</div>
135135
)}
136-
<div className="button-container mt-4 mb-4 flex w-full justify-center space-x-8">
137-
<CloseButton
136+
<div className="mt-2 mb-4 flex w-full justify-around px-8">
137+
<RoundButton
138138
onclick={() => handleAction("reject")}
139-
icon={<CloseIconStyled />}
139+
icon={<MdClose className="text-3xl text-gray-500" />}
140140
/>
141-
<GoodButton
141+
<RoundButton
142142
onclick={() => handleAction("accept")}
143-
icon={<FavoriteIconStyled />}
143+
icon={<MdThumbUp className="text-3xl text-primary" />}
144144
/>
145145
</div>
146146
{openDetailedMenu && (
@@ -158,36 +158,6 @@ export default function Home() {
158158
);
159159
}
160160

161-
interface RoundButtonProps {
162-
onclick: () => void;
163-
icon: JSX.Element;
164-
}
165-
166-
const CloseButton = ({ onclick, icon }: RoundButtonProps) => (
167-
<button
168-
type="button"
169-
onClick={onclick}
170-
className="btn btn-circle bg-white shadow-md"
171-
>
172-
{icon}
173-
</button>
174-
);
175-
const GoodButton = ({ onclick, icon }: RoundButtonProps) => (
176-
<button
177-
type="button"
178-
onClick={onclick}
179-
className="btn btn-circle bg-white shadow-md"
180-
>
181-
{icon}
182-
</button>
183-
);
184-
185-
const CloseIconStyled = () => <CloseIcon className="text-4xl text-gray-500" />;
186-
187-
const FavoriteIconStyled = () => (
188-
<MdThumbUp className="text-3xl text-primary" />
189-
);
190-
191161
class Queue<T> {
192162
private store: T[];
193163
constructor(initial: T[]) {

web/app/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ export default function RootLayout({
3030
children: React.ReactNode;
3131
}) {
3232
return (
33-
<html lang="en">
33+
<html lang="en" className="h-full">
3434
<head>
3535
<meta charSet="UTF-8" />
3636
<link rel="icon" type="image/svg+xml" href="/course-mate-icon.svg" />
3737
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
3838
<title>CourseMate</title>
3939
</head>
40-
<body>
40+
<body className="h-full">
4141
<ThemeProvider theme={theme}>
4242
<CssBaseline />
4343
<SnackbarProvider
@@ -50,7 +50,7 @@ export default function RootLayout({
5050
<AlertProvider>
5151
<ModalProvider>
5252
<BanLandscape />
53-
<div className="flex h-screen flex-col">{children}</div>
53+
{children}
5454
</ModalProvider>
5555
</AlertProvider>
5656
</AuthProvider>

web/app/search/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 title="検索" />
1313
<NavigateByAuthState type="toLoginForUnauthenticated">
14-
<div className="grow overflow-y-auto">{children}</div>
14+
<div className="h-full overflow-y-auto pt-12 pb-12">{children}</div>
1515
</NavigateByAuthState>
1616
<BottomBar activeTab="2_search" />
1717
</>

web/app/search/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function SearchPage({
5454
);
5555

5656
return (
57-
<div className="flex min-h-screen justify-center ">
57+
<div className="flex justify-center">
5858
<div className="w-full">
5959
<h2 className="m-5 mb-4 font-bold text-2xl">ユーザー検索</h2>
6060
<Search placeholder="検索" setSearchString={setQuery} />

0 commit comments

Comments
 (0)