chore: update component name and fix unnecessary style import
This commit is contained in:
parent
868bdf09d4
commit
eb2efc365c
|
@ -1,4 +1,5 @@
|
||||||
@import '~bootstrap/scss/bootstrap-utilities';
|
@import 'bootstrap/scss/functions';
|
||||||
|
@import 'bootstrap/scss/variables';
|
||||||
#header {
|
#header {
|
||||||
background: linear-gradient(180deg, #0033FF 0%, rgba(0, 51, 255, 0.95) 100%);
|
background: linear-gradient(180deg, #0033FF 0%, rgba(0, 51, 255, 0.95) 100%);
|
||||||
--bs-navbar-padding-y: 0.75rem;
|
--bs-navbar-padding-y: 0.75rem;
|
||||||
|
|
|
@ -56,9 +56,9 @@ const Header: FC = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const collapse = document.querySelector('#navBarContent');
|
const collapse = document.querySelector('#navBarContent');
|
||||||
if (collapse && collapse.classList.contains('show')) {
|
if (collapse && collapse.classList.contains('show')) {
|
||||||
const toogle = document.querySelector('#navBarToggle') as HTMLElement;
|
const toggle = document.querySelector('#navBarToggle') as HTMLElement;
|
||||||
if (toogle) {
|
if (toggle) {
|
||||||
toogle?.click();
|
toggle?.click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [location.pathname]);
|
}, [location.pathname]);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
data;
|
data;
|
||||||
i18nkeyPrefix: string;
|
i18nKeyPrefix: string;
|
||||||
currentSort: string;
|
currentSort: string;
|
||||||
sortKey?: string;
|
sortKey?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@ -17,13 +17,13 @@ const Index: FC<Props> = ({
|
||||||
data = [],
|
data = [],
|
||||||
currentSort = '',
|
currentSort = '',
|
||||||
sortKey = 'order',
|
sortKey = 'order',
|
||||||
i18nkeyPrefix = '',
|
i18nKeyPrefix = '',
|
||||||
className = '',
|
className = '',
|
||||||
}) => {
|
}) => {
|
||||||
const [searchParams, setUrlSearchParams] = useSearchParams();
|
const [searchParams, setUrlSearchParams] = useSearchParams();
|
||||||
|
|
||||||
const { t } = useTranslation('translation', {
|
const { t } = useTranslation('translation', {
|
||||||
keyPrefix: i18nkeyPrefix,
|
keyPrefix: i18nKeyPrefix,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleParams = (order): string => {
|
const handleParams = (order): string => {
|
||||||
|
|
|
@ -115,7 +115,7 @@ const QuestionList: FC<Props> = ({ source }) => {
|
||||||
<QueryGroup
|
<QueryGroup
|
||||||
data={QuestionOrderKeys}
|
data={QuestionOrderKeys}
|
||||||
currentSort={curOrder}
|
currentSort={curOrder}
|
||||||
i18nkeyPrefix="question"
|
i18nKeyPrefix="question"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
|
@ -85,7 +85,7 @@ const Answers: FC = () => {
|
||||||
data={answerFilterItems}
|
data={answerFilterItems}
|
||||||
currentSort={curFilter}
|
currentSort={curFilter}
|
||||||
sortKey="status"
|
sortKey="status"
|
||||||
i18nkeyPrefix="admin.answers"
|
i18nKeyPrefix="admin.answers"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Form.Control
|
<Form.Control
|
||||||
|
|
|
@ -62,7 +62,7 @@ const Flags: FC = () => {
|
||||||
data={flagFilterKeys}
|
data={flagFilterKeys}
|
||||||
currentSort={curFilter}
|
currentSort={curFilter}
|
||||||
sortKey="status"
|
sortKey="status"
|
||||||
i18nkeyPrefix="admin.flags"
|
i18nKeyPrefix="admin.flags"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Form.Select
|
<Form.Select
|
||||||
|
|
|
@ -104,7 +104,7 @@ const Questions: FC = () => {
|
||||||
data={questionFilterItems}
|
data={questionFilterItems}
|
||||||
currentSort={curFilter}
|
currentSort={curFilter}
|
||||||
sortKey="status"
|
sortKey="status"
|
||||||
i18nkeyPrefix="admin.questions"
|
i18nKeyPrefix="admin.questions"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Form.Control
|
<Form.Control
|
||||||
|
|
|
@ -67,7 +67,7 @@ const Users: FC = () => {
|
||||||
data={UserFilterKeys}
|
data={UserFilterKeys}
|
||||||
currentSort={curFilter}
|
currentSort={curFilter}
|
||||||
sortKey="filter"
|
sortKey="filter"
|
||||||
i18nkeyPrefix="admin.users"
|
i18nKeyPrefix="admin.users"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Form.Control
|
<Form.Control
|
||||||
|
|
|
@ -34,7 +34,7 @@ const Index: FC<Props> = ({ count = 0, order = 'default' }) => {
|
||||||
<QueryGroup
|
<QueryGroup
|
||||||
data={sortBtns}
|
data={sortBtns}
|
||||||
currentSort={order === 'updated' ? 'newest' : 'score'}
|
currentSort={order === 'updated' ? 'newest' : 'score'}
|
||||||
i18nkeyPrefix="question_detail.answers"
|
i18nKeyPrefix="question_detail.answers"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { PageTitle, FollowingTags } from '@answer/components';
|
import { PageTitle, FollowingTags } from '@answer/components';
|
||||||
|
|
||||||
import QuestionList from '@/components/Questions';
|
import QuestionList from '@/components/QuestionList';
|
||||||
import HotQuestions from '@/components/HotQuestions';
|
import HotQuestions from '@/components/HotQuestions';
|
||||||
import { siteInfoStore } from '@/stores';
|
import { siteInfoStore } from '@/stores';
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ const Index: FC<Props> = ({ sort, count = 0 }) => {
|
||||||
data={sortBtns}
|
data={sortBtns}
|
||||||
currentSort={sort}
|
currentSort={sort}
|
||||||
sortKey="order"
|
sortKey="order"
|
||||||
i18nkeyPrefix="search.sort_btns"
|
i18nKeyPrefix="search.sort_btns"
|
||||||
/>
|
/>
|
||||||
</ListGroupItem>
|
</ListGroupItem>
|
||||||
);
|
);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import * as Type from '@answer/common/interface';
|
||||||
import { PageTitle, FollowingTags } from '@answer/components';
|
import { PageTitle, FollowingTags } from '@answer/components';
|
||||||
import { useTagInfo, useFollow } from '@answer/api';
|
import { useTagInfo, useFollow } from '@answer/api';
|
||||||
|
|
||||||
import QuestionList from '@/components/Questions';
|
import QuestionList from '@/components/QuestionList';
|
||||||
import HotQuestions from '@/components/HotQuestions';
|
import HotQuestions from '@/components/HotQuestions';
|
||||||
|
|
||||||
const Questions: FC = () => {
|
const Questions: FC = () => {
|
||||||
|
|
|
@ -60,7 +60,7 @@ const Tags = () => {
|
||||||
data={sortBtns}
|
data={sortBtns}
|
||||||
currentSort={sort || 'popular'}
|
currentSort={sort || 'popular'}
|
||||||
sortKey="sort"
|
sortKey="sort"
|
||||||
i18nkeyPrefix="tags.sort_buttons"
|
i18nKeyPrefix="tags.sort_buttons"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
@ -32,7 +32,7 @@ const Index: FC<Props> = ({
|
||||||
<QueryGroup
|
<QueryGroup
|
||||||
data={sortBtns}
|
data={sortBtns}
|
||||||
currentSort={sort}
|
currentSort={sort}
|
||||||
i18nkeyPrefix="personal"
|
i18nKeyPrefix="personal"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue