@daeryun/dr_components 1.1.25 → 1.1.27

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.
Files changed (29) hide show
  1. package/dist/asset/images/board/calendar.webp +0 -0
  2. package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.js +1 -1
  3. package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.ts +1 -1
  4. package/dist/components/Header/PcHeader.d.ts +2 -1
  5. package/dist/components/Header/PcHeader.jsx +2 -1
  6. package/dist/components/Header/PcHeader.tsx +4 -1
  7. package/dist/components/index.js +1 -0
  8. package/dist/components/index.ts +1 -0
  9. package/dist/components/page/Broadcast/BroadcastDetail.d.ts +30 -0
  10. package/dist/components/page/Broadcast/BroadcastDetail.jsx +114 -0
  11. package/dist/components/page/Broadcast/BroadcastDetail.stories.d.ts +6 -0
  12. package/dist/components/page/Broadcast/BroadcastDetail.stories.jsx +40 -0
  13. package/dist/components/page/Broadcast/BroadcastDetail.stories.tsx +50 -0
  14. package/dist/components/page/Broadcast/BroadcastDetail.tsx +240 -0
  15. package/dist/components/page/Broadcast/BroadcastList.d.ts +17 -0
  16. package/dist/components/page/Broadcast/BroadcastList.jsx +91 -0
  17. package/dist/components/page/Broadcast/BroadcastList.stories.d.ts +6 -0
  18. package/dist/components/page/Broadcast/BroadcastList.stories.jsx +105 -0
  19. package/dist/components/page/Broadcast/BroadcastList.stories.tsx +123 -0
  20. package/dist/components/page/Broadcast/BroadcastList.tsx +187 -0
  21. package/dist/components/page/index.d.ts +2 -0
  22. package/dist/components/page/index.js +2 -0
  23. package/dist/components/page/index.ts +2 -0
  24. package/dist/components/postNavigation/PostNavigation.d.ts +23 -0
  25. package/dist/components/postNavigation/PostNavigation.jsx +31 -0
  26. package/dist/components/postNavigation/PostNavigation.tsx +94 -0
  27. package/dist/styles/globals.css +213 -0
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +1 -1
@@ -0,0 +1,187 @@
1
+ 'use client';
2
+ import PageWrapper from '../../Layout/PageWrapper';
3
+ import SearchBar from '../../SearchBar/SearchBar';
4
+ import { useRouter } from 'next/navigation';
5
+ import { useEffect, useState } from 'react';
6
+ import Link from 'next/link';
7
+ import Image from 'next/image';
8
+ import { htmlTagRemove } from '../../../lib';
9
+ import PaginationComponent from '../MyCase/_component/_pagination/PaginationComponent';
10
+
11
+ interface BroadCastData {
12
+ id: number;
13
+ title: string;
14
+ broadcast: string;
15
+ timestamp: string;
16
+ img: string;
17
+ summary: string;
18
+ alt: string;
19
+ }
20
+
21
+ const BroadcastList = ({
22
+ search,
23
+ page,
24
+ count,
25
+ size,
26
+ broadcastList
27
+ }: {
28
+ search: string;
29
+ page: number;
30
+ count: number;
31
+ size: number;
32
+ broadcastList: BroadCastData[];
33
+ }) => {
34
+ const router = useRouter();
35
+ const [searchInput, setSearchInput] = useState<string>('');
36
+
37
+ // const imagePath: string = process.env.NEXT_PUBLIC_S3_URL + ''
38
+ const imagePath: string = 'https://d1tgonli21s4df.cloudfront.net';
39
+
40
+ const handleInputChange = (e: React.FormEvent<HTMLInputElement>) => {
41
+ setSearchInput(e.currentTarget.value);
42
+ };
43
+
44
+ useEffect(() => {
45
+ setSearchInput(search);
46
+ }, [router]);
47
+
48
+ const onChange = (pageNum: number) => {
49
+ router.push(`/broadcast?page=${pageNum}${search !== '' ? '&search=' + search : ''}`);
50
+ };
51
+
52
+ // 검색창이벤트
53
+ const handleClick = () => {
54
+ router.push(`/broadcast?page=1&search=${searchInput}`);
55
+ };
56
+
57
+ return (
58
+ <PageWrapper>
59
+ <SearchBar
60
+ label={'언론보도 검색창'}
61
+ onChange={handleInputChange}
62
+ onClick={handleClick}
63
+ search={searchInput}
64
+ placeholder={'검색어를 입력해주세요.'}
65
+ isKeyPress={true}
66
+ marginTop={[70, 50, 50]}
67
+ />
68
+ <div className={'flex items-center justify-center border-t-[3px] border-solid border-[#252225]'}>
69
+ {broadcastList.length > 0 && broadcastList.length > 0 ? (
70
+ <div className={'flex w-full flex-col lg:flex-row lg:flex-wrap lg:justify-between lg:gap-2 '}>
71
+ {broadcastList.map(item => {
72
+ return (
73
+ <div
74
+ key={item.id}
75
+ className={' basis-[49%] lg:flex lg:flex-row lg:flex-wrap lg:justify-between'}
76
+ >
77
+ <Link
78
+ href={`/broadcast/${item.id}`}
79
+ className={
80
+ 'mb-10 mt-8 flex flex-col items-center justify-center bg-[#FAFAFA] p-[1em] lg:hidden'
81
+ }
82
+ >
83
+ <div className={'mb-4 flex w-[100%] flex-row items-center justify-start gap-4'}>
84
+ <div className={'text-[18px] font-medium text-[#9A6A1B]'}>
85
+ {item.broadcast}
86
+ </div>
87
+ <div
88
+ className={
89
+ 'text-[13px] text-[#6e6e6e] xs:text-[13px] sm:text-[14px] lg:text-[16px]'
90
+ }
91
+ >
92
+ {item.timestamp}
93
+ </div>
94
+ </div>
95
+
96
+ <div className={'flex w-[95%] items-center justify-center'}>
97
+ <Image
98
+ src={imagePath + item.img}
99
+ alt={item.alt}
100
+ className={''}
101
+ width={400}
102
+ height={508}
103
+ />
104
+ </div>
105
+ <div
106
+ className={
107
+ 'my-4 w-[95%] break-keep text-left text-[18px] font-[800] xs:my-10 sm:my-12'
108
+ }
109
+ >
110
+ {item.title}
111
+ </div>
112
+ <div
113
+ className={
114
+ 'mb-6 line-clamp-4 w-[95%] overflow-hidden text-ellipsis text-[#666666]'
115
+ }
116
+ >
117
+ {htmlTagRemove(item.summary)}
118
+ </div>
119
+ </Link>
120
+
121
+ {/*웹환경*/}
122
+ <Link
123
+ href={{
124
+ pathname: '/broadcast/' + item.id
125
+ }}
126
+ className={
127
+ 'mb-10 mt-8 hidden w-full items-center justify-center bg-[#FAFAFA] px-[1em] py-[2em] lg:flex lg:flex-col '
128
+ }
129
+ key={item.id}
130
+ >
131
+ <div className={'mb-4 flex w-[100%] flex-row items-center justify-start gap-4'}>
132
+ <div className={'text-[12px] font-medium text-[#023059] lg:text-[19px]'}>
133
+ {item.broadcast}
134
+ </div>
135
+ <div className={'text-[10px] text-[#6e6e6e] lg:text-[16px]'}>
136
+ {item.timestamp}
137
+ </div>
138
+ </div>
139
+ <div className={'flex w-full flex-row gap-3'}>
140
+ <div className={'flex h-full w-[40%] flex-1 items-center justify-center '}>
141
+ <span
142
+ className={
143
+ 'relative flex h-[306px] w-[95%] items-center justify-center overflow-hidden '
144
+ }
145
+ >
146
+ <Image
147
+ src={imagePath + item.img}
148
+ alt={item.alt}
149
+ className="h-full w-full object-cover"
150
+ fill
151
+ sizes={'306px'}
152
+ />
153
+ </span>
154
+ </div>
155
+ <div className={'flex w-[60%] flex-col items-center justify-center'}>
156
+ <div
157
+ className={
158
+ 'w-[95%] break-keep text-left font-[800] lg:text-[18px] xl:text-[20px] xxl:text-[23px] '
159
+ }
160
+ >
161
+ {item.title}
162
+ </div>
163
+ <div
164
+ className={
165
+ 'line-clamp-4 w-[90%] overflow-hidden text-ellipsis py-5 text-[#666666] lg:text-[12px] xl:text-[15px]'
166
+ }
167
+ >
168
+ {htmlTagRemove(item.summary)}
169
+ </div>
170
+ <div className={'mb-2 mt-4'}></div>
171
+ </div>
172
+ </div>
173
+ </Link>
174
+ </div>
175
+ );
176
+ })}
177
+ </div>
178
+ ) : (
179
+ <div className={'h-[300px] text-center text-[20px] leading-[300px]'}>정보 조회 중입니다.</div>
180
+ )}
181
+ </div>
182
+ <PaginationComponent onChange={onChange} current={page} total={count} pageSize={size} />
183
+ </PageWrapper>
184
+ );
185
+ };
186
+
187
+ export default BroadcastList;
@@ -24,3 +24,5 @@ export { default as StrengthPeople } from './StrengthNew/StrengthPeople';
24
24
  export { default as StrengthSystem } from './StrengthNew/StrengthSystem';
