@daeryun/dr_components 1.0.39 → 1.0.41

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.
@@ -2,10 +2,11 @@ import Link from 'next/link';
2
2
  import React from 'react';
3
3
  import Image from 'next/image';
4
4
  import { usePathname, useRouter } from 'next/navigation';
5
- import { IViewMoreListTypes } from '../../../../common/types/strength_new';
5
+ import { IViewMoreListTypes } from '../../../../common';
6
6
  import { IInitialDataTypes } from '../../../../common';
7
7
  import Wrapper from '../../../../Layout/Wrapper';
8
8
  import { replaceInitialData } from '../../../../../lib';
9
+ import useBrowser from '../../../../hook/useBrowser';
9
10
 
10
11
  const ViewMoreSection = ({
11
12
  view_more_section_title,
@@ -18,6 +19,8 @@ const ViewMoreSection = ({
18
19
  }) => {
19
20
  const pathname = usePathname();
20
21
  const isMain = pathname === '/strength';
22
+ const { width } = useBrowser(false); // 디바운스 적용
23
+ const isPC = width >= 1280;
21
24
 
22
25
  return (
23
26
  <section
@@ -40,16 +43,19 @@ const ViewMoreSection = ({
40
43
  >
41
44
  {view_more_section_title}
42
45
  </h2>
43
- <div className={(isMain ? 'grid-cols-4' : 'grid-cols-3 ') + ' mt-10 grid gap-5 max-xl:hidden'}>
44
- {view_more_list.map((item, index) => {
45
- return <ViewMorePCItem key={index} item={item} index={index} initialData={initialData} />;
46
- })}
47
- </div>
48
- <div className={'mt-[20px] grid max-xl:grid-cols-1 max-[700px]:mt-0 xl:hidden'}>
49
- {view_more_list.map((item, index) => {
50
- return <ViewMoreTabItem key={index} item={item} index={index} initialData={initialData} />;
51
- })}
52
- </div>
46
+ {isPC ? (
47
+ <div className={(isMain ? 'grid-cols-4' : 'grid-cols-3 ') + ' mt-10 grid gap-5'}>
48
+ {view_more_list.map((item, index) => (
49
+ <ViewMorePCItem key={index} item={item} index={index} initialData={initialData} />
50
+ ))}
51
+ </div>
52
+ ) : (
53
+ <div className={'mt-[20px] grid max-xl:grid-cols-1 max-[700px]:mt-0'}>
54
+ {view_more_list.map((item, index) => (
55
+ <ViewMoreTabItem key={index} item={item} index={index} initialData={initialData} />
56
+ ))}
57
+ </div>
58
+ )}
53
59
  </Wrapper>
54
60
  </section>
55
61
  );
@@ -142,14 +148,25 @@ const ViewMorePCItem = ({
142
148
  />
143
149
  </div>
144
150
  </span>
145
-
146
- <h3
147
- className={
148
- 'mt-10 text-[32px] font-[800] leading-none transition-colors duration-500 max-3xl:mt-8 max-3xl:text-[30px]'
149
- }
150
- >
151
- {item.title}
152
- </h3>
151
+ {hidden ? (
152
+ <p
153
+ className={
154
+ 'mt-10 text-[32px] font-[800] leading-none transition-colors duration-500 ' +
155
+ 'max-3xl:mt-8 max-3xl:text-[30px]'
156
+ }
157
+ >
158
+ {item.title}
159
+ </p>
160
+ ) : (
161
+ <h3
162
+ className={
163
+ 'mt-10 text-[32px] font-[800] leading-none transition-colors duration-500 ' +
164
+ 'max-3xl:mt-8 max-3xl:text-[30px]'
165
+ }
166
+ >
167
+ {item.title}
168
+ </h3>
169
+ )}
153
170
  <p
154
171
  className={
155
172
  'mt-6 line-clamp-2 min-h-[62px] text-[24px] font-[600] leading-[1.3] max-3xl:mt-4 max-3xl:text-[22px]'
@@ -267,12 +284,21 @@ const ViewMoreTabItem = ({
267
284
  </div>
268
285
  <div className={'flex flex-col gap-4 max-[700px]:gap-[10px]'}>
269
286
  <div className={'flex justify-between'}>
270
- <h3
271
- className={'text-[24px] font-[800] leading-none max-md:text-[22px] max-[700px]:text-[20px]'}
272
- style={{ color: item.color }}
273
- >
274
- {item.title}
275
- </h3>
287
+ {hidden ? (
288
+ <p
289
+ className={'text-[24px] font-[800] leading-none max-md:text-[22px] max-[700px]:text-[20px]'}
290
+ style={{ color: item.color }}
291
+ >
292
+ {item.title}
293
+ </p>
294
+ ) : (
295
+ <h3
296
+ className={'text-[24px] font-[800] leading-none max-md:text-[22px] max-[700px]:text-[20px]'}
297
+ style={{ color: item.color }}
298
+ >
299
+ {item.title}
300
+ </h3>
301
+ )}
276
302
  <div className={'mt-auto flex justify-end'}>
277
303
  <span className={'flex items-center gap-[10px] text-[16px] leading-[1] '}>
278
304
  {item.view_more_text}
@@ -19034,10 +19034,6 @@ body {
19034
19034
  display: none;
19035
19035
  }
19036
19036
 
19037
- .lg\:h-\[100px\] {
19038
- height: 100px;
19039
- }
19040
-
19041
19037
  .lg\:h-\[12px\] {
19042
19038
  height: 12px;
19043
19039
  }
@@ -19174,10 +19170,6 @@ body {
19174
19170
  width: 100%;
19175
19171
  }
19176
19172
 
19177
- .lg\:w-\[100px\] {
19178
- width: 100px;
19179
- }
19180
-
19181
19173
  .lg\:w-\[10px\] {
19182
19174
  width: 10px;
19183
19175
  }