@daeryun/dr_components 0.5.22 → 0.5.24

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,5 +3,6 @@ declare const SearchIcon: (props: {
3
3
  index: number;
4
4
  fillColor: string;
5
5
  hover?: boolean;
6
- }) => import("react").JSX.Element;
6
+ hoverColor?: string;
7
+ }) => import("react").JSX.Element | null;
7
8
  export default SearchIcon;
@@ -2,11 +2,14 @@ import Icon1 from '../../asset/images/viewMoreSection/searchIconSVG/section12_ic
2
2
  import Icon2 from '../../asset/images/viewMoreSection/searchIconSVG/section12_icon_02a.svg';
3
3
  import Icon3 from '../../asset/images/viewMoreSection/searchIconSVG/section12_icon_03a.svg';
4
4
  import Icon4 from '../../asset/images/viewMoreSection/searchIconSVG/section12_icon_04a.svg';
5
- // * 부모에게 group/search 클래스를 줘야지 호버효과
6
5
  const SearchIcon = (props) => {
7
- const { className = '', index, fillColor, hover = false } = props;
6
+ const { className = '', index, fillColor, hover = false, hoverColor } = props;
7
+ const icons = [Icon1, Icon2, Icon3, Icon4];
8
+ const IconComponent = icons[index] || null;
9
+ if (!IconComponent)
10
+ return null;
8
11
  return (<span className={className}>
9
- {index === 0 ? (<Icon1 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''}/>) : index === 1 ? (<Icon2 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''}/>) : index === 2 ? (<Icon3 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''}/>) : index === 3 ? (<Icon4 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''}/>) : (<></>)}
12
+ <IconComponent fill={hover ? hoverColor || '#c3c3c3' : fillColor} className={hover ? 'transition-[fill]' : ''}/>
10
13
  </span>);
11
14
  };
12
15
  export default SearchIcon;
@@ -3,23 +3,27 @@ import Icon2 from '../../asset/images/viewMoreSection/searchIconSVG/section12_ic
3
3
  import Icon3 from '../../asset/images/viewMoreSection/searchIconSVG/section12_icon_03a.svg';
4
4
  import Icon4 from '../../asset/images/viewMoreSection/searchIconSVG/section12_icon_04a.svg';
5
5
 
6
- // * 부모에게 group/search 클래스를 줘야지 호버효과
7
- const SearchIcon = (props: { className?: string; index: number; fillColor: string; hover?: boolean }) => {
8
- const { className = '', index, fillColor, hover = false } = props;
6
+ const SearchIcon = (props: {
7
+ className?: string;
8
+ index: number;
9
+ fillColor: string;
10
+ hover?: boolean;
11
+ hoverColor?: string;
12
+ }) => {
13
+ const { className = '', index, fillColor, hover = false, hoverColor } = props;
14
+ const icons = [Icon1, Icon2, Icon3, Icon4];
15
+ const IconComponent = icons[index] || null;
16
+
17
+ if (!IconComponent) return null;
18
+
9
19
  return (
10
20
  <span className={className}>
11
- {index === 0 ? (
12
- <Icon1 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''} />
13
- ) : index === 1 ? (
14
- <Icon2 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''} />
15
- ) : index === 2 ? (
16
- <Icon3 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''} />
17
- ) : index === 3 ? (
18
- <Icon4 fill={fillColor} className={hover ? ' transition-[fill] group-hover:fill-[#c3c3c3]' : ''} />
19
- ) : (
20
- <></>
21
- )}
21
+ <IconComponent
22
+ fill={hover ? hoverColor || '#c3c3c3' : fillColor}
23
+ className={hover ? 'transition-[fill]' : ''}
24
+ />
22
25
  </span>
23
26
  );
24
27
  };
28
+
25
29
  export default SearchIcon;
@@ -10,7 +10,9 @@ interface IViewMoreSectionTypes {
10
10
  tel: string;
11
11
  inputColor: string;
12
12
  arrowColor: string;
13
+ arrowHoverColor?: string;
13
14
  iconColor: string;
15
+ iconHoverColor?: string;
14
16
  hoverColor: string;
15
17
  isGroupSearch?: boolean;
16
18
  keywordColor?: string;
@@ -5,10 +5,12 @@ import Link from 'next/link';
5
5
  import ArrowRightUp from '../../asset/images/viewMoreSection/arrow.svg';
6
6
  import Search from '../../asset/images/viewMoreSection/search.svg';
7
7
  import SearchIcon from './SearchIcon';
8
- import { useRouter } from 'next/navigation';
8
+ import { usePathname, useRouter } from 'next/navigation';
9
9
  const ViewMoreSection = (props) => {
10
10
  const router = useRouter();
11
11
  const [search, setSearch] = useState('');
12
+ const pathname = usePathname();
13
+ const [hoverIndex, setHoverIndex] = useState(-1);
12
14
  const handleInputChange = (event) => {
13
15
  setSearch(event.target.value);
14
16
  };
@@ -29,16 +31,25 @@ const ViewMoreSection = (props) => {
29
31
  'max-[425px]:py-[70px] '}>
30
32
  <div className={'absolute bottom-0 h-[32%] w-full max-md:h-[62.56%]'} style={{ backgroundColor: props.bgColor ? props.bgColor : '#f0f0f0' }}></div>
31
33
  <Wrapper>
32
- <p className={'break-keep text-center text-[56px] font-[800] tracking-[-1.4px] ' +
33
- 'max-[1440px]:text-[52px] ' +
34
- 'max-lg:text-[48px] ' +
35
- 'max-md2:text-[44px] ' +
36
- 'max-md:text-[36px] ' +
37
- 'max-sm:text-[32px] ' +
38
- 'max-xs:text-[30px] ' +
39
- 'max-2xs:text-[28px] '}>
40
- {props.title}
41
- </p>
34
+ {pathname !== '/' ? (<p className={'break-keep text-center text-[56px] font-[800] tracking-[-1.4px] ' +
35
+ 'max-[1440px]:text-[52px] ' +
36
+ 'max-lg:text-[48px] ' +
37
+ 'max-md2:text-[44px] ' +
38
+ 'max-md:text-[36px] ' +
39
+ 'max-sm:text-[32px] ' +
40
+ 'max-xs:text-[30px] ' +
41
+ 'max-2xs:text-[28px] '}>
42
+ {props.title}
43
+ </p>) : (<h2 className={'break-keep text-center text-[56px] font-[800] tracking-[-1.4px] ' +
44
+ 'max-[1440px]:text-[52px] ' +
45
+ 'max-lg:text-[48px] ' +
46
+ 'max-md2:text-[44px] ' +
47
+ 'max-md:text-[36px] ' +
48
+ 'max-sm:text-[32px] ' +
49
+ 'max-xs:text-[30px] ' +
50
+ 'max-2xs:text-[28px] '}>
51
+ {props.title}
52
+ </h2>)}
42
53
 
43
54
  {/*인풋*/}
44
55
  <div className={'flex flex-col '}>
@@ -93,7 +104,11 @@ const ViewMoreSection = (props) => {
93
104
  </style>
94
105
 
95
106
  {props.moreViewList.map((list, index) => {
96
- return (<Link href={list.link} className={'moreView-box group relative h-[340px] flex-1 cursor-pointer border border-solid border-[#E2E2E2] bg-white px-[39px] py-[50px] hover:text-white ' +
107
+ return (<Link href={list.link} onMouseOver={() => {
108
+ setHoverIndex(index);
109
+ }} onMouseOut={() => {
110
+ setHoverIndex(-1);
111
+ }} className={'moreView-box group relative h-[340px] flex-1 cursor-pointer border border-solid border-[#E2E2E2] bg-white px-[39px] py-[50px] hover:text-white ' +
97
112
  ' transition-[background-color,color,border-color] ' +
98
113
  //1400px
99
114
  ' max-xxl:h-[300px] max-xxl:px-[25px] max-xxl:py-[35px] ' +
@@ -109,7 +124,11 @@ const ViewMoreSection = (props) => {
109
124
  //모바일
110
125
  'max-md:text-[26px]'}>
111
126
  {list.title}
112
- <ArrowRightUp height="13px" width="13px" fill={props.arrowColor} className={'transition-[fill] group-hover:fill-white '}/>
127
+
128
+ <ArrowRightUp height="13px" width="13px" fill={props.arrowHoverColor && hoverIndex === index
129
+ ? props.arrowHoverColor
130
+ : props.arrowColor} className={'transition-[fill] ' +
131
+ (!props.arrowHoverColor ? 'group-hover:fill-white ' : '')}/>
113
132
  </p>
114
133
  <p className={'mt-[22px] whitespace-pre-wrap break-keep text-[20px] font-medium tracking-[-1px] text-[#5F656E] ' +
115
134
  'transition-[color] group-hover:text-white ' +
@@ -122,7 +141,7 @@ const ViewMoreSection = (props) => {
122
141
  {list.sub.replace('tel', props.tel)}
123
142
  </p>
124
143
 
125
- <SearchIcon index={index} hover fillColor={props.iconColor} className={'absolute bottom-[36px] right-[40px] aspect-square w-[74px]' +
144
+ <SearchIcon index={index} hoverColor={props.iconHoverColor} hover={hoverIndex === index} fillColor={props.iconColor} className={'absolute bottom-[36px] right-[40px] aspect-square w-[74px]' +
126
145
  //1500px
127
146
  ' max-xxl:bottom-[29px] max-xxl:right-[30px] max-xxl:w-[50px] ' +
128
147
  //타블렛
@@ -30,6 +30,7 @@ export const Default: Story = {
30
30
  tel: '0000-0000',
31
31
  inputColor: 'pink',
32
32
  keywordColor: 'green',
33
+
33
34
  moreViewList: [
34
35
  {
35
36
  title: '대륜법률 상담',
@@ -1,14 +1,13 @@
1
1
  'use client';
2
2
 
3
3
  import React, { useState } from 'react';
4
- import Image from 'next/image';
5
4
  import Wrapper from '../Layout/Wrapper';
6
5
  import Link from 'next/link';
7
6
  import ArrowRightUp from '../../asset/images/viewMoreSection/arrow.svg';
8
7
  import Search from '../../asset/images/viewMoreSection/search.svg';
9
8
  import SearchIcon from './SearchIcon';
10
9
 
11
- import { useRouter } from 'next/navigation';
10
+ import { usePathname, useRouter } from 'next/navigation';
12
11
  interface IViewMoreSectionTypes {
13
12
  title: React.ReactNode;
14
13
  keywords: string[];
@@ -20,7 +19,9 @@ interface IViewMoreSectionTypes {
20
19
  tel: string;
21
20
  inputColor: string;
22
21
  arrowColor: string;
22
+ arrowHoverColor?: string;
23
23
  iconColor: string;
24
+ iconHoverColor?: string;
24
25
  hoverColor: string;
25
26
  isGroupSearch?: boolean;
26
27
  keywordColor?: string;
@@ -31,7 +32,8 @@ interface IViewMoreSectionTypes {
31
32
  const ViewMoreSection = (props: IViewMoreSectionTypes) => {
32
33
  const router = useRouter();
33
34
  const [search, setSearch] = useState<string>('');
34
-
35
+ const pathname = usePathname();
36
+ const [hoverIndex, setHoverIndex] = useState<number>(-1);
35
37
  const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
36
38
  setSearch(event.target.value);
37
39
  };
@@ -61,20 +63,37 @@ const ViewMoreSection = (props: IViewMoreSectionTypes) => {
61
63
  style={{ backgroundColor: props.bgColor ? props.bgColor : '#f0f0f0' }}
62
64
  ></div>
63
65
  <Wrapper>
64
- <p
65
- className={
66
- 'break-keep text-center text-[56px] font-[800] tracking-[-1.4px] ' +
67
- 'max-[1440px]:text-[52px] ' +
68
- 'max-lg:text-[48px] ' +
69
- 'max-md2:text-[44px] ' +
70
- 'max-md:text-[36px] ' +
71
- 'max-sm:text-[32px] ' +
72
- 'max-xs:text-[30px] ' +
73
- 'max-2xs:text-[28px] '
74
- }
75
- >
76
- {props.title}
77
- </p>
66
+ {pathname !== '/' ? (
67
+ <p
68
+ className={
69
+ 'break-keep text-center text-[56px] font-[800] tracking-[-1.4px] ' +
70
+ 'max-[1440px]:text-[52px] ' +
71
+ 'max-lg:text-[48px] ' +
72
+ 'max-md2:text-[44px] ' +
73
+ 'max-md:text-[36px] ' +
74
+ 'max-sm:text-[32px] ' +
75
+ 'max-xs:text-[30px] ' +
76
+ 'max-2xs:text-[28px] '
77
+ }
78
+ >
79
+ {props.title}
80
+ </p>
81
+ ) : (
82
+ <h2
83
+ className={
84
+ 'break-keep text-center text-[56px] font-[800] tracking-[-1.4px] ' +
85
+ 'max-[1440px]:text-[52px] ' +
86
+ 'max-lg:text-[48px] ' +
87
+ 'max-md2:text-[44px] ' +
88
+ 'max-md:text-[36px] ' +
89
+ 'max-sm:text-[32px] ' +
90
+ 'max-xs:text-[30px] ' +
91
+ 'max-2xs:text-[28px] '
92
+ }
93
+ >
94
+ {props.title}
95
+ </h2>
96
+ )}
78
97
 
79
98
  {/*인풋*/}
80
99
  <div className={'flex flex-col '}>
@@ -176,6 +195,12 @@ const ViewMoreSection = (props: IViewMoreSectionTypes) => {
176
195
  return (
177
196
  <Link
178
197
  href={list.link}
198
+ onMouseOver={() => {
199
+ setHoverIndex(index);
200
+ }}
201
+ onMouseOut={() => {
202
+ setHoverIndex(-1);
203
+ }}
179
204
  className={
180
205
  'moreView-box group relative h-[340px] flex-1 cursor-pointer border border-solid border-[#E2E2E2] bg-white px-[39px] py-[50px] hover:text-white ' +
181
206
  ' transition-[background-color,color,border-color] ' +
@@ -200,11 +225,19 @@ const ViewMoreSection = (props: IViewMoreSectionTypes) => {
200
225
  }
201
226
  >
202
227
  {list.title}
228
+
203
229
  <ArrowRightUp
204
230
  height="13px"
205
231
  width="13px"
206
- fill={props.arrowColor}
207
- className={'transition-[fill] group-hover:fill-white '}
232
+ fill={
233
+ props.arrowHoverColor && hoverIndex === index
234
+ ? props.arrowHoverColor
235
+ : props.arrowColor
236
+ }
237
+ className={
238
+ 'transition-[fill] ' +
239
+ (!props.arrowHoverColor ? 'group-hover:fill-white ' : '')
240
+ }
208
241
  />
209
242
  </p>
210
243
  <p
@@ -224,7 +257,8 @@ const ViewMoreSection = (props: IViewMoreSectionTypes) => {
224
257
 
225
258
  <SearchIcon
226
259
  index={index}
227
- hover
260
+ hoverColor={props.iconHoverColor}
261
+ hover={hoverIndex === index}
228
262
  fillColor={props.iconColor}
229
263
  className={
230
264
  'absolute bottom-[36px] right-[40px] aspect-square w-[74px]' +
@@ -1,7 +1,6 @@
1
1
  import { IListPagesType, IListTypes, IMapTypes } from './integrateType';
2
2
  import React, { useEffect, useRef, useState } from 'react';
3
3
  import Image from 'next/image';
4
- import { useTranslation } from 'next-i18next';
5
4
  import { NoResult } from './NoResult';
6
5
  import { Title } from './Title';
7
6
  import { ViewMore } from './ViewMore';
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import Image from 'next/image';
3
- import { useTranslation } from 'next-i18next';
4
3
  export const NoResult = () => {
5
- const { t } = useTranslation('common');
6
4
  return (<section>
7
5
  <div className={'m-auto mb-72 mt-40 flex flex-col items-center font-[SUIT] max-sm:mb-40'}>
8
6
  <div className={'relative h-[80px] w-[80px] rounded-full border-[2px] border-solid border-[#3669AC]'}>
@@ -1,9 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import Image from 'next/image';
3
- import { useTranslation } from 'next-i18next';
4
3
 
5
4
  export const NoResult = () => {
6
- const { t } = useTranslation('common');
7
5
  return (
8
6
  <section>
9
7
  <div className={'m-auto mb-72 mt-40 flex flex-col items-center font-[SUIT] max-sm:mb-40'}>
@@ -6,7 +6,6 @@ import dayjs from 'dayjs';
6
6
  import { IListPagesType, IListTypes, IReplyTypes } from './integrateType';
7
7
  import { Title } from './Title';
8
8
  import { ViewMore } from './ViewMore';
9
- import { useTranslation } from 'next-i18next';
10
9
  import { searchColorText } from '../../common/integrate';
11
10
 
12
11
  const Reply = (props: {
@@ -5,7 +5,6 @@ import uuid from 'react-uuid';
5
5
  import { IListPagesType, IListTypes, ISuccessTypes } from './integrateType';
6
6
  import { Title } from './Title';
7
7
  import { ViewMore } from './ViewMore';
8
- import { useTranslation } from 'next-i18next';
9
8
  import { searchColorText } from '../../common/integrate';
10
9
 
11
10
  const Success = (props: {
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
  import React, { useState, Suspense } from 'react';
3
- // import { useTranslation } from 'next-i18next';
4
3
  import IntroWrapper from '../../_component/_layout/IntroWrapper';
5
4
  import SubMenuButton from '../../_component/_button/SubMenuButton';
6
5
  import HeaderLayout from '../../_component/_layout/HeaderLayout';
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  import React, { useEffect, useState, Suspense } from 'react';
4
- // import { useTranslation } from 'next-i18next';
5
4
  import IntroWrapper from '../../_component/_layout/IntroWrapper';
6
5
  import CaseLayout from '../../_component/_layout/CaseLayout';
7
6
  import SubMenuButton from '../../_component/_button/SubMenuButton';
@@ -1,15 +1,13 @@
1
1
  import Image from 'next/image';
2
2
  import CategoryMenu from '../_breadCrumble/CategoryMenu';
3
- // import { useTranslation } from 'next-i18next';
4
3
  import CaseWrapper from './CaseWrapper';
5
4
  import Wrapper from '../../../../Layout/Wrapper';
6
5
  const IntroWrapper = ({ backgroundImage, backgroundTbImage, backgroundMoImage, outerClassName, title, subTitle }) => {
7
- // const { t } = useTranslation('common');
8
6
  return (<div className={'absolute w-screen min-w-[360px] ' + outerClassName}>
9
7
  {backgroundImage ? (<>
10
8
  <Image unoptimized src={backgroundImage} alt="background" fill className="hidden object-cover lg:block"/>
11
- <Image unoptimized src={backgroundTbImage} alt="background" fill className="sm-top:block hidden object-cover lg:hidden"/>
12
- <Image unoptimized src={backgroundMoImage} alt="background" fill className="max-sm-top:block hidden object-cover"/>
9
+ <Image unoptimized src={backgroundTbImage} alt="background" fill className="hidden object-cover sm-top:block lg:hidden"/>
10
+ <Image unoptimized src={backgroundMoImage} alt="background" fill className="hidden object-cover max-sm-top:block"/>
13
11
  </>) : (<></>)}
14
12
 
15
13
  <Wrapper>
@@ -1,7 +1,5 @@
1
1
  import Image, { StaticImageData } from 'next/image';
2
-
3
2
  import CategoryMenu from '../_breadCrumble/CategoryMenu';
4
- // import { useTranslation } from 'next-i18next';
5
3
  import CaseWrapper from './CaseWrapper';
6
4
  import Wrapper from '../../../../Layout/Wrapper';
7
5
 
@@ -20,7 +18,6 @@ const IntroWrapper = ({
20
18
  title?: string;
21
19
  subTitle?: string;
22
20
  }) => {
23
- // const { t } = useTranslation('common');
24
21
  return (
25
22
  <div className={'absolute w-screen min-w-[360px] ' + outerClassName}>
26
23
  {backgroundImage ? (
@@ -37,14 +34,14 @@ const IntroWrapper = ({
37
34
  src={backgroundTbImage}
38
35
  alt="background"
39
36
  fill
40
- className="sm-top:block hidden object-cover lg:hidden"
37
+ className="hidden object-cover sm-top:block lg:hidden"
41
38
  />
42
39
  <Image
43
40
  unoptimized
44
41
  src={backgroundMoImage}
45
42
  alt="background"
46
43
  fill
47
- className="max-sm-top:block hidden object-cover"
44
+ className="hidden object-cover max-sm-top:block"
48
45
  />
49
46
  </>
50
47
  ) : (
@@ -6511,10 +6511,6 @@ body {
6511
6511
  background-color: rgb(245 245 245 / var(--tw-bg-opacity));
6512
6512
  }
6513
6513
 
6514
- .group:hover .group-hover\:fill-\[\#c3c3c3\] {
6515
- fill: #c3c3c3;
6516
- }
6517
-
6518
6514
  .group:hover .group-hover\:fill-white {
6519
6515
  fill: #fff;
6520
6516
  }