@daeryun/dr_components 0.6.83 → 0.6.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/categoryView/CategoryView.jsx +2 -5
- package/dist/components/categoryView/CategoryView.tsx +3 -5
- package/dist/components/categoryView/CenterComponent.d.ts +2 -1
- package/dist/components/categoryView/CenterComponent.jsx +11 -9
- package/dist/components/categoryView/CenterComponent.tsx +13 -13
- package/dist/components/categoryView/ICategoryViewTypes.d.ts +0 -1
- package/dist/components/categoryView/ICategoryViewTypes.ts +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,6 @@ const CategoryView = (props) => {
|
|
|
33
33
|
const centerArr = response.data.list.filter((i) => i.code !== 'CT0000' && i.code !== 'CT0023' && i.code !== 'CT0028');
|
|
34
34
|
const selectedCenter = centerArr.find((i) => i.code_desc === props.currentCenterTitle);
|
|
35
35
|
if (selectedCenter) {
|
|
36
|
-
selectedCenter.isSelect = true;
|
|
37
36
|
setSelectedCenter(selectedCenter);
|
|
38
37
|
}
|
|
39
38
|
setCenterList(centerArr);
|
|
@@ -71,7 +70,7 @@ const CategoryView = (props) => {
|
|
|
71
70
|
}, []);
|
|
72
71
|
useEffect(() => {
|
|
73
72
|
if (centerList.length > 0 && categoryList.length > 0) {
|
|
74
|
-
const selected = centerList.find(i => i
|
|
73
|
+
const selected = centerList.find(i => i === selectedCenter);
|
|
75
74
|
if (selected) {
|
|
76
75
|
setSelectedCenter(selected);
|
|
77
76
|
const selectedCategory = categoryList.filter(i => i.center_code === selected.code);
|
|
@@ -91,9 +90,7 @@ const CategoryView = (props) => {
|
|
|
91
90
|
//900px
|
|
92
91
|
'max-md2:gap-[10px] max-md2:px-[10px] max-md2:py-[20px] max-md2:shadow-none '}>
|
|
93
92
|
{/*센터*/}
|
|
94
|
-
<CenterComponent themeColor={props.themeColor} centerList={centerList} onClick={
|
|
95
|
-
setCenterList(list);
|
|
96
|
-
}} hiddenTitle={props.hiddenTitle} currentCenterTitle={props.currentCenterTitle}/>
|
|
93
|
+
<CenterComponent themeColor={props.themeColor} selectedCenter={selectedCenter} centerList={centerList} onClick={setSelectedCenter} hiddenTitle={props.hiddenTitle} currentCenterTitle={props.currentCenterTitle}/>
|
|
97
94
|
|
|
98
95
|
{/*분야*/}
|
|
99
96
|
<CategoryComponent showCategory={showCategory} onClickPage={(num) => {
|
|
@@ -41,7 +41,6 @@ const CategoryView = (props: {
|
|
|
41
41
|
);
|
|
42
42
|
const selectedCenter = centerArr.find((i: ICenter) => i.code_desc === props.currentCenterTitle);
|
|
43
43
|
if (selectedCenter) {
|
|
44
|
-
selectedCenter.isSelect = true;
|
|
45
44
|
setSelectedCenter(selectedCenter);
|
|
46
45
|
}
|
|
47
46
|
setCenterList(centerArr);
|
|
@@ -81,7 +80,7 @@ const CategoryView = (props: {
|
|
|
81
80
|
|
|
82
81
|
useEffect(() => {
|
|
83
82
|
if (centerList.length > 0 && categoryList.length > 0) {
|
|
84
|
-
const selected = centerList.find(i => i
|
|
83
|
+
const selected = centerList.find(i => i === selectedCenter);
|
|
85
84
|
if (selected) {
|
|
86
85
|
setSelectedCenter(selected);
|
|
87
86
|
const selectedCategory = categoryList.filter(i => i.center_code === selected.code);
|
|
@@ -110,10 +109,9 @@ const CategoryView = (props: {
|
|
|
110
109
|
{/*센터*/}
|
|
111
110
|
<CenterComponent
|
|
112
111
|
themeColor={props.themeColor}
|
|
112
|
+
selectedCenter={selectedCenter}
|
|
113
113
|
centerList={centerList}
|
|
114
|
-
onClick={
|
|
115
|
-
setCenterList(list);
|
|
116
|
-
}}
|
|
114
|
+
onClick={setSelectedCenter}
|
|
117
115
|
hiddenTitle={props.hiddenTitle}
|
|
118
116
|
currentCenterTitle={props.currentCenterTitle}
|
|
119
117
|
/>
|
|
@@ -3,7 +3,8 @@ import { ICenter } from './ICategoryViewTypes';
|
|
|
3
3
|
declare const CenterComponent: (props: {
|
|
4
4
|
themeColor: string;
|
|
5
5
|
centerList: ICenter[];
|
|
6
|
-
|
|
6
|
+
selectedCenter: ICenter;
|
|
7
|
+
onClick: (center: ICenter) => void;
|
|
7
8
|
hiddenTitle: boolean | undefined;
|
|
8
9
|
currentCenterTitle: string;
|
|
9
10
|
}) => React.JSX.Element;
|
|
@@ -4,22 +4,24 @@ import Image from 'next/image';
|
|
|
4
4
|
import Arrow1 from '../../asset/images/categoryView/section9_arrow_01.webp';
|
|
5
5
|
import Arrow2 from '../../asset/images/categoryView/section9_arrow_02.webp';
|
|
6
6
|
const CenterComponent = (props) => {
|
|
7
|
-
const { themeColor, centerList, onClick, hiddenTitle, currentCenterTitle } = props;
|
|
7
|
+
const { themeColor, centerList, selectedCenter, onClick, hiddenTitle, currentCenterTitle } = props;
|
|
8
8
|
const currentCenter = props.centerList.filter(item => item.code_desc === currentCenterTitle);
|
|
9
9
|
const CenterCon = (props) => {
|
|
10
10
|
const { item } = props;
|
|
11
11
|
return (<>
|
|
12
12
|
<button type="button" onClick={() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
onClick(item);
|
|
14
|
+
}} style={{
|
|
15
|
+
direction: 'ltr',
|
|
16
|
+
backgroundColor: item === selectedCenter ? themeColor : themeColor + '00'
|
|
17
|
+
}} className={'relative block h-fit w-full bg-amber-200 py-[15px] text-left ' +
|
|
18
|
+
`${item === selectedCenter
|
|
17
19
|
? 'rounded-[15px] text-[#fff] max-2sm:rounded-[10px] '
|
|
18
20
|
: 'hover:bg-[#b99c6e1a] '}`} onMouseOver={e => {
|
|
19
|
-
if (
|
|
21
|
+
if (item !== selectedCenter)
|
|
20
22
|
e.currentTarget.style.backgroundColor = themeColor + '15';
|
|
21
23
|
}} onMouseOut={e => {
|
|
22
|
-
if (
|
|
24
|
+
if (item !== selectedCenter)
|
|
23
25
|
e.currentTarget.style.backgroundColor = themeColor + '00';
|
|
24
26
|
}}>
|
|
25
27
|
<span className={'flex h-full w-full items-center justify-between gap-[10px] px-[20px] ' +
|
|
@@ -35,13 +37,13 @@ const CenterComponent = (props) => {
|
|
|
35
37
|
{item.code_name}
|
|
36
38
|
</p>
|
|
37
39
|
<Image src={Arrow1} alt={'arrow'} width={24} height={43} className={'mr-[10px] h-auto w-[12px] ' +
|
|
38
|
-
`${item
|
|
40
|
+
`${item === selectedCenter ? 'block ' : 'hidden '}` +
|
|
39
41
|
//1280px
|
|
40
42
|
'max-xl:w-[9px] ' +
|
|
41
43
|
//520px
|
|
42
44
|
'max-2sm:w-[6px]'}/>
|
|
43
45
|
<Image src={Arrow2} alt={'arrow'} width={24} height={43} className={'mr-[10px] h-auto w-[12px] ' +
|
|
44
|
-
`${item
|
|
46
|
+
`${item === selectedCenter ? 'hidden ' : 'block '}` +
|
|
45
47
|
//1280px
|
|
46
48
|
'max-xl:w-[9px] ' +
|
|
47
49
|
//520px
|
|
@@ -9,11 +9,12 @@ import Arrow2 from '../../asset/images/categoryView/section9_arrow_02.webp';
|
|
|
9
9
|
const CenterComponent = (props: {
|
|
10
10
|
themeColor: string;
|
|
11
11
|
centerList: ICenter[];
|
|
12
|
-
|
|
12
|
+
selectedCenter: ICenter;
|
|
13
|
+
onClick: (center: ICenter) => void;
|
|
13
14
|
hiddenTitle: boolean | undefined;
|
|
14
15
|
currentCenterTitle: string;
|
|
15
16
|
}) => {
|
|
16
|
-
const { themeColor, centerList, onClick, hiddenTitle, currentCenterTitle } = props;
|
|
17
|
+
const { themeColor, centerList, selectedCenter, onClick, hiddenTitle, currentCenterTitle } = props;
|
|
17
18
|
const currentCenter = props.centerList.filter(item => item.code_desc === currentCenterTitle);
|
|
18
19
|
|
|
19
20
|
const CenterCon = (props: { item: ICenter }) => {
|
|
@@ -23,26 +24,25 @@ const CenterComponent = (props: {
|
|
|
23
24
|
<button
|
|
24
25
|
type="button"
|
|
25
26
|
onClick={() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
onClick(item);
|
|
28
|
+
}}
|
|
29
|
+
style={{
|
|
30
|
+
direction: 'ltr',
|
|
31
|
+
backgroundColor: item === selectedCenter ? themeColor : themeColor + '00'
|
|
31
32
|
}}
|
|
32
|
-
style={{ direction: 'ltr', backgroundColor: item.isSelect ? themeColor : themeColor + '00' }}
|
|
33
33
|
className={
|
|
34
34
|
'relative block h-fit w-full bg-amber-200 py-[15px] text-left ' +
|
|
35
35
|
`${
|
|
36
|
-
item
|
|
36
|
+
item === selectedCenter
|
|
37
37
|
? 'rounded-[15px] text-[#fff] max-2sm:rounded-[10px] '
|
|
38
38
|
: 'hover:bg-[#b99c6e1a] '
|
|
39
39
|
}`
|
|
40
40
|
}
|
|
41
41
|
onMouseOver={e => {
|
|
42
|
-
if (
|
|
42
|
+
if (item !== selectedCenter) e.currentTarget.style.backgroundColor = themeColor + '15';
|
|
43
43
|
}}
|
|
44
44
|
onMouseOut={e => {
|
|
45
|
-
if (
|
|
45
|
+
if (item !== selectedCenter) e.currentTarget.style.backgroundColor = themeColor + '00';
|
|
46
46
|
}}
|
|
47
47
|
>
|
|
48
48
|
<span
|
|
@@ -72,7 +72,7 @@ const CenterComponent = (props: {
|
|
|
72
72
|
height={43}
|
|
73
73
|
className={
|
|
74
74
|
'mr-[10px] h-auto w-[12px] ' +
|
|
75
|
-
`${item
|
|
75
|
+
`${item === selectedCenter ? 'block ' : 'hidden '}` +
|
|
76
76
|
//1280px
|
|
77
77
|
'max-xl:w-[9px] ' +
|
|
78
78
|
//520px
|
|
@@ -86,7 +86,7 @@ const CenterComponent = (props: {
|
|
|
86
86
|
height={43}
|
|
87
87
|
className={
|
|
88
88
|
'mr-[10px] h-auto w-[12px] ' +
|
|
89
|
-
`${item
|
|
89
|
+
`${item === selectedCenter ? 'hidden ' : 'block '}` +
|
|
90
90
|
//1280px
|
|
91
91
|
'max-xl:w-[9px] ' +
|
|
92
92
|
//520px
|