Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const Home: NextPage = () => {
ガチで東京の人しか解けない! #東京の難読地名クイズ
</Typography>
</Box>
{quizData.map((quiz) => {
return <Quiz quiz={quiz} key={quiz.id}></Quiz>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quiz は子コンポーネントを受け取るわけではないので、
<Quiz quiz={quiz} key={quiz.id} />
こうやって書きます

})}
</Container>
</>
)
Expand Down
4 changes: 3 additions & 1 deletion src/components/ChoiceList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const ChoiceList: FC<ChoiceListProps> = ({
}) => {
return (
<>

<Box>
<Button variant="outlined">{choices}</Button>
Copy link
Copy Markdown

@yutomoriyasu yutomoriyasu Apr 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

配列はそのまま中括弧で表示できないです

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この
choices
って、配列では無い気がする??

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

配列か
なんかコードが色々変だね

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daiki-sato がんばれ

</Box>
</>
)
}
Expand Down
12 changes: 9 additions & 3 deletions src/components/Quiz/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ type QuizProps = {
}

const Quiz: FC<QuizProps> = ({ quiz }) => {


return (
<>

<Box>
<Typography variant="subtitle1" component="h2">
{quiz.id}. この地名はなんて読む?
<img src={`/img/kuizy0${quiz.id}.png`} alt="" />
{quiz.choices.map((choices) => {
return <ChoiceList choices={choices} key={choices.id}></ChoiceList>
})}
</Typography>
</Box>
</>
)
}
Expand Down