25
25
  export { default as DaeryunGreeting } from './DaeryunGreeting/DaeryunGreeting';
26
26
  export { default as MapPage } from './MapPage/MapPage';
27
+ export { default as BroadcastList } from './Broadcast/BroadcastList';
28
+ export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
@@ -26,3 +26,5 @@ export { default as StrengthPeople } from './StrengthNew/StrengthPeople';
26
26
  export { default as StrengthSystem } from './StrengthNew/StrengthSystem';
27
27
  export { default as DaeryunGreeting } from './DaeryunGreeting/DaeryunGreeting';
28
28
  export { default as MapPage } from './MapPage/MapPage';
29
+ export { default as BroadcastList } from './Broadcast/BroadcastList';
30
+ export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
@@ -26,3 +26,5 @@ export { default as StrengthPeople } from './StrengthNew/StrengthPeople';
26
26
  export { default as StrengthSystem } from './StrengthNew/StrengthSystem';
27
27
  export { default as DaeryunGreeting } from './DaeryunGreeting/DaeryunGreeting';
28
28
  export { default as MapPage } from './MapPage/MapPage';
29
+ export { default as BroadcastList } from './Broadcast/BroadcastList';
30
+ export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ interface IPostNav {
3
+ created_at?: string;
4
+ idx?: number;
5
+ is_template?: boolean;
6
+ keyword?: string;
7
+ next_idx: number;
8
+ next_template?: boolean;
9
+ next_title: string;
10
+ pre_idx: number;
11
+ pre_template?: boolean;
12
+ pre_title: string;
13
+ }
14
+ interface PostNavigationProps {
15
+ url: string;
16
+ postNav: IPostNav;
17
+ preTxt: string;
18
+ nextTxt: string;
19
+ listTxt: string;
20
+ queryStr?: string;
21
+ }
22
+ declare const PostNavigation: ({ url, postNav, preTxt, nextTxt, listTxt, queryStr }: PostNavigationProps) => React.JSX.Element;
23
+ export default PostNavigation;
@@ -0,0 +1,31 @@
1
+ import Image from 'next/image';
2
+ import Link from 'next/link';
3
+ import React from 'react';
4
+ const PostNavigation = ({ url, postNav, preTxt, nextTxt, listTxt, queryStr = '' }) => {
5
+ return (<div className={'flex w-full items-center justify-between max-md:flex-col'}>
6
+ {postNav.pre_idx ? (<Link href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.pre_idx} className={'mb-6 flex w-full flex-col gap-[8px] md:mb-0 md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'} aria-label={'이전글 ' + postNav.pre_title}>
7
+ <Image src={'/images/youtube/left.webp'} alt={''} width={15} height={15} className={'m-auto hidden md:block'}/>
8
+ <p className={'text-[#285FA7]'}>{preTxt}</p>
9
+ <div>
10
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.pre_title}</p>
11
+ </div>
12
+ </Link>) : (<div className={'flex w-[30%] gap-[28px]'}></div>)}
13
+
14
+ {postNav.next_idx ? (<>
15
+ <Link href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.next_idx} className={'flex w-full flex-col justify-end gap-[8px] md:order-last md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'} aria-label={'다음글 ' + postNav.next_title}>
16
+ <p className={'text-[#285FA7]'}>{nextTxt}</p>
17
+ <div aria-label={'다음글 ' + postNav.next_title}>
18
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.next_title}</p>
19
+ </div>
20
+ <Image src={'/images/youtube/right.webp'} alt={''} width={15} height={15} className={'m-auto hidden md:block'}/>
21
+ </Link>
22
+ </>) : (<div className={'order-last flex w-[30%] gap-[28px]'}></div>)}
23
+
24
+ <Link href={`${url}${queryStr}`} className={'max-md:mt-[40px]'}>
25
+ <div className={'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[32px] py-[10px] text-[#fff] lg2:px-[70px] lg2:py-[15px] '}>
26
+ {listTxt}
27
+ </div>
28
+ </Link>
29
+ </div>);
30
+ };
31
+ export default PostNavigation;
@@ -0,0 +1,94 @@
1
+ import Image from 'next/image';
2
+ import Link from 'next/link';
3
+ import React from 'react';
4
+
5
+ interface IPostNav {
6
+ created_at?: string;
7
+ idx?: number;
8
+ is_template?: boolean;
9
+ keyword?: string;
10
+
11
+ next_idx: number;
12
+ next_template?: boolean;
13
+ next_title: string;
14
+
15
+ pre_idx: number;
16
+ pre_template?: boolean;
17
+ pre_title: string;
18
+ }
19
+
20
+ interface PostNavigationProps {
21
+ url: string; // 페이지 url (리스트페이지 : url, 상세페이지 : url/next_id ...)
22
+ postNav: IPostNav; // 페이지 정보
23
+ preTxt: string; // 이전글 텍스트 (다국어)
24
+ nextTxt: string; // 다음글 텍스트 (다국어)
25
+ listTxt: string; // 목록보기 텍스트 (다국어)
26
+ queryStr?: string; // 목록 이동 시 추가할 쿼리 텍스트
27
+ }
28
+
29
+ const PostNavigation = ({ url, postNav, preTxt, nextTxt, listTxt, queryStr = '' }: PostNavigationProps) => {
30
+ return (
31
+ <div className={'flex w-full items-center justify-between max-md:flex-col'}>
32
+ {postNav.pre_idx ? (
33
+ <Link
34
+ href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.pre_idx}
35
+ className={
36
+ 'mb-6 flex w-full flex-col gap-[8px] md:mb-0 md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'
37
+ }
38
+ aria-label={'이전글 ' + postNav.pre_title}
39
+ >
40
+ <Image
41
+ src={'/images/youtube/left.webp'}
42
+ alt={''}
43
+ width={15}
44
+ height={15}
45
+ className={'m-auto hidden md:block'}
46
+ />
47
+ <p className={'text-[#285FA7]'}>{preTxt}</p>
48
+ <div>
49
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.pre_title}</p>
50
+ </div>
51
+ </Link>
52
+ ) : (
53
+ <div className={'flex w-[30%] gap-[28px]'}></div>
54
+ )}
55
+
56
+ {postNav.next_idx ? (
57
+ <>
58
+ <Link
59
+ href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.next_idx}
60
+ className={
61
+ 'flex w-full flex-col justify-end gap-[8px] md:order-last md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'
62
+ }
63
+ aria-label={'다음글 ' + postNav.next_title}
64
+ >
65
+ <p className={'text-[#285FA7]'}>{nextTxt}</p>
66
+ <div aria-label={'다음글 ' + postNav.next_title}>
67
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.next_title}</p>
68
+ </div>
69
+ <Image
70
+ src={'/images/youtube/right.webp'}
71
+ alt={''}
72
+ width={15}
73
+ height={15}
74
+ className={'m-auto hidden md:block'}
75
+ />
76
+ </Link>
77
+ </>
78
+ ) : (
79
+ <div className={'order-last flex w-[30%] gap-[28px]'}></div>
80
+ )}
81
+
82
+ <Link href={`${url}${queryStr}`} className={'max-md:mt-[40px]'}>
83
+ <div
84
+ className={
85
+ 'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[32px] py-[10px] text-[#fff] lg2:px-[70px] lg2:py-[15px] '
86
+ }
87
+ >
88
+ {listTxt}
89
+ </div>
90
+ </Link>
91
+ </div>
92
+ );
93
+ };
94
+ export default PostNavigation;