Skip to content

Commit

Permalink
表記やデザインを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
MurakawaTakuya committed Jan 12, 2025
1 parent 77cb05f commit 5825d1d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
29 changes: 24 additions & 5 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ app.use("/notification", notificationRouter);

const region = "asia-northeast1";

export const helloWorld = onRequest({ region: region }, (req, res) => {
logger.info("Hello log!", { structuredData: true });
res.send("Hello World!");
});

export const firestore = onRequest({ region: region }, async (req, res) => {
app(req, res);
});
Expand All @@ -117,3 +112,27 @@ export {
deleteTasksOnGoalDelete,
deleteTasksOnPostCreate,
} from "./tasks";

// テスト用API
app.use(
"/helloWorld",
rateLimit({
// 10分に最大10回に制限
windowMs: 10 * 60 * 1000,
max: 10,
keyGenerator: (req) => {
const key = req.headers["x-forwarded-for"] || req.ip || "unknown";
return Array.isArray(key) ? key[0] : key;
},
handler: (req, res) => {
return res
.status(429)
.json({ message: "Too many requests, please try again later." });
},
})
);

export const helloWorld = onRequest({ region: region }, (req, res) => {
logger.info("Hello log!", { structuredData: true });
res.send("Hello World!");
});
13 changes: 13 additions & 0 deletions src/Components/NavigationMenu/NavigationMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { useUser } from "@/utils/UserContext";
import FormatListBulletedIcon from "@mui/icons-material/FormatListBulleted";
import GroupIcon from "@mui/icons-material/Group";
import HomeIcon from "@mui/icons-material/Home";
Expand Down Expand Up @@ -39,6 +40,8 @@ export default function NavigationMenu() {

const colors = ["success", "primary", "warning", "danger"] as const;

const { user } = useUser();

return (
<Box
sx={{
Expand Down Expand Up @@ -89,10 +92,15 @@ export default function NavigationMenu() {
orientation="vertical"
sx={{
padding: "5px 0 !important",
transition: "0.5s",
...(index === 0 && {
backgroundColor: "#e1ffe0 !important",
color: "#008954 !important",
}),
...(!user && {
pointerEvents: "none",
opacity: "0.3 !important",
}),
}}
>
<ListItemDecorator>
Expand All @@ -105,10 +113,15 @@ export default function NavigationMenu() {
orientation="vertical"
sx={{
padding: "5px 0 !important",
transition: "0.5s",
...(index === 1 && {
backgroundColor: "#ffecee !important",
color: "#bf1818 !important",
}),
...(!user && {
pointerEvents: "none",
opacity: "0.3 !important",
}),
}}
>
<ListItemDecorator>
Expand Down
1 change: 1 addition & 0 deletions src/Components/Progress/PendingStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const PendingStep = ({
<AppRegistrationRoundedIcon />
</StepIndicator>
}
sx={{ gap: "10px 16px" }}
>
<GoalCard
deadline={result.deadline}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Progress/StepperBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const StepperBlock = ({
[`& .${stepClasses.completed}`]: {
"&::after": { bgcolor: "success.solidBg" },
},
// copletedとactive両方の場合
// completedとactive両方の場合
[`& .${stepClasses.completed}.${stepClasses.active}`]: {
[`& .${stepIndicatorClasses.root}`]: {
border: "4px solid #fff",
Expand Down
9 changes: 7 additions & 2 deletions src/app/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ export default function Account() {
PWAを準備中です。しばらくしてからページを更新してください。
</Typography>
)}
{(user?.loginType === "Guest" || !user?.isMailVerified) && (
{user?.loginType === "Guest" && (
<Typography color="danger" textAlign="center">
通知を利用するには認証が必要です。
ゲストユーザーは通知機能を使用できません。
</Typography>
)}
{!user?.isMailVerified && (
<Typography color="danger" textAlign="center">
通知機能を利用するには認証メールを確認してください。
</Typography>
)}

Expand Down

0 comments on commit 5825d1d

Please sign in to comment.