2022-03-24 00:02:35 +11:00
|
|
|
import React from 'react';
|
2022-03-26 14:10:10 +11:00
|
|
|
import { PageTitle } from './PageTitle';
|
|
|
|
import { Page } from './Page';
|
2022-03-26 00:08:00 +11:00
|
|
|
import { QuestionList } from './QuestionList';
|
|
|
|
import { getUnansweredQuestions } from './QuestionsData';
|
2022-03-24 00:02:35 +11:00
|
|
|
|
|
|
|
export const HomePage = () => (
|
2022-03-26 14:10:10 +11:00
|
|
|
<Page>
|
2022-03-24 00:02:35 +11:00
|
|
|
<div>
|
2022-03-26 14:10:10 +11:00
|
|
|
<PageTitle>Unanswered Questions</PageTitle>
|
2022-03-26 14:12:16 +11:00
|
|
|
<button>Ask a question</button>{' '}
|
|
|
|
{/* This button component is passed as children of Page */}
|
2022-03-24 00:02:35 +11:00
|
|
|
</div>
|
2022-03-26 14:24:47 +11:00
|
|
|
<QuestionList
|
|
|
|
data={getUnansweredQuestions()}
|
|
|
|
renderItem={(question) => <div>{question.title}</div>}
|
|
|
|
/>
|
2022-03-26 14:10:10 +11:00
|
|
|
</Page>
|
2022-03-24 00:02:35 +11:00
|
|
|
);
|