Skip to content

Commit

Permalink
🎨 とりあえず tsc を解消
Browse files Browse the repository at this point in the history
  • Loading branch information
wappon28dev committed Jun 22, 2024
1 parent 7e5fb65 commit 6fc0093
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/achievements/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Avatar, Flex, Table, Text } from "@radix-ui/themes";
import { type ReactElement } from "react";
import styled from "styled-components";
import { useNavigate } from "@/router";
import { type Achievement } from "@/types/achievement";
import { type Achievement } from "@/types/post-data/achievements";

export function AchievementCard({
achievement,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/achievements/[id]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { type ReactElement } from "react";
import { useMatch } from "react-router-dom";
import { useParams } from "@/router";

export default function Page(): ReactElement {
// const { params } = useMatch('/posts/$id')
const { id } = useParams("/achievements/:id");
const match = useMatch("/achievements/:id");

return (
<>
Expand Down
16 changes: 10 additions & 6 deletions src/pages/achievements/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { type ReactElement } from "react";
import styled from "styled-components";
import Achievements from "@/assets/achievements.json";
import { AchievementCard } from "@/components/achievements/Card";
import { type Achievement } from "@/types/post-data/achievements";

const BoxStyle = styled(Box)`
margin: 0 auto;
Expand All @@ -22,12 +23,15 @@ export default function Page(): ReactElement {
</Table.Header>

<Table.Body>
{Achievements.achievements.map((achievement) => (
<AchievementCard
key={achievement.id}
achievement={achievement}
/>
))}
{Achievements.achievements.map((achievement) => {
const typedAchievement = achievement as unknown as Achievement;
return (
<AchievementCard
key={achievement.id}
achievement={typedAchievement}
/>
);
})}
</Table.Body>
</Table.Root>
</BoxStyle>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/members/[id]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { type ReactElement } from "react";
import { useMatch } from "react-router-dom";
import { useParams } from "@/router";

export default function Page(): ReactElement {
// const { params } = useMatch('/posts/$id')
const { id } = useParams("/achievements/:id");
const match = useMatch("/achievements/:id");

return (
<>
Expand Down

0 comments on commit 6fc0093

Please sign in to comment.