@daeryun/dr_components 0.7.35 → 0.7.37

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.
@@ -11,6 +11,7 @@ import { isCurrentTimeWithinPopupRange, paramFetch } from '../../lib';
11
11
  import { DateTime } from 'luxon';
12
12
  import classNames from 'classnames';
13
13
  import Link from 'next/link';
14
+ import useBrowser from '../hook/useBrowser';
14
15
 
15
16
  //배너타입
16
17
  interface IBannerTypes {
@@ -96,6 +97,7 @@ interface IBannerTypes {
96
97
  const TopBanner = () => {
97
98
  //이미지 패스
98
99
  const ImagePath: string = process.env.NEXT_PUBLIC_S3_URL + '';
100
+ const { width } = useBrowser();
99
101
 
100
102
  //팝업 리스트
101
103
  const [popup, setPopup] = useState<IBannerTypes[]>([]);
@@ -253,154 +255,168 @@ const TopBanner = () => {
253
255
  <>
254
256
  <div className={style.header_banner_wrap}>
255
257
  {/* pc */}
256
- <div className={style.header_banner}>
257
- {popup && popup.filter(item => item.file_type === 'file_pc').length > 0 ? (
258
- <Swiper
259
- autoplay={{ delay: 5000 }}
260
- modules={[Autoplay]}
261
- loop={popup.filter(item => item.file_type === 'file_pc').length > 1}
262
- >
263
- {popup.length > 0 ? (
264
- popup
265
- .filter(
266
- (item: any) =>
267
- item.file_type === 'file_pc' &&
268
- isCurrentTimeWithinPopupRange(
269
- item.days,
270
- item.startHour,
271
- item.startMin,
272
- item.endHour,
273
- item.endMin
274
- )
275
- )
276
- .map((item: IBannerTypes, index: number) => {
277
- // {popup.length > 0 ? popup.filter((item: IBannerTypes) => item.file_type === 'file_pc').map((item: IBannerTypes, index: number) => {
278
- return (
279
- <SwiperSlide key={index}>
280
- <div className={style.header_banner_btn}>
281
- <button
282
- onClick={() => {
283
- filterClose(item.idx);
284
- addCookie(item.idx);
285
- }}
286
- >
287
- 하루동안 보지않기
288
- </button>
289
- <button
290
- onClick={() => {
291
- filterClose(item.idx);
292
- }}
293
- >
294
- <Image
295
- src="/images/banner_btn.webp"
296
- alt="대륜 배너 닫기 이미지"
297
- width={42}
298
- height={42}
299
- />
300
- </button>
301
- </div>
302
- <div
303
- className={style.banner_block}
304
- style={{ background: `#${item.color_code}` }}
305
- >
306
- <Link
307
- href={item.p_link}
308
- target={item.link_type}
309
- onClick={() => {
310
- addClickCnt(item.idx);
311
- }}
312
- rel={validateUrl(item.p_link)}
258
+ {width > 900 && (
259
+ <div className={style.header_banner}>
260
+ {popup && popup.filter(item => item.file_type === 'file_pc').length > 0 ? (
261
+ <Swiper
262
+ autoplay={{ delay: 5000 }}
263
+ modules={[Autoplay]}
264
+ loop={popup.filter(item => item.file_type === 'file_pc').length > 1}
265
+ >
266
+ {popup.length > 0 ? (
267
+ popup
268
+ .filter(
269
+ (item: any) =>
270
+ item.file_type === 'file_pc' &&
271
+ isCurrentTimeWithinPopupRange(
272
+ item.days,
273
+ item.startHour,
274
+ item.startMin,
275
+ item.endHour,
276
+ item.endMin
277
+ )
278
+ )
279
+ .map((item: IBannerTypes, index: number) => {
280
+ // {popup.length > 0 ? popup.filter((item: IBannerTypes) => item.file_type === 'file_pc').map((item: IBannerTypes, index: number) => {
281
+ return (
282
+ <SwiperSlide key={index}>
283
+ <div className={style.header_banner_btn}>
284
+ <button
285
+ onClick={() => {
286
+ filterClose(item.idx);
287
+ addCookie(item.idx);
288
+ }}
289
+ >
290
+ 하루동안 보지않기
291
+ </button>
292
+ <button
293
+ onClick={() => {
294
+ filterClose(item.idx);
295
+ }}
296
+ >
297
+ <Image
298
+ src="/images/banner_btn.webp"
299
+ alt="대륜 배너 닫기 이미지"
300
+ width={42}
301
+ height={42}
302
+ />
303
+ </button>
304
+ </div>
305
+ <div
306
+ className={style.banner_block}
307
+ style={{ background: `#${item.color_code}` }}
313
308
  >
314
- <Image
315
- src={ImagePath + item.file_path + '/' + item.save_file_name}
316
- alt={item.file_alt}
317
- width={2000}
318
- height={60}
319
- priority={true}
320
- quality={100}
321
- loading={'eager'}
322
- />
323
- {/*<Image src={"/images/대표메인_팝업_PC.jpg"} alt={item.file_alt} width={1920} height={50} priority={true} />*/}
324
- </Link>
325
- </div>
326
- </SwiperSlide>
327
- );
328
- })
329
- ) : (
330
- <></>
331
- )}
332
- </Swiper>
333
- ) : (
334
- <></>
335
- )}
336
- </div>
309
+ <Link
310
+ href={item.p_link}
311
+ target={item.link_type}
312
+ onClick={() => {
313
+ addClickCnt(item.idx);
314
+ }}
315
+ rel={validateUrl(item.p_link)}
316
+ >
317
+ <Image
318
+ src={
319
+ ImagePath +
320
+ item.file_path +
321
+ '/' +
322
+ item.save_file_name
323
+ }
324
+ alt={item.file_alt}
325
+ width={2000}
326
+ height={60}
327
+ priority={true}
328
+ quality={100}
329
+ loading={'eager'}
330
+ />
331
+ {/*<Image src={"/images/대표메인_팝업_PC.jpg"} alt={item.file_alt} width={1920} height={50} priority={true} />*/}
332
+ </Link>
333
+ </div>
334
+ </SwiperSlide>
335
+ );
336
+ })
337
+ ) : (
338
+ <></>
339
+ )}
340
+ </Swiper>
341
+ ) : (
342
+ <></>
343
+ )}
344
+ </div>
345
+ )}
337
346
 
338
347
  {/* mobile */}
339
- <div
340
- className={classNames({
341
- [style.header_banner_m]: true
342
- })}
343
- >
344
- {popup && popup.filter(item => item.file_type === 'file_mobile').length > 0 ? (
345
- <Swiper
346
- autoplay={{ delay: 5000 }}
347
- modules={[Autoplay]}
348
- loop={popup.filter((item: IBannerTypes) => item.file_type === 'file_mobile').length > 1}
349
- >
350
- {popup.length > 0 ? (
351
- popup
352
- .filter((item: IBannerTypes) => item.file_type === 'file_mobile')
353
- .map((item: IBannerTypes, index: number) => {
354
- return (
355
- <SwiperSlide key={index}>
356
- <div className={style.header_banner_m_btn}>
357
- <button
358
- onClick={() => {
359
- filterClose(item.idx);
360
- addCookie(item.idx);
361
- }}
362
- >
363
- 하루동안 보지않기
364
- </button>
365
- <button
366
- onClick={() => {
367
- filterClose(item.idx);
368
- }}
369
- >
370
- 닫기
371
- </button>
372
- </div>
373
- <div className={style.banner_block_m}>
374
- <Link
375
- href={item.p_link}
376
- target={item.link_type}
377
- rel={validateUrl(item.p_link)}
378
- >
379
- <Image
380
- src={ImagePath + item.file_path + '/' + item.save_file_name}
381
- alt={item.file_alt}
382
- width={900}
383
- height={150}
384
- priority={true}
348
+ {width <= 900 && (
349
+ <div
350
+ className={classNames({
351
+ [style.header_banner_m]: true
352
+ })}
353
+ >
354
+ {popup && popup.filter(item => item.file_type === 'file_mobile').length > 0 ? (
355
+ <Swiper
356
+ autoplay={{ delay: 5000 }}
357
+ modules={[Autoplay]}
358
+ loop={popup.filter((item: IBannerTypes) => item.file_type === 'file_mobile').length > 1}
359
+ >
360
+ {popup.length > 0 ? (
361
+ popup
362
+ .filter((item: IBannerTypes) => item.file_type === 'file_mobile')
363
+ .map((item: IBannerTypes, index: number) => {
364
+ return (
365
+ <SwiperSlide key={index}>
366
+ <div className={style.header_banner_m_btn}>
367
+ <button
385
368
  onClick={() => {
386
- addClickCnt(item.idx);
369
+ filterClose(item.idx);
370
+ addCookie(item.idx);
371
+ }}
372
+ >
373
+ 하루동안 보지않기
374
+ </button>
375
+ <button
376
+ onClick={() => {
377
+ filterClose(item.idx);
387
378
  }}
388
- quality={100}
389
- />
390
- {/*<Image src={"/images/대표메인_팝업_900.jpg"} alt={item.file_alt} width={900} height={70} priority={true} />*/}
391
- </Link>
392
- </div>
393
- </SwiperSlide>
394
- );
395
- })
396
- ) : (
397
- <></>
398
- )}
399
- </Swiper>
400
- ) : (
401
- <></>
402
- )}
403
- </div>
379
+ >
380
+ 닫기
381
+ </button>
382
+ </div>
383
+ <div className={style.banner_block_m}>
384
+ <Link
385
+ href={item.p_link}
386
+ target={item.link_type}
387
+ rel={validateUrl(item.p_link)}
388
+ >
389
+ <Image
390
+ src={
391
+ ImagePath +
392
+ item.file_path +
393
+ '/' +
394
+ item.save_file_name
395
+ }
396
+ alt={item.file_alt}
397
+ width={900}
398
+ height={150}
399
+ priority={true}
400
+ onClick={() => {
401
+ addClickCnt(item.idx);
402
+ }}
403
+ quality={100}
404
+ />
405
+ {/*<Image src={"/images/대표메인_팝업_900.jpg"} alt={item.file_alt} width={900} height={70} priority={true} />*/}
406
+ </Link>
407
+ </div>
408
+ </SwiperSlide>
409
+ );
410
+ })
411
+ ) : (
412
+ <></>
413
+ )}
414
+ </Swiper>
415
+ ) : (
416
+ <></>
417
+ )}
418
+ </div>
419
+ )}
404
420
  </div>
405
421
  </>
406
422
  );
@@ -25,10 +25,10 @@ export const newNapAreaMobile = {
25
25
  ],
26
26
  '인천·부천': [
27
27
  { name: 'Songdo', desc: '인천본부', url: 'map_incheonbon.webp', src: 'incheonbon' },
28
- { name: 'Incheon', desc: '인천', url: 'map_incheon.webp', src: 'incheon' },
29
28
  { name: 'Bucheon', desc: '부천', url: 'map_bucheon.webp', src: 'bucheon' },
30
29
  { name: '', desc: '', url: '', src: '' },
31
30
  { name: '', desc: '', url: '', src: '' },
31
+ { name: '', desc: '', url: '', src: '' },
32
32
  { name: '', desc: '', url: '', src: '' }
33
33
  ],
34
34
  경기남부: [
@@ -1990,7 +1990,7 @@ export const newNapArea = {
1990
1990
  '인천·부천': [
1991
1991
  { name: '', desc: '', url: '', src: '' },
1992
1992
  { name: 'Songdo', desc: '인천본부', url: 'map_incheonbon.webp', src: 'incheonbon' },
1993
- { name: 'Incheon', desc: '인천', url: 'map_incheon.webp', src: 'incheon' },
1993
+ { name: '', desc: '', url: '', src: '' },
1994
1994
  { name: '', desc: '', url: '', src: '' },
1995
1995
  { name: '', desc: '', url: '', src: '' },
1996
1996
  { name: '', desc: '', url: '', src: '' },
@@ -28,10 +28,10 @@ export const newNapAreaMobile: IMapArea = {
28
28
  ],
29
29
  '인천·부천': [
30
30
  { name: 'Songdo', desc: '인천본부', url: 'map_incheonbon.webp', src: 'incheonbon' },
31
- { name: 'Incheon', desc: '인천', url: 'map_incheon.webp', src: 'incheon' },
32
31
  { name: 'Bucheon', desc: '부천', url: 'map_bucheon.webp', src: 'bucheon' },
33
32
  { name: '', desc: '', url: '', src: '' },
34
33
  { name: '', desc: '', url: '', src: '' },
34
+ { name: '', desc: '', url: '', src: '' },
35
35
  { name: '', desc: '', url: '', src: '' }
36
36
  ],
37
37
  경기남부: [
@@ -1997,7 +1997,7 @@ export const newNapArea: IMapArea = {
1997
1997
  '인천·부천': [
1998
1998
  { name: '', desc: '', url: '', src: '' },
1999
1999
  { name: 'Songdo', desc: '인천본부', url: 'map_incheonbon.webp', src: 'incheonbon' },
2000
- { name: 'Incheon', desc: '인천', url: 'map_incheon.webp', src: 'incheon' },
2000
+ { name: '', desc: '', url: '', src: '' },
2001
2001
  { name: '', desc: '', url: '', src: '' },
2002
2002
  { name: '', desc: '', url: '', src: '' },
2003
2003
  { name: '', desc: '', url: '', src: '' },