@daeryun/dr_components 0.4.56 → 0.4.58

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.
@@ -3,7 +3,7 @@ import { NoResult } from './NoResult';
3
3
  import { Title } from './Title';
4
4
  import { ViewMore } from './ViewMore';
5
5
  import mobile from 'is-mobile';
6
- import { useRouter } from 'next/router';
6
+ import { useRouter } from 'next/navigation';
7
7
  import Link from 'next/link';
8
8
  import Image from 'next/image';
9
9
  import style from './index.module.css';
@@ -97,8 +97,7 @@ const LawyerContainer = (props) => {
97
97
  </Link>
98
98
  <div className={'m-3 flex h-full flex-col justify-between'}>
99
99
  <Link href={{
100
- pathname: '/lawyer/' + item.id,
101
- query: Object.assign({}, router.query)
100
+ pathname: '/lawyer/' + item.id
102
101
  }}>
103
102
  <span>
104
103
  <div className={'flex items-center justify-between'}>
@@ -4,7 +4,7 @@ import { Title } from './Title';
4
4
  import { ILawyerTypes, IListPagesType, IListTypes } from './integrateType';
5
5
  import { ViewMore } from './ViewMore';
6
6
  import mobile from 'is-mobile';
7
- import { useRouter } from 'next/router';
7
+ import { useRouter } from 'next/navigation';
8
8
  import Link from 'next/link';
9
9
  import Image from 'next/image';
10
10
  import style from './index.module.css';
@@ -205,10 +205,7 @@ const LawyerContainer = (props: {
205
205
  <div className={'m-3 flex h-full flex-col justify-between'}>
206
206
  <Link
207
207
  href={{
208
- pathname: '/lawyer/' + item.id,
209
- query: {
210
- ...router.query
211
- }
208
+ pathname: '/lawyer/' + item.id
212
209
  }}
213
210
  >
214
211
  <span>
@@ -3,7 +3,7 @@ import Image from 'next/image';
3
3
  import { NoResult } from './NoResult';
4
4
  import { Title } from './Title';
5
5
  import { ViewMore } from './ViewMore';
6
- import { useRouter } from 'next/router';
6
+ import { useRouter } from 'next/navigation';
7
7
  import { searchColorText } from '../../common/integrate';
8
8
  const Map = (props) => {
9
9
  const router = useRouter();
@@ -48,7 +48,6 @@ const Map = (props) => {
48
48
  ? allTabList
49
49
  : list.mapList.slice(0, 5)
50
50
  : list.mapList).map((item, index) => {
51
- var _a, _b, _c;
52
51
  return (<div key={'integrate_map' + item.key} className={'group/mapBox flex gap-[60px] border-b-[1px] border-solid border-[#DDDDDD] hover:bg-[#FCFCFC] ' +
53
52
  //1280px
54
53
  'max-xl:gap-[0] ' +
@@ -95,17 +94,17 @@ const Map = (props) => {
95
94
  <span className={'grow ' +
96
95
  //640px
97
96
  'max-sm:hidden'}>
98
- <MapInfoCon locale={(_a = router.locale) !== null && _a !== void 0 ? _a : ''} title={'주소'} text={<>
97
+ <MapInfoCon locale={'ko'} title={'주소'} text={<>
99
98
  {item.address
100
99
  .replaceAll('법무법인(유한)대륜', '')
101
100
  .replaceAll('법무법인(유한) 대륜', '')}
102
101
  </>}/>
103
- <MapInfoCon locale={(_b = router.locale) !== null && _b !== void 0 ? _b : ''} title={'업무시간'} text={<>
102
+ <MapInfoCon locale={'ko'} title={'업무시간'} text={<>
104
103
  {item.worktime.split(' | ').map((i, index) => (<span key={item.key + '_work_time_' + index} className={'block'}>
105
104
  {i}
106
105
  </span>))}
107
106
  </>}/>
108
- <MapInfoCon locale={(_c = router.locale) !== null && _c !== void 0 ? _c : ''} title={'대표번호'} text={<>{item.tel}</>}/>
107
+ <MapInfoCon locale={'ko'} title={'대표번호'} text={<>{item.tel}</>}/>
109
108
  </span>
110
109
  </div>);
111
110
  })}
@@ -5,7 +5,7 @@ import { useTranslation } from 'next-i18next';
5
5
  import { NoResult } from './NoResult';
6
6
  import { Title } from './Title';
7
7
  import { ViewMore } from './ViewMore';
8
- import { useRouter } from 'next/router';
8
+ import { useRouter } from 'next/navigation';
9
9
  import { searchColorText } from '../../common/integrate';
10
10
 
11
11
  const Map = (props: {
@@ -175,7 +175,7 @@ const Map = (props: {
175
175
  }
176
176
  >
177
177
  <MapInfoCon
178
- locale={router.locale ?? ''}
178
+ locale={'ko'}
179
179
  title={'주소'}
180
180
  text={
181
181
  <>
@@ -186,7 +186,7 @@ const Map = (props: {
186
186
  }
187
187
  />
188
188
  <MapInfoCon
189
- locale={router.locale ?? ''}
189
+ locale={'ko'}
190
190
  title={'업무시간'}
191
191
  text={
192
192
  <>
@@ -201,11 +201,7 @@ const Map = (props: {
201
201
  </>
202
202
  }
203
203
  />
204
- <MapInfoCon
205
- locale={router.locale ?? ''}
206
- title={'대표번호'}
207
- text={<>{item.tel}</>}
208
- />
204
+ <MapInfoCon locale={'ko'} title={'대표번호'} text={<>{item.tel}</>} />
209
205
  </span>
210
206
  </div>
211
207
  );
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  import React, { useState, useEffect } from 'react';
12
12
  import { NoResult } from './NoResult';
13
13
  import { searchInit } from './integrateType';
14
- import { useRouter } from 'next/router';
14
+ import { useRouter, useSearchParams } from 'next/navigation';
15
15
  import Field from './Field';
16
16
  import Success from './Success';
17
17
  import LawInfo from './LawInfo';
@@ -28,6 +28,9 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
28
28
  const [list, setList] = useState(searchInit.list);
29
29
  const [pages, setPages] = useState(searchInit.pages);
30
30
  const [isMobileSize, setIsMobileSize] = useState(null);
31
+ const searchParams = useSearchParams();
32
+ const querySearch = searchParams.get('search');
33
+ const queryTab = searchParams.get('tab');
31
34
  const handleMoreView = (key, data) => {
32
35
  // @ts-ignore
33
36
  setPages(Object.assign(Object.assign({}, pages), { [key]: pages[key] + 1 }));
@@ -35,16 +38,16 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
35
38
  setList(Object.assign(Object.assign({}, list), { [key]: [...list[key], ...data] }));
36
39
  };
37
40
  const handleMoreViewText = (tab) => __awaiter(void 0, void 0, void 0, function* () {
38
- yield router.push(`/integrate?search=${router.query.search}&tab=${tab}`);
41
+ yield router.push(`/integrate?search=${querySearch}&tab=${tab}`);
39
42
  });
40
43
  useEffect(() => {
41
44
  setList(propsList);
42
45
  }, [propsList]);
43
46
  useEffect(() => {
44
- setSearch(String(router.query.search));
45
- setTab(String(router.query.tab));
47
+ setSearch(String(querySearch));
48
+ setTab(String(queryTab));
46
49
  // setPages(searchInit.pages)
47
- }, [router.query]);
50
+ }, [searchParams]);
48
51
  //브라우저 체크
49
52
  useEffect(() => {
50
53
  if (width != 0 && width < 641 && isMobileSize != true) {
@@ -3,7 +3,7 @@
3
3
  import React, { useState, useEffect } from 'react';
4
4
  import { NoResult } from './NoResult';
5
5
  import { IListPagesType, IListTypes, searchInit } from './integrateType';
6
- import { useRouter } from 'next/router';
6
+ import { useRouter, useSearchParams } from 'next/navigation';
7
7
  import Field from './Field';
8
8
  import Success from './Success';
9
9
  import LawInfo from './LawInfo';
@@ -42,6 +42,9 @@ const SearchData = ({
42
42
  const [pages, setPages] = useState<IListPagesType>(searchInit.pages);
43
43
  const [isMobileSize, setIsMobileSize] = useState<boolean | null>(null);
44
44
 
45
+ const searchParams = useSearchParams();
46
+ const querySearch = searchParams.get('search');
47
+ const queryTab = searchParams.get('tab');
45
48
  const handleMoreView = (key: string, data: any[]) => {
46
49
  // @ts-ignore
47
50
  setPages({ ...pages, [key]: pages[key] + 1 });
@@ -50,7 +53,7 @@ const SearchData = ({
50
53
  };
51
54
 
52
55
  const handleMoreViewText = async (tab: any) => {
53
- await router.push(`/integrate?search=${router.query.search}&tab=${tab}`);
56
+ await router.push(`/integrate?search=${querySearch}&tab=${tab}`);
54
57
  };
55
58
 
56
59
  useEffect(() => {
@@ -58,10 +61,10 @@ const SearchData = ({
58
61
  }, [propsList]);
59
62
 
60
63
  useEffect(() => {
61
- setSearch(String(router.query.search));
62
- setTab(String(router.query.tab));
64
+ setSearch(String(querySearch));
65
+ setTab(String(queryTab));
63
66
  // setPages(searchInit.pages)
64
- }, [router.query]);
67
+ }, [searchParams]);
65
68
 
66
69
  //브라우저 체크
67
70
  useEffect(() => {
@@ -1,6 +1,10 @@
1
1
  import Image from 'next/image';
2
2
  import React from 'react';
3
+ import Link from 'next/link';
4
+ import { useSearchParams } from 'next/navigation';
3
5
  export const Title = (props) => {
6
+ const searchParams = useSearchParams();
7
+ const querySearch = searchParams.get('search');
4
8
  return (<div className={`mb-6 w-full font-semibold`}>
5
9
  <div className={'mb-[18px] flex items-center justify-between'}>
6
10
  <p className={'text-[36px] max-lg:text-[30px] max-sm:text-[26px]'}>
@@ -10,16 +14,16 @@ export const Title = (props) => {
10
14
  ({props.count.toLocaleString()})
11
15
  </span>)}
12
16
  </p>
13
- {props.tab === '전체' && !props.noMoreView && (<button tabIndex={0} className={'flex cursor-pointer items-center justify-between text-black sm:mt-3 lg:mt-6 xl:mt-7 '} onClick={() => {
17
+ {props.tab === '전체' && !props.noMoreView && (<Link href={`/integrate?search=${querySearch}&tab=${props.type}`} tabIndex={0} className={'flex cursor-pointer items-center justify-between text-black sm:mt-3 lg:mt-6 xl:mt-7 '} onClick={() => {
14
18
  props.onClick(props.type);
15
19
  }} onKeyDown={(e) => {
16
20
  if (e.key === 'Enter') {
17
21
  props.onClick(props.type);
18
22
  }
19
- }} aria-label={`${props.title === '오시는길' ? '오시는길 페이지로 이동' : props.title + ' 더보기'}`}>
23
+ }}>
20
24
  <span className={'mt-[1px] max-sm:hidden'}>더보기</span>
21
25
  <Image src={'/images/integrate/right.webp'} alt={''} title={''} width={30} height={30} className={'ml-3 h-[14px] w-[22px]'}/>
22
- </button>)}
26
+ </Link>)}
23
27
  </div>
24
28
  <div className={'border-b-[2px] border-solid border-[#B5B5B5] ' + `${props.noUnderBorder ? 'hidden' : ''}`}></div>
25
29
  </div>);
@@ -1,5 +1,7 @@
1
1
  import Image from 'next/image';
2
2
  import React from 'react';
3
+ import Link from 'next/link';
4
+ import { useSearchParams } from 'next/navigation';
3
5
 
4
6
  export const Title = (props: {
5
7
  title: string;
@@ -10,6 +12,9 @@ export const Title = (props: {
10
12
  noUnderBorder?: boolean; //밑줄삭제
11
13
  noMoreView?: boolean; //더보기버튼 삭제
12
14
  }) => {
15
+ const searchParams = useSearchParams();
16
+ const querySearch = searchParams.get('search');
17
+
13
18
  return (
14
19
  <div className={`mb-6 w-full font-semibold`}>
15
20
  <div className={'mb-[18px] flex items-center justify-between'}>
@@ -25,7 +30,8 @@ export const Title = (props: {
25
30
  )}
26
31
  </p>
27
32
  {props.tab === '전체' && !props.noMoreView && (
28
- <button
33
+ <Link
34
+ href={`/integrate?search=${querySearch}&tab=${props.type}`}
29
35
  tabIndex={0}
30
36
  className={
31
37
  'flex cursor-pointer items-center justify-between text-black sm:mt-3 lg:mt-6 xl:mt-7 '
@@ -38,7 +44,6 @@ export const Title = (props: {
38
44
  props.onClick(props.type);
39
45
  }
40
46
  }}
41
- aria-label={`${props.title === '오시는길' ? '오시는길 페이지로 이동' : props.title + ' 더보기'}`}
42
47
  >
43
48
  <span className={'mt-[1px] max-sm:hidden'}>더보기</span>
44
49
  <Image
@@ -49,7 +54,7 @@ export const Title = (props: {
49
54
  height={30}
50
55
  className={'ml-3 h-[14px] w-[22px]'}
51
56
  />
52
- </button>
57
+ </Link>
53
58
  )}
54
59
  </div>
55
60
  <div
@@ -3,26 +3,26 @@ import React from 'react';
3
3
  import Loader from '../../Loader/Loader';
4
4
  export const ViewMore = (props) => {
5
5
  const { func, loading, flag, totalPage, nowPage, label = '' } = props;
6
- const isNotLastPage = nowPage && totalPage ? nowPage - 1 !== totalPage : false;
7
6
  const labelTxt = `${label} 글 더보기${nowPage && totalPage ? ` ${totalPage}페이지 중 ${nowPage - 1}페이지` : ''}`;
8
7
  return (<>
9
- {loading ? (<b className={'mb-20 text-center'}>
10
- <Loader />
11
- </b>) : (<button aria-label={labelTxt} className={'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center border-[1px] border-solid border-[#707070] px-5 py-4 text-[#666666] ' +
12
- (isNotLastPage ? 'justify-between ' : 'pointer-events-none justify-center')} onKeyDown={(e) => {
8
+ {flag ? (loading ? (<b className={'mb-20 text-center'}>
9
+ <Loader />
10
+ </b>) : (<button aria-label={labelTxt} className={(nowPage && totalPage ? ' px-5 ' : ' px-10 ') +
11
+ 'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] py-4 text-[#666666] '} onKeyDown={(e) => {
13
12
  if (e.key === 'Enter') {
14
13
  func();
15
14
  }
16
15
  }} onClick={() => {
17
16
  func();
18
17
  }}>
19
- <span className={'pt-[2px] leading-[15px] text-[#666666] '}>
20
- 더보기{' '}
21
- {nowPage && totalPage ? (<>
22
- {nowPage - 1}/{totalPage}{' '}
23
- </>) : (<></>)}
24
- </span>
25
- {isNotLastPage ? (<Image src={'/images/plus_g.webp'} alt={''} width={30} height={30} className={'aspect-square w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}/>) : (<></>)}
26
- </button>)}
18
+ <p className={'pt-[2px] leading-[15px] text-[#666666] '}>
19
+ 더보기{' '}
20
+ {nowPage && totalPage ? (<span>
21
+ {nowPage - 1}/{totalPage}{' '}
22
+ </span>) : (<></>)}
23
+ </p>
24
+
25
+ <Image src={'/images/plus_g.webp'} alt={''} width={44} height={44} className={'h-auto w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}/>
26
+ </button>)) : null}
27
27
  </>);
28
28
  };
@@ -12,55 +12,52 @@ export const ViewMore = (props: {
12
12
  }) => {
13
13
  const { func, loading, flag, totalPage, nowPage, label = '' } = props;
14
14
 
15
- const isNotLastPage = nowPage && totalPage ? nowPage - 1 !== totalPage : false;
16
-
17
15
  const labelTxt = `${label} 글 더보기${nowPage && totalPage ? ` ${totalPage}페이지 중 ${nowPage - 1}페이지` : ''}`;
18
16
 
19
17
  return (
20
18
  <>
21
- {loading ? (
22
- <b className={'mb-20 text-center'}>
23
- <Loader />
24
- </b>
25
- ) : (
26
- <button
27
- aria-label={labelTxt}
28
- className={
29
- 'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center border-[1px] border-solid border-[#707070] px-5 py-4 text-[#666666] ' +
30
- (isNotLastPage ? 'justify-between ' : 'pointer-events-none justify-center')
31
- }
32
- onKeyDown={(e: any) => {
33
- if (e.key === 'Enter') {
34
- func();
19
+ {flag ? (
20
+ loading ? (
21
+ <b className={'mb-20 text-center'}>
22
+ <Loader />
23
+ </b>
24
+ ) : (
25
+ <button
26
+ aria-label={labelTxt}
27
+ className={
28
+ (nowPage && totalPage ? ' px-5 ' : ' px-10 ') +
29
+ 'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] py-4 text-[#666666] '
35
30
  }
36
- }}
37
- onClick={() => {
38
- func();
39
- }}
40
- >
41
- <span className={'pt-[2px] leading-[15px] text-[#666666] '}>
42
- 더보기{' '}
43
- {nowPage && totalPage ? (
44
- <>
45
- {nowPage - 1}/{totalPage}{' '}
46
- </>
47
- ) : (
48
- <></>
49
- )}
50
- </span>
51
- {isNotLastPage ? (
31
+ onKeyDown={(e: any) => {
32
+ if (e.key === 'Enter') {
33
+ func();
34
+ }
35
+ }}
36
+ onClick={() => {
37
+ func();
38
+ }}
39
+ >
40
+ <p className={'pt-[2px] leading-[15px] text-[#666666] '}>
41
+ 더보기{' '}
42
+ {nowPage && totalPage ? (
43
+ <span>
44
+ {nowPage - 1}/{totalPage}{' '}
45
+ </span>
46
+ ) : (
47
+ <></>
48
+ )}
49
+ </p>
50
+
52
51
  <Image
53
52
  src={'/images/plus_g.webp'}
54
53
  alt={''}
55
- width={30}
56
- height={30}
57
- className={'aspect-square w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}
54
+ width={44}
55
+ height={44}
56
+ className={'h-auto w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}
58
57
  />
59
- ) : (
60
- <></>
61
- )}
62
- </button>
63
- )}
58
+ </button>
59
+ )
60
+ ) : null}
64
61
  </>
65
62
  );
66
63
  };
@@ -3641,6 +3641,11 @@ video {
3641
3641
  padding: 52px;
3642
3642
  }
3643
3643
 
3644
+ .px-10 {
3645
+ padding-left: 2.5rem;
3646
+ padding-right: 2.5rem;
3647
+ }
3648
+
3644
3649
  .px-3 {
3645
3650
  padding-left: 0.75rem;
3646
3651
  padding-right: 0.75rem;