Skip to content

Commit

Permalink
Change "filter" to "custom-search"
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxi-std committed Jan 27, 2025
1 parent babe77e commit bd83116
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Icon, Popup } from 'semantic-ui-react';
import { Link } from 'react-router-dom';
import styles from './FilterIcon.module.less';
import styles from './CustomSearchIcon.module.less';

const FilterIcon = () => {
const CustomSearchIcon = () => {
return (
<Popup
content="自定义搜索"
trigger={
<Link to="/filter" className={styles.link}>
<Link to="/custom-search" className={styles.link}>
<Icon name="code" link style={{ cursor: 'pointer' }} />
</Link>
}
Expand All @@ -16,4 +16,4 @@ const FilterIcon = () => {
);
};

export default FilterIcon;
export default CustomSearchIcon;
4 changes: 2 additions & 2 deletions src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
provincesWithId,
} from '@/libs/OIerDb';
import styles from './Search.module.less';
import FilterIcon from './FilterIcon';
import CustomSearchIcon from './CustomSearchIcon';

const Search: React.FC = () => {
// Gender display
Expand Down Expand Up @@ -140,7 +140,7 @@ const Search: React.FC = () => {
alignItems: 'center',
}}
>
<FilterIcon />
<CustomSearchIcon />
<Checkbox
slider
label="高级搜索"
Expand Down
4 changes: 2 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const SchoolList = lazy(() => import('@/pages/school/index'));
const SchoolInfo = lazy(() => import('@/pages/school/[id]'));
const Contest = lazy(() => import('@/pages/contest'));
const ContestInfo = lazy(() => import('@/pages/contest/[id]'));
const Filter = lazy(() => import('@/pages/filter'));
const CustomSearch = lazy(() => import('@/pages/custom-search'));
const NotFound = lazy(() => import('@/pages/404'));
const About = lazy(() => import('@/pages/about'));

Expand Down Expand Up @@ -94,7 +94,7 @@ const App: React.FC = () => {
<Route path="/contest" element={<Navigate replace to="/contests" />} />
<Route path="/contests" element={<Contest />} />
<Route path="/contest/:id" element={<ContestInfo />} />
<Route path="/filter" element={<Filter />} />
<Route path="/custom-search" element={<CustomSearch />} />
<Route path="/about" element={<About />} />
<Route path="*" element={<NotFound />} />
</Routes>
Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 5 additions & 6 deletions src/pages/filter/index.tsx → src/pages/custom-search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import fixChineseSpace from '@/utils/fixChineseSpace';
import jsExtraLib from './OIerDb.js?raw';
import JSEditor from '@/components/JSEditor';

const FilterWithIDE: React.FC = () => {
const CustomSearch: React.FC = () => {
const [searchParams] = usePartialSearchParams();

const page = Number(searchParams.get('page') || 1);
Expand Down Expand Up @@ -94,7 +94,7 @@ module.exports = filter;
className={styles.header}
block
as="h4"
content="筛选器"
content="自定义搜索"
attached="top"
icon="code"
/>
Expand All @@ -108,10 +108,9 @@ module.exports = filter;

<Button
onClick={() => setActiveFilter(filterCode)}
color="blue"
style={{ marginTop: '10px' }}
style={{ marginTop: '10px', width: '100%' }}
>
筛选
运行
</Button>

{filterError && (
Expand Down Expand Up @@ -230,4 +229,4 @@ module.exports = filter;
);
};

export default FilterWithIDE;
export default CustomSearch;

0 comments on commit bd83116

Please sign in to comment.