|
|
@ -2,13 +2,13 @@ import Head from 'next/head';
|
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
import { useMemo, useState } from 'react';
|
|
|
|
import { useMemo, useState } from 'react';
|
|
|
|
import { useForm } from 'react-hook-form';
|
|
|
|
import { useForm } from 'react-hook-form';
|
|
|
|
import { ArrowSmallLeftIcon } from '@heroicons/react/24/outline';
|
|
|
|
|
|
|
|
import { Button, Collapsible, HorizontalDivider, TextArea } from '@tih/ui';
|
|
|
|
import { Button, Collapsible, HorizontalDivider, TextArea } from '@tih/ui';
|
|
|
|
|
|
|
|
|
|
|
|
import AnswerCommentListItem from '~/components/questions/AnswerCommentListItem';
|
|
|
|
import AnswerCommentListItem from '~/components/questions/AnswerCommentListItem';
|
|
|
|
import FullQuestionCard from '~/components/questions/card/question/FullQuestionCard';
|
|
|
|
import FullQuestionCard from '~/components/questions/card/question/FullQuestionCard';
|
|
|
|
import QuestionAnswerCard from '~/components/questions/card/QuestionAnswerCard';
|
|
|
|
import QuestionAnswerCard from '~/components/questions/card/QuestionAnswerCard';
|
|
|
|
import FullScreenSpinner from '~/components/questions/FullScreenSpinner';
|
|
|
|
import FullScreenSpinner from '~/components/questions/FullScreenSpinner';
|
|
|
|
|
|
|
|
import BackButtonLayout from '~/components/questions/layout/BackButtonLayout';
|
|
|
|
import PaginationLoadMoreButton from '~/components/questions/PaginationLoadMoreButton';
|
|
|
|
import PaginationLoadMoreButton from '~/components/questions/PaginationLoadMoreButton';
|
|
|
|
import SortOptionsSelect from '~/components/questions/SortOptionsSelect';
|
|
|
|
import SortOptionsSelect from '~/components/questions/SortOptionsSelect';
|
|
|
|
|
|
|
|
|
|
|
@ -182,18 +182,7 @@ export default function QuestionPage() {
|
|
|
|
{question.content} - {APP_TITLE}
|
|
|
|
{question.content} - {APP_TITLE}
|
|
|
|
</title>
|
|
|
|
</title>
|
|
|
|
</Head>
|
|
|
|
</Head>
|
|
|
|
<div className="flex w-full flex-1 items-stretch pb-4">
|
|
|
|
<BackButtonLayout href="/questions/browse">
|
|
|
|
<div className="flex items-baseline gap-2 py-4 pl-4">
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
|
|
addonPosition="start"
|
|
|
|
|
|
|
|
display="inline"
|
|
|
|
|
|
|
|
href="/questions/browse"
|
|
|
|
|
|
|
|
icon={ArrowSmallLeftIcon}
|
|
|
|
|
|
|
|
label="Back"
|
|
|
|
|
|
|
|
variant="secondary"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="flex w-full justify-center overflow-y-auto py-4 px-5">
|
|
|
|
|
|
|
|
<div className="flex max-w-7xl flex-1 flex-col gap-2">
|
|
|
|
<div className="flex max-w-7xl flex-1 flex-col gap-2">
|
|
|
|
<div className="flex flex-col gap-2 rounded-md border bg-white p-4">
|
|
|
|
<div className="flex flex-col gap-2 rounded-md border bg-white p-4">
|
|
|
|
<FullQuestionCard
|
|
|
|
<FullQuestionCard
|
|
|
@ -256,9 +245,7 @@ export default function QuestionPage() {
|
|
|
|
<PaginationLoadMoreButton query={commentInfiniteQuery} />
|
|
|
|
<PaginationLoadMoreButton query={commentInfiniteQuery} />
|
|
|
|
<form
|
|
|
|
<form
|
|
|
|
className="mt-4"
|
|
|
|
className="mt-4"
|
|
|
|
onSubmit={handleCommentSubmitClick(
|
|
|
|
onSubmit={handleCommentSubmitClick(handleSubmitComment)}>
|
|
|
|
handleSubmitComment,
|
|
|
|
|
|
|
|
)}>
|
|
|
|
|
|
|
|
<TextArea
|
|
|
|
<TextArea
|
|
|
|
{...commentRegister('commentContent', {
|
|
|
|
{...commentRegister('commentContent', {
|
|
|
|
minLength: 1,
|
|
|
|
minLength: 1,
|
|
|
@ -342,8 +329,7 @@ export default function QuestionPage() {
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<PaginationLoadMoreButton query={answerInfiniteQuery} />
|
|
|
|
<PaginationLoadMoreButton query={answerInfiniteQuery} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</BackButtonLayout>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|