Chap05 -> Using route parameters -> Implementiing more of the question page -> Implement JSX for Question Page component by adding container element for the page and question title

master
Jason Zhu 2022-03-30 14:34:23 +11:00
parent a2f0fb0522
commit b5f12380b3
1 changed files with 24 additions and 1 deletions

View File

@ -20,5 +20,28 @@ export const QuestionPage = () => {
doGetQuestion(Number(questionId)); doGetQuestion(Number(questionId));
} }
}, [questionId]); }, [questionId]);
return <Page>Question Page {questionId}</Page>; return (
<Page>
<div
css={css`
background-color: white;
padding: 15px 20px 20px 20px;
border-radius: 4px;
border: 1px solid ${gray6};
box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.16);
`}
>
<div
css={css`
font-size: 19px;
font-weight: bold;
margin: 10px 0px 5px;
`}
>
{question === null ? '' : question.title}
</div>
</div>
Question Page {questionId}
</Page>
);
}; };