@daeryun/dr_components 0.6.93 → 0.6.96

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.
@@ -72,10 +72,8 @@ const CategoryView = (props) => {
72
72
  }, []);
73
73
  useEffect(() => {
74
74
  if (centerList.length > 0 && categoryList.length > 0) {
75
- const selected = centerList.find(i => i === selectedCenter);
76
- if (selected) {
77
- setSelectedCenter(selected);
78
- const selectedCategory = categoryList.filter(i => i.center_code === selected.code);
75
+ if (selectedCenter) {
76
+ const selectedCategory = categoryList.filter(i => i.center_code === selectedCenter.code);
79
77
  setFilterCategory(selectedCategory);
80
78
  setShowCategory(selectedCategory.slice(0, itemsPerPage));
81
79
  setCurrentPage(1);
@@ -85,10 +85,8 @@ const CategoryView = (props: {
85
85
 
86
86
  useEffect(() => {
87
87
  if (centerList.length > 0 && categoryList.length > 0) {
88
- const selected = centerList.find(i => i === selectedCenter);
89
- if (selected) {
90
- setSelectedCenter(selected);
91
- const selectedCategory = categoryList.filter(i => i.center_code === selected.code);
88
+ if (selectedCenter) {
89
+ const selectedCategory = categoryList.filter(i => i.center_code === selectedCenter.code);
92
90
  setFilterCategory(selectedCategory);
93
91
  setShowCategory(selectedCategory.slice(0, itemsPerPage));
94
92
  setCurrentPage(1);
@@ -4,8 +4,7 @@ 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, selectedCenter, onClick, hiddenTitle, currentCenterTitle } = props;
8
- const currentCenter = props.centerList.filter(item => item.code_desc === currentCenterTitle);
7
+ const { themeColor, selectedCenter, onClick, hiddenTitle } = props;
9
8
  const CenterCon = (props) => {
10
9
  const { item } = props;
11
10
  return (<>
@@ -13,15 +12,15 @@ const CenterComponent = (props) => {
13
12
  onClick(item);
14
13
  }} style={{
15
14
  direction: 'ltr',
16
- backgroundColor: item === selectedCenter ? themeColor : themeColor + '00'
15
+ backgroundColor: item.code === selectedCenter.code ? themeColor : themeColor + '00'
17
16
  }} className={'relative block h-fit w-full bg-amber-200 py-[15px] text-left ' +
18
- `${item === selectedCenter
17
+ `${item.code === selectedCenter.code
19
18
  ? 'rounded-[15px] text-[#fff] max-2sm:rounded-[10px] '
20
19
  : 'hover:bg-[#b99c6e1a] '}`} onMouseOver={e => {
21
- if (item !== selectedCenter)
20
+ if (item.code !== selectedCenter.code)
22
21
  e.currentTarget.style.backgroundColor = themeColor + '15';
23
22
  }} onMouseOut={e => {
24
- if (item !== selectedCenter)
23
+ if (item.code !== selectedCenter.code)
25
24
  e.currentTarget.style.backgroundColor = themeColor + '00';
26
25
  }}>
27
26
  <span className={'flex h-full w-full items-center justify-between gap-[10px] px-[20px] ' +
@@ -37,13 +36,13 @@ const CenterComponent = (props) => {
37
36
  {item.code_name}
38
37
  </p>
39
38
  <Image src={Arrow1} alt={'arrow'} width={24} height={43} className={'mr-[10px] h-auto w-[12px] ' +
40
- `${item === selectedCenter ? 'block ' : 'hidden '}` +
39
+ `${item.code === selectedCenter.code ? 'block ' : 'hidden '}` +
41
40
  //1280px
42
41
  'max-xl:w-[9px] ' +
43
42
  //520px
44
43
  'max-2sm:w-[6px]'}/>
45
44
  <Image src={Arrow2} alt={'arrow'} width={24} height={43} className={'mr-[10px] h-auto w-[12px] ' +
46
- `${item === selectedCenter ? 'hidden ' : 'block '}` +
45
+ `${item.code === selectedCenter.code ? 'hidden ' : 'block '}` +
47
46
  //1280px
48
47
  'max-xl:w-[9px] ' +
49
48
  //520px
@@ -107,7 +106,10 @@ const CenterComponent = (props) => {
107
106
  'max-2sm:pl-[10px]'} style={{
108
107
  direction: 'rtl'
109
108
  }} id={'center_scroll_custom'}>
110
- {props.centerList.map(item => (<CenterCon key={item.code} item={item}/>))}
109
+ <CenterCon key={selectedCenter.code} item={selectedCenter}/>
110
+ {props.centerList
111
+ .filter(item => item.code_desc !== selectedCenter.code_desc)
112
+ .map(item => (<CenterCon key={item.code} item={item}/>))}
111
113
  </span>
112
114
  </div>
113
115
  </>);
@@ -14,8 +14,7 @@ const CenterComponent = (props: {
14
14
  hiddenTitle: boolean | undefined;
15
15
  currentCenterTitle: string;
16
16
  }) => {
17
- const { themeColor, centerList, selectedCenter, onClick, hiddenTitle, currentCenterTitle } = props;
18
- const currentCenter = props.centerList.filter(item => item.code_desc === currentCenterTitle);
17
+ const { themeColor, selectedCenter, onClick, hiddenTitle } = props;
19
18
 
20
19
  const CenterCon = (props: { item: ICenter }) => {
21
20
  const { item } = props;
@@ -28,21 +27,23 @@ const CenterComponent = (props: {
28
27
  }}
29
28
  style={{
30
29
  direction: 'ltr',
31
- backgroundColor: item === selectedCenter ? themeColor : themeColor + '00'
30
+ backgroundColor: item.code === selectedCenter.code ? themeColor : themeColor + '00'
32
31
  }}
33
32
  className={
34
33
  'relative block h-fit w-full bg-amber-200 py-[15px] text-left ' +
35
34
  `${
36
- item === selectedCenter
35
+ item.code === selectedCenter.code
37
36
  ? 'rounded-[15px] text-[#fff] max-2sm:rounded-[10px] '
38
37
  : 'hover:bg-[#b99c6e1a] '
39
38
  }`
40
39
  }
41
40
  onMouseOver={e => {
42
- if (item !== selectedCenter) e.currentTarget.style.backgroundColor = themeColor + '15';
41
+ if (item.code !== selectedCenter.code)
42
+ e.currentTarget.style.backgroundColor = themeColor + '15';
43
43
  }}
44
44
  onMouseOut={e => {
45
- if (item !== selectedCenter) e.currentTarget.style.backgroundColor = themeColor + '00';
45
+ if (item.code !== selectedCenter.code)
46
+ e.currentTarget.style.backgroundColor = themeColor + '00';
46
47
  }}
47
48
  >
48
49
  <span
@@ -72,7 +73,7 @@ const CenterComponent = (props: {
72
73
  height={43}
73
74
  className={
74
75
  'mr-[10px] h-auto w-[12px] ' +
75
- `${item === selectedCenter ? 'block ' : 'hidden '}` +
76
+ `${item.code === selectedCenter.code ? 'block ' : 'hidden '}` +
76
77
  //1280px
77
78
  'max-xl:w-[9px] ' +
78
79
  //520px
@@ -86,7 +87,7 @@ const CenterComponent = (props: {
86
87
  height={43}
87
88
  className={
88
89
  'mr-[10px] h-auto w-[12px] ' +
89
- `${item === selectedCenter ? 'hidden ' : 'block '}` +
90
+ `${item.code === selectedCenter.code ? 'hidden ' : 'block '}` +
90
91
  //1280px
91
92
  'max-xl:w-[9px] ' +
92
93
  //520px
@@ -178,9 +179,12 @@ const CenterComponent = (props: {
178
179
  }}
179
180
  id={'center_scroll_custom'}
180
181
  >
181
- {props.centerList.map(item => (
182
- <CenterCon key={item.code} item={item} />
183
- ))}
182
+ <CenterCon key={selectedCenter.code} item={selectedCenter} />
183
+ {props.centerList
184
+ .filter(item => item.code_desc !== selectedCenter.code_desc)
185
+ .map(item => (
186
+ <CenterCon key={item.code} item={item} />
187
+ ))}
184
188
  </span>
185
189
  </div>
186
190
  </>
@@ -34,3 +34,4 @@ export { default as PageWrapper } from './Layout/PageWrapper';
34
34
  export { default as SearchBar } from './SearchBar/SearchBar';
35
35
  export { default as VisitReservationLawyer } from './VisitReservationLawyer/VisitReservationLawyer';
36
36
  export { default as RelatedGroup } from './FieldNew/RelatedGroup';
37
+ export { default as FooterV2 } from './Footer/FooterV2';
@@ -34,3 +34,4 @@ export { default as PageWrapper } from './Layout/PageWrapper';
34
34
  export { default as SearchBar } from './SearchBar/SearchBar';
35
35
  export { default as VisitReservationLawyer } from './VisitReservationLawyer/VisitReservationLawyer';
36
36
  export { default as RelatedGroup } from './FieldNew/RelatedGroup';
37
+ export { default as FooterV2 } from './Footer/FooterV2';