balibabu
commited on
Commit
·
5403bcb
1
Parent(s):
ce45214
feat: Cover the entire search page with a background image #2247 (#2381)
Browse files### What problem does this PR solve?
feat: Cover the entire search page with a background image #2247
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
web/src/pages/search/index.less
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
.searchPage {
|
|
|
|
|
2 |
.card {
|
3 |
width: 100%;
|
4 |
:global(.ant-card-body) {
|
@@ -13,14 +15,18 @@
|
|
13 |
font-size: 14px;
|
14 |
cursor: pointer;
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
|
18 |
.searchSide {
|
19 |
-
// height: calc(100vh - 72px);
|
20 |
position: relative;
|
21 |
-
// position: fixed !important;
|
22 |
-
// top: 72px;
|
23 |
-
// bottom: 0;
|
24 |
:global(.ant-layout-sider-children) {
|
25 |
height: auto;
|
26 |
}
|
@@ -37,9 +43,11 @@
|
|
37 |
}
|
38 |
.list {
|
39 |
width: 100%;
|
40 |
-
// height: 100%;
|
41 |
height: calc(100vh - 152px);
|
42 |
overflow: auto;
|
|
|
|
|
|
|
43 |
}
|
44 |
.checkbox {
|
45 |
width: 100%;
|
@@ -51,8 +59,6 @@
|
|
51 |
|
52 |
.firstRenderContent {
|
53 |
height: 100%;
|
54 |
-
background-position: center;
|
55 |
-
background-size: cover;
|
56 |
}
|
57 |
|
58 |
.content {
|
|
|
1 |
.searchPage {
|
2 |
+
background-position: center;
|
3 |
+
background-size: cover;
|
4 |
.card {
|
5 |
width: 100%;
|
6 |
:global(.ant-card-body) {
|
|
|
15 |
font-size: 14px;
|
16 |
cursor: pointer;
|
17 |
}
|
18 |
+
|
19 |
+
.mainLayout {
|
20 |
+
background: transparent;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
.transparentSearchSide {
|
25 |
+
background-color: rgb(251 251 251 / 88%) !important;
|
26 |
}
|
27 |
|
28 |
.searchSide {
|
|
|
29 |
position: relative;
|
|
|
|
|
|
|
30 |
:global(.ant-layout-sider-children) {
|
31 |
height: auto;
|
32 |
}
|
|
|
43 |
}
|
44 |
.list {
|
45 |
width: 100%;
|
|
|
46 |
height: calc(100vh - 152px);
|
47 |
overflow: auto;
|
48 |
+
&::-webkit-scrollbar-track {
|
49 |
+
background: transparent;
|
50 |
+
}
|
51 |
}
|
52 |
.checkbox {
|
53 |
width: 100%;
|
|
|
59 |
|
60 |
.firstRenderContent {
|
61 |
height: 100%;
|
|
|
|
|
62 |
}
|
63 |
|
64 |
.content {
|
web/src/pages/search/index.tsx
CHANGED
@@ -86,25 +86,24 @@ const SearchPage = () => {
|
|
86 |
|
87 |
return (
|
88 |
<>
|
89 |
-
<Layout
|
|
|
|
|
|
|
90 |
<SearchSidebar
|
|
|
91 |
checkedList={checkedList}
|
92 |
setCheckedList={setCheckedList}
|
93 |
></SearchSidebar>
|
94 |
-
<Layout>
|
95 |
<Content>
|
96 |
{isFirstRender ? (
|
97 |
<Flex
|
98 |
justify="center"
|
99 |
align="center"
|
100 |
className={styles.firstRenderContent}
|
101 |
-
style={{ backgroundImage: `url(${imgUrl})` }}
|
102 |
>
|
103 |
<Flex vertical align="center" gap={'large'}>
|
104 |
-
{/* <Space size={30}>
|
105 |
-
<img src="/logo.svg" alt="" className={styles.appIcon} />
|
106 |
-
<span className={styles.appName}>{appConf.appName}</span>
|
107 |
-
</Space> */}
|
108 |
{InputSearch}
|
109 |
</Flex>
|
110 |
</Flex>
|
|
|
86 |
|
87 |
return (
|
88 |
<>
|
89 |
+
<Layout
|
90 |
+
className={styles.searchPage}
|
91 |
+
style={{ backgroundImage: `url(${imgUrl})` }}
|
92 |
+
>
|
93 |
<SearchSidebar
|
94 |
+
isFirstRender={isFirstRender}
|
95 |
checkedList={checkedList}
|
96 |
setCheckedList={setCheckedList}
|
97 |
></SearchSidebar>
|
98 |
+
<Layout className={isFirstRender ? styles.mainLayout : ''}>
|
99 |
<Content>
|
100 |
{isFirstRender ? (
|
101 |
<Flex
|
102 |
justify="center"
|
103 |
align="center"
|
104 |
className={styles.firstRenderContent}
|
|
|
105 |
>
|
106 |
<Flex vertical align="center" gap={'large'}>
|
|
|
|
|
|
|
|
|
107 |
{InputSearch}
|
108 |
</Flex>
|
109 |
</Flex>
|
web/src/pages/search/sidebar.tsx
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
import { useNextFetchKnowledgeList } from '@/hooks/knowledge-hooks';
|
|
|
2 |
import type { CheckboxProps } from 'antd';
|
3 |
import { Avatar, Checkbox, Layout, List, Space, Typography } from 'antd';
|
|
|
4 |
import { CheckboxValueType } from 'antd/es/checkbox/Group';
|
|
|
5 |
import {
|
6 |
Dispatch,
|
7 |
SetStateAction,
|
@@ -10,18 +13,21 @@ import {
|
|
10 |
useMemo,
|
11 |
} from 'react';
|
12 |
|
13 |
-
import { UserOutlined } from '@ant-design/icons';
|
14 |
-
import { CheckboxChangeEvent } from 'antd/es/checkbox';
|
15 |
import styles from './index.less';
|
16 |
|
17 |
const { Sider } = Layout;
|
18 |
|
19 |
interface IProps {
|
|
|
20 |
checkedList: string[];
|
21 |
setCheckedList: Dispatch<SetStateAction<string[]>>;
|
22 |
}
|
23 |
|
24 |
-
const SearchSidebar = ({
|
|
|
|
|
|
|
|
|
25 |
const { list, loading } = useNextFetchKnowledgeList();
|
26 |
const ids = useMemo(() => list.map((x) => x.id), [list]);
|
27 |
|
@@ -49,7 +55,13 @@ const SearchSidebar = ({ checkedList, setCheckedList }: IProps) => {
|
|
49 |
}, [ids, setCheckedList]);
|
50 |
|
51 |
return (
|
52 |
-
<Sider
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
<Checkbox
|
54 |
className={styles.modelForm}
|
55 |
indeterminate={indeterminate}
|
|
|
1 |
import { useNextFetchKnowledgeList } from '@/hooks/knowledge-hooks';
|
2 |
+
import { UserOutlined } from '@ant-design/icons';
|
3 |
import type { CheckboxProps } from 'antd';
|
4 |
import { Avatar, Checkbox, Layout, List, Space, Typography } from 'antd';
|
5 |
+
import { CheckboxChangeEvent } from 'antd/es/checkbox';
|
6 |
import { CheckboxValueType } from 'antd/es/checkbox/Group';
|
7 |
+
import classNames from 'classnames';
|
8 |
import {
|
9 |
Dispatch,
|
10 |
SetStateAction,
|
|
|
13 |
useMemo,
|
14 |
} from 'react';
|
15 |
|
|
|
|
|
16 |
import styles from './index.less';
|
17 |
|
18 |
const { Sider } = Layout;
|
19 |
|
20 |
interface IProps {
|
21 |
+
isFirstRender: boolean;
|
22 |
checkedList: string[];
|
23 |
setCheckedList: Dispatch<SetStateAction<string[]>>;
|
24 |
}
|
25 |
|
26 |
+
const SearchSidebar = ({
|
27 |
+
isFirstRender,
|
28 |
+
checkedList,
|
29 |
+
setCheckedList,
|
30 |
+
}: IProps) => {
|
31 |
const { list, loading } = useNextFetchKnowledgeList();
|
32 |
const ids = useMemo(() => list.map((x) => x.id), [list]);
|
33 |
|
|
|
55 |
}, [ids, setCheckedList]);
|
56 |
|
57 |
return (
|
58 |
+
<Sider
|
59 |
+
className={classNames(styles.searchSide, {
|
60 |
+
[styles.transparentSearchSide]: isFirstRender,
|
61 |
+
})}
|
62 |
+
theme={'light'}
|
63 |
+
width={240}
|
64 |
+
>
|
65 |
<Checkbox
|
66 |
className={styles.modelForm}
|
67 |
indeterminate={indeterminate}
|