-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# PRの概要 - Setting 画面の上部のナビゲーションを共通化した。 - 「あなたのカード」画面の構成を修正した。 <!-- 変更の目的 もしくは 関連する Issue 番号 --> <!-- 以下のように書くと Issue にリンクでき、マージ時に自動で Issue を閉じられる--> <!-- closes #1 --> - close #436 ## 具体的な変更内容 <img width="424" alt="image" src="https://github.com/user-attachments/assets/ce95b25d-3f0b-4b22-97f9-07c9baac630c"> ## 影響範囲 Setting 画面。 ## 動作要件 <!-- 動作に必要な 環境変数 / 依存関係 / DBの更新 など --> ## 補足 <!-- レビューをする際に見てほしい点、ローカル環境で試す際の注意点、など --> ## レビューリクエストを出す前にチェック! - [x] 改めてセルフレビューしたか - [x] 手動での動作検証を行ったか - [x] server の機能追加ならば、テストを書いたか - 理由: 書いた | server の機能追加ではない - [x] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか - 理由: 書いた | 間違った使い方は存在しない - [x] わかりやすいPRになっているか <!-- レビューリクエスト後は、Slackでもメンションしてお願いすることを推奨します。 -->
- Loading branch information
Showing
5 changed files
with
81 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ArrowBack } from "@mui/icons-material"; | ||
import { Box, IconButton, Typography } from "@mui/material"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
/** | ||
* Settings の子ページから Setting に戻るナビゲーションを提供 | ||
*/ | ||
export default function TopNavigation({ title }: { title: string }) { | ||
const navigate = useNavigate(); | ||
return ( | ||
<Box | ||
py={1} | ||
sx={{ | ||
display: "flex", | ||
alignItems: "center", | ||
// 主に profile ページ向け。calc(画面縦幅 - カード縦幅 - ヘッダー幅 - ボトムナビ幅 - ページの py - 編集ボタンの高さ)。 | ||
height: "min(56px, calc(100dvh - 70dvh - 56px - 56px - 16px - 36px))", | ||
}} | ||
> | ||
<IconButton | ||
onClick={() => { | ||
navigate("/settings"); | ||
}} | ||
> | ||
<ArrowBack /> | ||
</IconButton> | ||
<Typography | ||
variant="h5" | ||
component="h1" | ||
sx={{ | ||
fontWeight: "bold", | ||
// タイトルを中央に寄せる。矢印が左にしかないため。 | ||
position: "absolute", | ||
left: "50%", | ||
transform: "translateX(-50%)", | ||
overflow: "hidden", | ||
whiteSpace: "nowrap", | ||
textOverflow: "ellipsis", | ||
}} | ||
> | ||
{title} | ||
</Typography> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters