@daeryun/dr_components 0.5.22 → 0.5.23
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/ViewMoreSection/SearchIcon.d.ts +2 -1
- package/dist/components/ViewMoreSection/SearchIcon.jsx +6 -3
- package/dist/components/ViewMoreSection/SearchIcon.tsx +18 -14
- package/dist/components/ViewMoreSection/ViewMoreSection.d.ts +2 -0
- package/dist/components/ViewMoreSection/ViewMoreSection.jsx +33 -14
- package/dist/components/ViewMoreSection/ViewMoreSection.stories.tsx +1 -0
- package/dist/components/ViewMoreSection/ViewMoreSection.tsx +54 -20
- package/dist/styles/globals.css +0 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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}
|
|
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
|
-
|
|
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
|
//타블렛
|
|
@@ -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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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={
|
|
207
|
-
|
|
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
|
-
|
|
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]' +
|
package/dist/styles/globals.css
CHANGED