Showing
5 changed files
with
7 additions
and
15 deletions
... | @@ -15,7 +15,8 @@ | ... | @@ -15,7 +15,8 @@ |
15 | "react/jsx-fragments": 0, | 15 | "react/jsx-fragments": 0, |
16 | "react/prop-types": 0, | 16 | "react/prop-types": 0, |
17 | "import/prefer-default-export": 0, | 17 | "import/prefer-default-export": 0, |
18 | - "no-param-reassign": 0 | 18 | + "no-param-reassign": 0, |
19 | + "arrow-body-style": 0, | ||
19 | }, | 20 | }, |
20 | "settings": { | 21 | "settings": { |
21 | "react": { | 22 | "react": { | ... | ... |
... | @@ -2,9 +2,8 @@ import React from 'react'; | ... | @@ -2,9 +2,8 @@ import React from 'react'; |
2 | import Document from './document'; | 2 | import Document from './document'; |
3 | 3 | ||
4 | const Documents = ({ datas }) => { | 4 | const Documents = ({ datas }) => { |
5 | - console.log(datas); | ||
6 | return ( | 5 | return ( |
7 | - <> | 6 | + <div> |
8 | {datas.map(data => { | 7 | {datas.map(data => { |
9 | const { | 8 | const { |
10 | content, | 9 | content, |
... | @@ -14,7 +13,6 @@ const Documents = ({ datas }) => { | ... | @@ -14,7 +13,6 @@ const Documents = ({ datas }) => { |
14 | writer, | 13 | writer, |
15 | images, | 14 | images, |
16 | } = data; | 15 | } = data; |
17 | - console.log(data); | ||
18 | return ( | 16 | return ( |
19 | <Document | 17 | <Document |
20 | content={content.raw} | 18 | content={content.raw} |
... | @@ -26,7 +24,7 @@ const Documents = ({ datas }) => { | ... | @@ -26,7 +24,7 @@ const Documents = ({ datas }) => { |
26 | /> | 24 | /> |
27 | ); | 25 | ); |
28 | })} | 26 | })} |
29 | - </> | 27 | + </div> |
30 | ); | 28 | ); |
31 | }; | 29 | }; |
32 | 30 | ... | ... |
... | @@ -15,6 +15,7 @@ const ImageWrapper = styled.div` | ... | @@ -15,6 +15,7 @@ const ImageWrapper = styled.div` |
15 | `; | 15 | `; |
16 | const Thumbnails = ({ srcs }) => { | 16 | const Thumbnails = ({ srcs }) => { |
17 | const [lists, setLists] = useState([]); | 17 | const [lists, setLists] = useState([]); |
18 | + console.log(srcs); | ||
18 | const placeholder = () => { | 19 | const placeholder = () => { |
19 | if (srcs.length < 4) { | 20 | if (srcs.length < 4) { |
20 | const list = []; | 21 | const list = []; |
... | @@ -31,7 +32,7 @@ const Thumbnails = ({ srcs }) => { | ... | @@ -31,7 +32,7 @@ const Thumbnails = ({ srcs }) => { |
31 | }; | 32 | }; |
32 | useEffect(() => { | 33 | useEffect(() => { |
33 | placeholder(); | 34 | placeholder(); |
34 | - }, []); | 35 | + }, [srcs]); |
35 | return ( | 36 | return ( |
36 | <> | 37 | <> |
37 | <Text style={{ marginTop: '1rem' }} size="lg" weight={500}> | 38 | <Text style={{ marginTop: '1rem' }} size="lg" weight={500}> | ... | ... |
... | @@ -13,7 +13,6 @@ const Document = ({ | ... | @@ -13,7 +13,6 @@ const Document = ({ |
13 | images, | 13 | images, |
14 | }) => { | 14 | }) => { |
15 | const srcs = images.map(image => JSON.parse(image).image_path); | 15 | const srcs = images.map(image => JSON.parse(image).image_path); |
16 | - console.log(content); | ||
17 | const limit = 250; | 16 | const limit = 250; |
18 | const toggleEllipsis = (str, _limit) => ({ | 17 | const toggleEllipsis = (str, _limit) => ({ |
19 | string: str.slice(0, _limit), | 18 | string: str.slice(0, _limit), |
... | @@ -30,13 +29,7 @@ const Document = ({ | ... | @@ -30,13 +29,7 @@ const Document = ({ |
30 | <File filename={filename} filepath={filePath} /> | 29 | <File filename={filename} filepath={filePath} /> |
31 | <Text color="green">경로: {filePath}</Text> | 30 | <Text color="green">경로: {filePath}</Text> |
32 | <Text>{toggleEllipsis(content, limit).string}...</Text> | 31 | <Text>{toggleEllipsis(content, limit).string}...</Text> |
33 | - <Thumbnails | 32 | + <Thumbnails srcs={srcs} /> |
34 | - srcs={srcs} | ||
35 | - // srcs={[ | ||
36 | - // 'https://yoonsbucket.s3.amazonaws.com/book_report_1.png', | ||
37 | - // 'https://yoonsbucket.s3.amazonaws.com/book_report_2.png', | ||
38 | - // ]} | ||
39 | - /> | ||
40 | </Container> | 33 | </Container> |
41 | ); | 34 | ); |
42 | }; | 35 | }; | ... | ... |
... | @@ -5,7 +5,6 @@ import Header from '../components/Header'; | ... | @@ -5,7 +5,6 @@ import Header from '../components/Header'; |
5 | 5 | ||
6 | const SearchPage = () => { | 6 | const SearchPage = () => { |
7 | const { documents } = useSelector(state => state.parsedDocuments); | 7 | const { documents } = useSelector(state => state.parsedDocuments); |
8 | - console.log(documents); | ||
9 | return ( | 8 | return ( |
10 | <> | 9 | <> |
11 | <Header /> | 10 | <Header /> | ... | ... |
-
Please register or login to post a comment