Skip to content

Commit 2fda895

Browse files
committed
feat(css): Add specific classes for customization purposes
1 parent 7a6acc5 commit 2fda895

File tree

15 files changed

+28
-20
lines changed

15 files changed

+28
-20
lines changed

ui/src/components/Comment/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ const Comment = ({ objectId, mode, commentId }) => {
309309
);
310310
};
311311
return (
312-
<div className="comments-wrap">
312+
<div className="answer_comments comments-wrap">
313313
{comments.map((item, index) => {
314314
return (
315315
<div

ui/src/components/FollowingTags/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Index: FC = () => {
3535
return null;
3636
}
3737
return isEdit ? (
38-
<Card className="mb-4">
38+
<Card className="answer_following-tags mb-4">
3939
<Card.Header className="text-nowrap d-flex justify-content-between">
4040
{t('following_tags')}
4141
<Button
@@ -56,7 +56,7 @@ const Index: FC = () => {
5656
</Card.Body>
5757
</Card>
5858
) : (
59-
<Card className="mb-4">
59+
<Card className="answer_following-tags mb-4">
6060
<Card.Header className="text-nowrap d-flex justify-content-between text-capitalize">
6161
{t('following_tags')}
6262
<Button

ui/src/components/Footer/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Index = () => {
1111
const siteName = siteInfoStore((state) => state.siteInfo.name);
1212
const cc = `${fullYear} ${siteName}`;
1313
return (
14-
<footer className="bg-light">
14+
<footer className="answer_footer bg-light">
1515
<Container className="py-3">
1616
<p className="text-center mb-0 small text-secondary">
1717
<Trans i18nKey="footer.build_on" values={{ cc }}>

ui/src/components/Header/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const Header: FC = () => {
112112
<Navbar
113113
variant={navbarStyle === 'theme-colored' ? 'dark' : ''}
114114
expand="lg"
115-
className={classnames('sticky-top', navbarStyle)}
115+
className={classnames('answer_header', 'sticky-top', navbarStyle)}
116116
id="header">
117117
<Container className="d-flex align-items-center">
118118
<Navbar.Toggle

ui/src/components/HotQuestions/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const HotQuestions: FC = () => {
1414
return null;
1515
}
1616
return (
17-
<Card>
17+
<Card className="answer_hot-questions">
1818
<Card.Header className="text-nowrap text-capitalize">
1919
{t('hot_questions')}
2020
</Card.Header>

ui/src/components/PluginRender/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const Index: FC<Props> = ({ slug_name, type, children, ...props }) => {
6060
const PluginFC = ps.component;
6161
return (
6262
// @ts-ignore
63-
<PluginFC key={ps.info.slug_name} {...props}>
63+
<PluginFC className="answer_plugin" key={ps.info.slug_name} {...props}>
6464
{children}
6565
</PluginFC>
6666
);

ui/src/components/QuestionList/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const QuestionList: FC<Props> = ({
4747
const count = data?.count || 0;
4848
return (
4949
<div>
50-
<div className="mb-3 d-flex flex-wrap justify-content-between">
50+
<div className="answer_questions-head mb-3 d-flex flex-wrap justify-content-between">
5151
<h5 className="fs-5 text-nowrap mb-3 mb-md-0">
5252
{source === 'questions'
5353
? t('all_questions')
@@ -60,7 +60,7 @@ const QuestionList: FC<Props> = ({
6060
i18nKeyPrefix="question"
6161
/>
6262
</div>
63-
<ListGroup className="rounded-0">
63+
<ListGroup className="answer_questions-list rounded-0">
6464
{isLoading ? (
6565
<QuestionListLoader />
6666
) : (

ui/src/pages/Questions/Detail/components/Answer/index.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Button, Alert, Badge } from 'react-bootstrap';
33
import { useTranslation } from 'react-i18next';
44
import { Link, useSearchParams } from 'react-router-dom';
55

6+
import classNames from 'classnames';
7+
68
import {
79
Actions,
810
Operate,
@@ -73,7 +75,13 @@ const Index: FC<Props> = ({
7375
}
7476

7577
return (
76-
<div id={data.id} ref={answerRef} className="answer-item py-4">
78+
<div
79+
id={data.id}
80+
ref={answerRef}
81+
className={classNames(
82+
'answer_answer answer-item py-4',
83+
data?.accepted === 2 && 'answer_answer-accepted',
84+
)}>
7785
{data.status === 10 && (
7886
<Alert variant="danger" className="mb-4">
7987
{t('post_deleted', { keyPrefix: 'messages' })}

ui/src/pages/Questions/Detail/components/InviteToAnswer/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const Index: FC<Props> = ({ questionId, readOnly = false }) => {
9595
}
9696

9797
return (
98-
<Card className="mt-4">
98+
<Card className="answer_people-asked mt-4">
9999
<Card.Header className="text-nowrap d-flex justify-content-between text-capitalize">
100100
{t('title')}
101101
{showSaveButton ? (

ui/src/pages/Questions/Detail/components/Question/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ const Index: FC<Props> = ({ data, initPage, hasAnswer, isLogged }) => {
6565
}
6666

6767
return (
68-
<div>
69-
<h1 className="h3 mb-3 text-wrap text-break">
68+
<div className="answer_question-asked">
69+
<h1 className="answer_question-title h3 mb-3 text-wrap text-break">
7070
{data?.pin === 2 && (
7171
<Icon
7272
name="pin-fill"

ui/src/pages/Questions/Detail/components/RelatedQuestions/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Index: FC<Props> = ({ id }) => {
2525
}
2626

2727
return (
28-
<Card>
28+
<Card className="answer_related-questions">
2929
<Card.Header>{t('title')}</Card.Header>
3030
<ListGroup variant="flush">
3131
{data?.list?.map((item) => {

ui/src/pages/Questions/Detail/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const Index = () => {
211211
}
212212

213213
return (
214-
<Row className="questionDetailPage pt-4 mb-5">
214+
<Row className="answer_question-detail-page questionDetailPage pt-4 mb-5">
215215
<Col className="page-main flex-auto">
216216
{question?.operation?.level && <Alert data={question.operation} />}
217217
{isLoading ? (

ui/src/pages/Search/components/SearchItem/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ const Index: FC<Props> = ({ data }) => {
2828
}
2929

3030
return (
31-
<ListGroupItem className="py-3 px-0 border-start-0 border-end-0 bg-transparent">
32-
<div className="mb-2 clearfix">
31+
<ListGroupItem className="answer_search-result py-3 px-0 border-start-0 border-end-0 bg-transparent">
32+
<div className="answer_search-result-title mb-2 clearfix">
3333
<span
3434
className="float-start me-2 badge text-bg-dark"
3535
style={{ marginTop: '2px' }}>
@@ -65,7 +65,7 @@ const Index: FC<Props> = ({ data }) => {
6565
</div>
6666

6767
{data.object?.excerpt && (
68-
<p className="small text-truncate-2 mb-2 last-p text-break">
68+
<p className="answer_search-result-preview small text-truncate-2 mb-2 last-p text-break">
6969
{escapeRemove(data.object.excerpt)}
7070
</p>
7171
)}

ui/src/pages/Search/components/Tips/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useTranslation, Trans } from 'react-i18next';
55
const Index: FC = () => {
66
const { t } = useTranslation();
77
return (
8-
<Card>
8+
<Card className="answer_search-tips">
99
<Card.Header>{t('search.tips.title')}</Card.Header>
1010
<Card.Body className="small ext-secondary">
1111
<div className="mb-1">

ui/src/pages/Search/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const Index = () => {
7979

8080
return (
8181
<Row className="pt-4 mb-5">
82-
<Col className="page-main flex-auto">
82+
<Col className="answer_search-result-list page-main flex-auto">
8383
<Head data={extra} />
8484
<SearchHead sort={order} count={count} />
8585
<ListGroup className="rounded-0 mb-5">

0 commit comments

Comments
 (0)