A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
refactor: improve responsive layout
robin99b537a1d101
diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsxindex 40826251..b6b3966c 100644--- a/ui/src/pages/Questions/Ask/index.tsx+++ b/ui/src/pages/Questions/Ask/index.tsx@@ -269,12 +269,12 @@ const Ask = () => {<PageTitle title={pageTitle} /><Container className="pt-4 mt-2 mb-5"><Row className="justify-content-center">- <Col sm={12} md={10}>+ <Col xxl={10} md={12}><h3 className="mb-4">{isEdit ? t('edit_title') : t('title')}</h3></Col></Row><Row className="justify-content-center">- <Col sm={12} md={7} className="mb-4 mb-md-0">+ <Col xxl={7} lg={8} sm={12} className="mb-4 mb-md-0"><Form noValidate onSubmit={handleSubmit}>{isEdit && (<Form.Group controlId="revision" className="mb-3">@@ -421,7 +421,7 @@ const Ask = () => {)}</Form></Col>- <Col sm={12} md={3}>+ <Col xxl={3} lg={4} sm={12}>{focusType === 'title' && (<Card className="mb-4"><Card.Header>{t('how_to_ask.title')}</Card.Header>diff --git a/ui/src/pages/Questions/Detail/index.scss b/ui/src/pages/Questions/Detail/index.scssindex 0955caec..b6f1e87a 100644--- a/ui/src/pages/Questions/Detail/index.scss+++ b/ui/src/pages/Questions/Detail/index.scss@@ -1,5 +1,10 @@-.fmt img {- max-width: 100%;+.fmt {+ img {+ max-width: 100%;+ }+ p {+ word-break: break-all;+ }}.answer-item {diff --git a/ui/src/pages/Questions/Detail/index.tsx b/ui/src/pages/Questions/Detail/index.tsxindex 76be9367..cc3dd470 100644--- a/ui/src/pages/Questions/Detail/index.tsx+++ b/ui/src/pages/Questions/Detail/index.tsx@@ -109,7 +109,7 @@ const Index = () => {<PageTitle title={question?.title} /><Container className="pt-4 mt-2 mb-5"><Row className="justify-content-center">- <Col lg={7}>+ <Col xxl={7} lg={8} sm={12}>{question?.operation?.operation_type && (<Alert data={question.operation} />)}@@ -156,7 +156,7 @@ const Index = () => {/>)}</Col>- <Col lg={3}>+ <Col xxl={3} lg={4} sm={12}><RelatedQuestions id={question?.id || ''} /></Col></Row>diff --git a/ui/src/pages/Questions/EditAnswer/index.tsx b/ui/src/pages/Questions/EditAnswer/index.tsxindex 3f72bb52..16aac7c8 100644--- a/ui/src/pages/Questions/EditAnswer/index.tsx+++ b/ui/src/pages/Questions/EditAnswer/index.tsx@@ -123,12 +123,12 @@ const Ask = () => {<PageTitle title={t('edit_answer', { keyPrefix: 'page_title' })} /><Container className="pt-4 mt-2 mb-5 edit-answer-wrap"><Row className="justify-content-center">- <Col sm={12} md={10}>+ <Col xxl={10} md={12}><h3 className="mb-4">{t('title')}</h3></Col></Row><Row className="justify-content-center">- <Col sm={12} md={7} className="mb-4 mb-md-0">+ <Col xxl={7} lg={8} sm={12} className="mb-4 mb-md-0"><a href={`/questions/${qid}`} target="_blank" rel="noreferrer"><h5 className="mb-3">{data?.question.title}</h5></a>@@ -216,7 +216,7 @@ const Ask = () => {</div></Form></Col>- <Col sm={12} md={3}>+ <Col xxl={3} lg={4} sm={12}><Card className="mb-4"><Card.Header>{t('how_to_ask.title')}</Card.Header><Card.Body>diff --git a/ui/src/pages/Questions/index.tsx b/ui/src/pages/Questions/index.tsxindex 9006b50d..c3ffd271 100644--- a/ui/src/pages/Questions/index.tsx+++ b/ui/src/pages/Questions/index.tsx@@ -26,10 +26,10 @@ const Questions: FC = () => {<PageTitle title={pageTitle} suffix={slogan} /><Container className="pt-4 mt-2 mb-5"><Row className="justify-content-center">- <Col lg={7}>+ <Col xxl={7} lg={8} sm={12}><QuestionList source="questions" /></Col>- <Col lg={3}>+ <Col xxl={3} lg={4} sm={12}><FollowingTags /><HotQuestions /></Col>diff --git a/ui/src/pages/Search/index.tsx b/ui/src/pages/Search/index.tsxindex a88e3b85..7f8c43ed 100644--- a/ui/src/pages/Search/index.tsx+++ b/ui/src/pages/Search/index.tsx@@ -32,7 +32,7 @@ const Index = () => {<PageTitle title={pageTitle} /><Container className="pt-4 mt-2 mb-5"><Row className="justify-content-center">- <Col lg={7} className="mb-3">+ <Col xxl={7} lg={8} sm={12} className="mb-3"><Head data={extra} /><ListGroup variant="flush" className="mb-5">@@ -53,7 +53,7 @@ const Index = () => {/></div></Col>- <Col lg={3}>+ <Col xxl={3} lg={4} sm={12}><Tips /></Col></Row>diff --git a/ui/src/pages/Tags/Detail/index.tsx b/ui/src/pages/Tags/Detail/index.tsxindex 2d87712b..f92a256a 100644--- a/ui/src/pages/Tags/Detail/index.tsx+++ b/ui/src/pages/Tags/Detail/index.tsx@@ -58,7 +58,7 @@ const Questions: FC = () => {<PageTitle title={pageTitle} /><Container className="pt-4 mt-2 mb-5"><Row className="justify-content-center">- <Col lg={7}>+ <Col xxl={7} lg={8} sm={12}><div className="tag-box mb-5"><h3 className="mb-3"><Link@@ -90,7 +90,7 @@ const Questions: FC = () => {</div><QuestionList source="tag" /></Col>- <Col lg={3}>+ <Col xxl={3} lg={4} sm={12}><FollowingTags /><HotQuestions /></Col>diff --git a/ui/src/pages/Tags/Edit/index.tsx b/ui/src/pages/Tags/Edit/index.tsxindex 110f2304..ae0064ae 100644--- a/ui/src/pages/Tags/Edit/index.tsx+++ b/ui/src/pages/Tags/Edit/index.tsx@@ -147,12 +147,12 @@ const Ask = () => {<PageTitle title={t('edit_tag', { keyPrefix: 'page_title' })} /><Container className="pt-4 mt-2 mb-5 edit-answer-wrap"><Row className="justify-content-center">- <Col sm={12} md={10}>+ <Col xxl={10} md={12}><h3 className="mb-4">{t('title')}</h3></Col></Row><Row className="justify-content-center">- <Col sm={12} md={7} className="mb-4 mb-md-0">+ <Col xxl={7} lg={8} sm={12} className="mb-4 mb-md-0"><Form noValidate onSubmit={handleSubmit}><Form.Group controlId="revision" className="mb-3"><Form.Label>{t('form.fields.revision.label')}</Form.Label>@@ -248,7 +248,7 @@ const Ask = () => {</div></Form></Col>- <Col sm={12} md={3}>+ <Col xxl={3} lg={4} sm={12}><Card className="mb-4"><Card.Header>{t('how_to_format.title')}</Card.Header><Card.Body>diff --git a/ui/src/pages/Tags/index.tsx b/ui/src/pages/Tags/index.tsxindex 26c7d0f9..acd5a019 100644--- a/ui/src/pages/Tags/index.tsx+++ b/ui/src/pages/Tags/index.tsx@@ -53,9 +53,9 @@ const Tags = () => {<PageTitle title={t('tags', { keyPrefix: 'page_title' })} /><Container className="py-3 my-3"><Row className="mb-4 d-flex justify-content-center">- <Col lg={10}>+ <Col xxl={10} sm={12}><h3 className="mb-4">{t('title')}</h3>- <div className="d-flex justify-content-between align-items-center">+ <div className="d-flex justify-content-between align-items-center flex-wrap"><Form><Form.Group controlId="formBasicEmail"><Form.Control@@ -94,10 +94,16 @@ const Tags = () => {</div></Col>- <Col className="mt-4" lg={10}>+ <Col className="mt-4" xxl={10} sm={12}><Row>{tags?.list?.map((tag) => (- <Col key={tag.slug_name} lg={3} md={4} className="mb-4">+ <Col+ key={tag.slug_name}+ xs={12}+ lg={3}+ md={4}+ sm={6}+ className="mb-4"><Card className="h-100"><Card.Body className="d-flex flex-column align-items-start"><Tag className="mb-3" href={`/tags/${tag.slug_name}`}>diff --git a/ui/src/pages/Users/Notifications/index.tsx b/ui/src/pages/Users/Notifications/index.tsxindex b1ab1485..ff93bc0c 100644--- a/ui/src/pages/Users/Notifications/index.tsx+++ b/ui/src/pages/Users/Notifications/index.tsx@@ -69,7 +69,7 @@ const Notifications = () => {<PageTitle title={t('notifications', { keyPrefix: 'page_title' })} /><Container className="pt-4 mt-2 mb-5"><Row className="justify-content-center">- <Col xs={12} lg={7}>+ <Col xxl={7} lg={8} sm={12}><h3 className="mb-4">{t('title')}</h3><div className="d-flex justify-content-between mb-3"><ButtonGroup size="sm">@@ -120,7 +120,7 @@ const Notifications = () => {</div>)}</Col>- <Col xs={12} lg={3} />+ <Col xxl={3} lg={4} sm={12} /></Row></Container></>diff --git a/ui/src/pages/Users/Personal/index.tsx b/ui/src/pages/Users/Personal/index.tsxindex 4a23c290..c2b6352a 100644--- a/ui/src/pages/Users/Personal/index.tsx+++ b/ui/src/pages/Users/Personal/index.tsx@@ -57,10 +57,10 @@ const Personal: FC = () => {{userInfo?.info?.status !== 'normal' && userInfo?.info?.status_msg && (<Alert data={userInfo?.info.status_msg} />)}- <Col lg={7}>+ <Col xxl={7} lg={8} sm={12}><UserInfo data={userInfo?.info} /></Col>- <Col lg={3} className="d-flex justify-content-end">+ <Col xxl={3} lg={4} sm={12} className="d-flex justify-content-end">{isSelf && (<div><Button@@ -78,7 +78,7 @@ const Personal: FC = () => {<Col lg={10}><NavBar tabName={tabName} slug={username} isSelf={isSelf} /></Col>- <Col lg={7}>+ <Col xxl={7} lg={8} sm={12}><Overviewvisible={tabName === 'overview'}introduction={userInfo?.info?.bio_html}@@ -111,7 +111,7 @@ const Personal: FC = () => {</div>)}</Col>- <Col lg={3}>+ <Col xxl={3} lg={4} sm={12}><h5 className="mb-3">Stats</h5>{userInfo?.info && (<>