diff --git a/src/App.js b/src/App.js index 4146c473..1e2b5dc1 100644 --- a/src/App.js +++ b/src/App.js @@ -54,6 +54,13 @@ const GlobalStyle = createGlobalStyle` margin: 0; padding: 0; } + + .enlarged { + max-width: none !important; + max-height: none !important; + width: auto !important; + height: auto !important; + } `; const StyledContainer = styled(ToastContainer)` diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index e7d6c8f8..d5a037f8 100644 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -18,6 +18,7 @@ import findShortParentCid from '../../utils/findShortParentCid'; import getCommentMediaInfo from '../../utils/getCommentMediaInfo'; import getDate from '../../utils/getDate'; import handleAddressClick from '../../utils/handleAddressClick'; +import handleImageClick from '../../utils/handleImageClick'; import handleQuoteClick from '../../utils/handleQuoteClick'; import handleStyleChange from '../../utils/handleStyleChange'; import useClickForm from '../../hooks/useClickForm'; @@ -486,23 +487,35 @@ const Board = () => { {commentMediaInfo?.type === "webpage" ? ( {thread.thumbnailUrl ? ( - thumbnail e.target.src = fallbackImgUrl} /> + {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> ) : null} ) : null} {commentMediaInfo?.type === "image" ? ( - {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> + {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> ) : null} {commentMediaInfo?.type === "video" ? ( - ) : null} {commentMediaInfo?.type === "audio" ? ( - ) : null} @@ -707,8 +720,9 @@ const Board = () => { {reply.thumbnailUrl ? ( thumbnail e.target.src = fallbackImgUrl} /> ) : null} @@ -716,8 +730,9 @@ const Board = () => { {replyMediaInfo?.type === "image" ? ( {replyMediaInfo.type} e.target.src = fallbackImgUrl} /> ) : null} @@ -837,27 +852,32 @@ const Board = () => { commentMediaInfo.type === "webpage" ? ( {thread.thumbnailUrl ? ( - thumbnail e.target.src = fallbackImgUrl} /> + thumbnail e.target.src = fallbackImgUrl} /> ) : null}
{commentMediaInfo?.type}
) : commentMediaInfo.type === "image" ? ( - {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> + {commentMediaInfo.type} e.target.src = fallbackImgUrl} />
{commentMediaInfo?.type}
) : commentMediaInfo.type === "video" ? ( ) : commentMediaInfo.type === "audio" ? ( - ) : null diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx index 05fb517f..93ba3c10 100644 --- a/src/components/views/Thread.jsx +++ b/src/components/views/Thread.jsx @@ -18,6 +18,7 @@ import formatState from '../../utils/formatState'; import getCommentMediaInfo from '../../utils/getCommentMediaInfo'; import getDate from '../../utils/getDate'; import handleAddressClick from '../../utils/handleAddressClick'; +import handleImageClick from '../../utils/handleImageClick'; import handleQuoteClick from '../../utils/handleQuoteClick'; import handleStyleChange from '../../utils/handleStyleChange'; import useClickForm from '../../hooks/useClickForm'; @@ -466,23 +467,35 @@ const Thread = () => { {commentMediaInfo?.type === "webpage" ? ( {comment.thumbnailUrl ? ( - thumbnail e.target.src = fallbackImgUrl} /> + {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> ) : null} ) : null} {commentMediaInfo?.type === "image" ? ( - {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> + {commentMediaInfo.type} e.target.src = fallbackImgUrl} /> ) : null} {commentMediaInfo?.type === "video" ? ( - ) : null} {commentMediaInfo?.type === "audio" ? ( - ) : null} @@ -653,8 +666,9 @@ const Thread = () => { {reply.thumbnailUrl ? ( thumbnail e.target.src = fallbackImgUrl} /> ) : null} @@ -662,23 +676,22 @@ const Thread = () => { {replyMediaInfo?.type === "image" ? ( {replyMediaInfo.type} e.target.src = fallbackImgUrl} /> ) : null} {replyMediaInfo?.type === "video" ? ( - ) : null} {replyMediaInfo?.type === "audio" ? ( - diff --git a/src/utils/handleImageClick.js b/src/utils/handleImageClick.js new file mode 100644 index 00000000..c26fe9ae --- /dev/null +++ b/src/utils/handleImageClick.js @@ -0,0 +1,5 @@ +const handleImageClick = (e) => { + e.target.classList.toggle('enlarged'); +}; + +export default handleImageClick; \ No newline at end of file