- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
{
@@ -1630,7 +1631,7 @@ const Catalog = () => {
>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
{
@@ -511,7 +512,7 @@ const Description = () => {
>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
{
diff --git a/src/components/views/NotFound.jsx b/src/components/views/NotFound.jsx
index 13b35da9..e6815d21 100644
--- a/src/components/views/NotFound.jsx
+++ b/src/components/views/NotFound.jsx
@@ -4,6 +4,7 @@ import { Link } from "react-router-dom";
import { Container, Header, Logo, Page, Boards, BoardsTitle } from '../styled/views/Home.styled';
import packageJson from '../../../package.json';
const {version} = packageJson;
+const commitRef = process?.env?.REACT_APP_COMMIT_REF ? ` ${process.env.REACT_APP_COMMIT_REF.slice(0, 7)}` : '';
const NotFound = () => {
@@ -61,7 +62,7 @@ const NotFound = () => {
fontSize: "11px",
marginTop: "2em",
}}>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
>
diff --git a/src/components/views/Pending.jsx b/src/components/views/Pending.jsx
index 62943f91..d1e10ded 100755
--- a/src/components/views/Pending.jsx
+++ b/src/components/views/Pending.jsx
@@ -21,6 +21,7 @@ import useError from '../../hooks/useError';
import useStateString from '../../hooks/useStateString';
import packageJson from '../../../package.json';
const {version} = packageJson;
+const commitRef = process?.env?.REACT_APP_COMMIT_REF ? ` ${process.env.REACT_APP_COMMIT_REF.slice(0, 7)}` : '';
const Pending = () => {
@@ -601,7 +602,7 @@ const Pending = () => {
marginTop: "2em",
marginBottom: "2em",
}}>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
>
diff --git a/src/components/views/Rules.jsx b/src/components/views/Rules.jsx
index 4ea80089..cb478da7 100644
--- a/src/components/views/Rules.jsx
+++ b/src/components/views/Rules.jsx
@@ -20,6 +20,7 @@ import handleStyleChange from '../../utils/handleStyleChange';
import useGeneralStore from '../../hooks/stores/useGeneralStore';
import packageJson from '../../../package.json';
const {version} = packageJson;
+const commitRef = process?.env?.REACT_APP_COMMIT_REF ? ` ${process.env.REACT_APP_COMMIT_REF.slice(0, 7)}` : '';
const Rules = () => {
@@ -509,7 +510,7 @@ const Rules = () => {
>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
{
@@ -720,110 +722,106 @@ const Subscriptions = () => {
{commentMediaInfo?.url ? (
-
-
- {commentMediaInfo?.type === 'iframe' && (
-
-
- {(isThreadThumbnailClicked[index] || !commentMediaInfo.thumbnail) && commentMediaInfo.embedUrl ? (
-
- ) : (
- {handleThumbnailClick(index, 'thread')}}
- style={{cursor: "pointer"}}
- onError={(e) => e.target.src = fallbackImgUrl} />
- )}
-
-
+
+
+ Link:
+
{
+ commentMediaInfo?.url.length > 30 ?
+ commentMediaInfo?.url.slice(0, 30) + "(...)" :
+ commentMediaInfo?.url
+ } {commentMediaInfo?.type === "iframe" ? null : `(${commentMediaInfo?.type})`}
+ {((isThreadThumbnailClicked[index] && (commentMediaInfo.type === 'iframe' || commentMediaInfo.type === 'video')) || (commentMediaInfo.type === 'iframe' && !commentMediaInfo.thumbnail)) && (
+
+ [
+ {handleThumbnailClick(index, 'thread')}}>
+ {isThreadThumbnailClicked[index] ? 'Close' : 'Embed'}
+
+ ]
+
)}
- {commentMediaInfo?.type === "webpage" ? (
-
-
- {thread.thumbnailUrl ? (
- {handleImageClick(e); handleThumbnailClick(index, 'thread')}}
- style={{cursor: "pointer"}}
- onError={(e) => e.target.src = fallbackImgUrl} />
- ) : null}
-
-
- ) : null}
- {commentMediaInfo?.type === "image" ? (
-
-
- {handleImageClick(e); handleThumbnailClick(index, 'thread')}}
- style={{cursor: "pointer"}}
- onError={(e) => e.target.src = fallbackImgUrl} />
-
-
- ) : null}
- {commentMediaInfo?.type === "video" ? (
-
-
- {isThreadThumbnailClicked[index] ? (
- e.target.src = fallbackImgUrl}
- />
- ) : (
-
+ {commentMediaInfo?.type === 'iframe' && (
+
+
+ {isThreadThumbnailClicked[index] && commentMediaInfo.url ? (
+
+ ) : commentMediaInfo.thumbnail ? (
+ {handleThumbnailClick(index, 'thread')}}
style={{cursor: "pointer"}}
- onError={(e) => e.target.src = fallbackImgUrl}
- />
- )}
+ onError={(e) => e.target.src = fallbackImgUrl} />
+ ) : null}
- ) : null}
- {commentMediaInfo?.type === "audio" ? (
+ )}
+ {commentMediaInfo?.type === "webpage" ? (
+
+
+ {thread.thumbnailUrl ? (
+ {handleImageClick(e); handleThumbnailClick(index, 'thread')}}
+ style={{cursor: "pointer"}}
+ onError={(e) => e.target.src = fallbackImgUrl} />
+ ) : null}
+
+
+ ) : null}
+ {commentMediaInfo?.type === "image" ? (
+
- {handleImageClick(e); handleThumbnailClick(index, 'thread')}}
+ style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
- ) : null}
+
+ ) : null}
+ {commentMediaInfo?.type === "video" ? (
+
+
+ {isThreadThumbnailClicked[index] ? (
+ e.target.src = fallbackImgUrl}
+ />
+ ) : (
+ {handleThumbnailClick(index, 'thread')}}
+ style={{cursor: "pointer"}}
+ onError={(e) => e.target.src = fallbackImgUrl}
+ />
+ )}
+
- ) : null}
+ ) : null}
+ {commentMediaInfo?.type === "audio" ? (
+
+ e.target.src = fallbackImgUrl} />
+
+ ) : null}
+
+ ) : null}
{thread.title ? (
thread.title.length > 75 ?
@@ -857,9 +855,9 @@ const Subscriptions = () => {
(u/
handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress)} )}
+ onClick={() => handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} )}
>
- {{({ shortAuthorAddress }) => (shortAuthorAddress)} }
+ {{({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} }
)
{
handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress)} )}
+ onClick={() => handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} )}
>
(u/
{reply.author?.shortAddress ?
@@ -1431,33 +1429,53 @@ const Subscriptions = () => {
{replyMediaInfo?.url ? (
-
-
+
+
Link:
{
replyMediaInfo?.url.length > 30 ?
replyMediaInfo?.url.slice(0, 30) + "(...)" :
replyMediaInfo?.url
- } ({replyMediaInfo?.type})
- {replyMediaInfo?.type === "video" || replyMediaInfo?.type === "iframe" ? (
- isReplyThumbnailClicked[index] ? (
-
- -[
- {handleThumbnailClick(index, 'reply')}}>Close
- ]
- )
- : null)
- : null}
+ } {replyMediaInfo?.type === "iframe" ? null : `(${replyMediaInfo?.type})`}
+ { ((isReplyThumbnailClicked[index] && (replyMediaInfo.type === 'iframe' || replyMediaInfo.type === 'video')) || (replyMediaInfo.type === 'iframe' && !replyMediaInfo.thumbnail)) && (
+
+ [
+ {handleThumbnailClick(index, 'reply')}}>
+ {isReplyThumbnailClicked[index] ? 'Close' : 'Embed'}
+
+ ]
+
+ )}
- {replyMediaInfo?.type === "webpage" ? (
-
+ {replyMediaInfo?.type === 'iframe' && (
+
+
+ {isReplyThumbnailClicked[index] && replyMediaInfo.url ? (
+
+ ) : replyMediaInfo.thumbnail ? (
+ {handleThumbnailClick(index, 'reply')}}
+ style={{cursor: "pointer"}}
+ onError={(e) => e.target.src = fallbackImgUrl} />
+ ) : null}
+
+
+ )}
+ {replyMediaInfo?.type === "webpage" && (
+
{reply.thumbnailUrl ? (
- {handleImageClick(e); handleThumbnailClick(index, 'reply')}}
style={{cursor: "pointer"}}
@@ -1465,51 +1483,50 @@ const Subscriptions = () => {
) : null}
- ) : null}
- {replyMediaInfo?.type === "image" ? (
-
+ )}
+ {replyMediaInfo?.type === "image" && (
+
- {handleImageClick(e); handleThumbnailClick(index, 'reply')}}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
- ) : null}
- {replyMediaInfo?.type === "video" ? (
-
-
- {isReplyThumbnailClicked[index] ? (
- e.target.src = fallbackImgUrl}
- />
- ) : (
- {handleThumbnailClick(index, 'reply')}}
- style={{cursor: "pointer"}}
- onError={(e) => e.target.src = fallbackImgUrl}
- />
- )}
-
-
- ) : null}
- {replyMediaInfo?.type === "audio" ? (
-
-
+
+ {isReplyThumbnailClicked[index] ? (
+ e.target.src = fallbackImgUrl}
+ />
+ ) : (
+ {handleThumbnailClick(index, 'reply')}}
+ style={{cursor: "pointer"}}
+ onError={(e) => e.target.src = fallbackImgUrl}
+ />
+ )}
+
+
+ )}
+ {replyMediaInfo?.type === "audio" && (
+
+ e.target.src = fallbackImgUrl} />
- ) : null}
+ )}
) : null}
{reply.content ? (
@@ -1758,11 +1775,11 @@ const Subscriptions = () => {
handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress)} )}
+ onClick={() => handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} )}
>
(u/
- {{({ shortAuthorAddress }) => (shortAuthorAddress)} }
+ {{({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} }
)
@@ -1830,108 +1847,102 @@ const Subscriptions = () => {
{thread.link ? (
-
- {commentMediaInfo?.type === 'iframe' && (
-
-
- {(isMobileThreadThumbnailClicked[index] || !commentMediaInfo.thumbnail) && commentMediaInfo.embedUrl ? (
-
-
+
+ {commentMediaInfo?.type === 'iframe' && (
+
+
+ {(isMobileThreadThumbnailClicked[index] && commentMediaInfo.url ? (
+
+
+
+ ) : commentMediaInfo.thumbnail ? (
+ {handleThumbnailClick(index, 'mobileThread')}}
+ style={{cursor: "pointer"}}
+ onError={(e) => e.target.src = fallbackImgUrl} />
+ ) : {handleThumbnailClick(index, 'mobileThread')}}>Embed )}
+ {commentMediaInfo?.type === "video" || commentMediaInfo?.type === "iframe" ? (
+ isMobileThreadThumbnailClicked[index] ? (
+
+ {handleThumbnailClick(index, 'mobileThread')}}
+ >Close
) : (
- {handleThumbnailClick(index, 'mobileThread')}}
- style={{cursor: "pointer"}}
- onError={(e) => e.target.src = fallbackImgUrl} />
- )}
- {commentMediaInfo?.type === "video" || commentMediaInfo?.type === "iframe" ? (
- isMobileThreadThumbnailClicked[index] ? (
-
- {handleThumbnailClick(index, 'mobileThread')}}
- >Close
-
- ) : (
- video
- )) : video
}
-
-
- )}
- {commentMediaInfo?.url ? (
- commentMediaInfo.type === "webpage" ? (
-
-
- {thread.thumbnailUrl ? (
- {handleImageClick(e); handleThumbnailClick(index, 'mobileThread')}}
- style={{cursor: "pointer"}}
- onError={(e) => e.target.src = fallbackImgUrl} />
- ) : null}
- {commentMediaInfo?.type}
-
-
- ) : commentMediaInfo.type === "image" ? (
-
-
+ webpage
+ )) : webpage
}
+
+
+ )}
+ {commentMediaInfo?.url ? (
+ commentMediaInfo.type === "webpage" ? (
+
+
+ {thread.thumbnailUrl ? (
{handleImageClick(e); handleThumbnailClick(index, 'mobileThread')}}
style={{cursor: "pointer"}}
onError={(e) => e.target.src = fallbackImgUrl} />
- {commentMediaInfo?.type}
-
-
- ) : commentMediaInfo.type === "video" ? (
-
- {isMobileThreadThumbnailClicked[index] ? (
- e.target.src = fallbackImgUrl} />
- ) : (
- {handleThumbnailClick(index, 'mobileThread')}}
- style={{cursor: "pointer"}}
- id="video-thumbnail-mobile"
- onError={(e) => e.target.src = fallbackImgUrl}
- />
- )}
- {commentMediaInfo?.type === "video" || commentMediaInfo?.type === "iframe" ? (
- isMobileThreadThumbnailClicked[index] ? (
-
- {handleThumbnailClick(index, 'mobileThread')}}
- >Close
-
- ) : (
- video
- )) : video
}
-
- ) : commentMediaInfo.type === "audio" ? (
-
- {commentMediaInfo?.type}
+
+
+ ) : commentMediaInfo.type === "image" ? (
+
+
+ {handleImageClick(e); handleThumbnailClick(index, 'mobileThread')}}
+ style={{cursor: "pointer"}}
+ onError={(e) => e.target.src = fallbackImgUrl} />
+ {commentMediaInfo?.type}
+
+
+ ) : commentMediaInfo.type === "video" ? (
+
+ {isMobileThreadThumbnailClicked[index] ? (
+ e.target.src = fallbackImgUrl} />
- {commentMediaInfo?.type}
-
- ) : null
- ) : null}
-
- ) : null}
+ ) : (
+
{handleThumbnailClick(index, 'mobileThread')}}
+ style={{cursor: "pointer"}}
+ id="video-thumbnail-mobile"
+ onError={(e) => e.target.src = fallbackImgUrl}
+ />
+ )}
+ {commentMediaInfo?.type === "video" || commentMediaInfo?.type === "iframe" ? (
+ isMobileThreadThumbnailClicked[index] ? (
+
+ {handleThumbnailClick(index, 'mobileThread')}}
+ >Close
+
+ ) : (
+ video
+ )) : video
}
+
+ ) : commentMediaInfo.type === "audio" ? (
+
+ e.target.src = fallbackImgUrl} />
+ {commentMediaInfo?.type}
+
+ ) : null
+ ) : null}
+
+ ) : null}
{thread.content ? (
thread.content?.length > 500 ?
@@ -2001,7 +2012,7 @@ const Subscriptions = () => {
handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress)} )}
+ onClick={() => handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} )}
>
(u/
{reply.author?.shortAddress ?
@@ -2076,7 +2087,35 @@ const Subscriptions = () => {
{reply.link ? (
{replyMediaInfo?.url ? (
- replyMediaInfo.type === "webpage" ? (
+ replyMediaInfo.type === "iframe" ? (
+
+
+ {(isMobileReplyThumbnailClicked[index] && replyMediaInfo.url ? (
+
+
+
+ ) : replyMediaInfo.thumbnail ? (
+ {handleThumbnailClick(index, 'mobileReply')}}
+ style={{cursor: "pointer"}}
+ onError={(e) => e.target.src = fallbackImgUrl} />
+ ) : {handleThumbnailClick(index, 'mobileReply')}}>Embed )}
+ {replyMediaInfo?.type === "video" || replyMediaInfo?.type === "iframe" ? (
+ isMobileReplyThumbnailClicked[index] ? (
+
+ {handleThumbnailClick(index, 'mobileReply')}}
+ >Close
+
+ ) : (
+ webpage
+ )) : webpage
}
+
+
+ ) : replyMediaInfo.type === "webpage" ? (
{reply.thumbnailUrl ? (
@@ -2101,13 +2140,35 @@ const Subscriptions = () => {
) : replyMediaInfo.type === "video" ? (
-
- e.target.src = fallbackImgUrl} />
- {replyMediaInfo.type}
-
+
+ {isMobileReplyThumbnailClicked[index] ? (
+ e.target.src = fallbackImgUrl} />
+ ) : (
+ {handleThumbnailClick(index, 'mobileReply')}}
+ style={{cursor: "pointer"}}
+ id="video-thumbnail-mobile"
+ onError={(e) => e.target.src = fallbackImgUrl}
+ />
+ )}
+ {replyMediaInfo?.type === "video" || replyMediaInfo?.type === "iframe" ? (
+ isMobileReplyThumbnailClicked[index] ? (
+
+ {handleThumbnailClick(index, 'mobileReply')}}
+ >Close
+
+ ) : (
+ video
+ )) : video
}
+
) : replyMediaInfo.type === "audio" ? (
{
>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
{
@@ -982,7 +983,7 @@ const SubscriptionsCatalog = () => {
>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
{
@@ -871,7 +872,7 @@ const Thread = () => {
commentMediaInfo?.url.slice(0, 30) + "(...)" :
commentMediaInfo?.url
} {commentMediaInfo?.type === "iframe" ? null : `(${commentMediaInfo?.type})`}
- { (isThreadThumbnailClicked[index] || (commentMediaInfo.type === 'iframe' && !commentMediaInfo.thumbnail)) && (
+ {((isThreadThumbnailClicked[index] && (commentMediaInfo.type === 'iframe' || commentMediaInfo.type === 'video')) || (commentMediaInfo.type === 'iframe' && !commentMediaInfo.thumbnail)) && (
[
{
handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress)} )}>
+ onClick={() => handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} )}>
(u/
- {{({ shortAuthorAddress }) => (shortAuthorAddress)} }
+ {{({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} }
)
@@ -1531,7 +1532,7 @@ const Thread = () => {
replyMediaInfo?.url.slice(0, 30) + "(...)" :
replyMediaInfo?.url
} {replyMediaInfo?.type === "iframe" ? null : `(${replyMediaInfo?.type})`}
- { (isReplyThumbnailClicked[index] || (replyMediaInfo.type === 'iframe' && !replyMediaInfo.thumbnail)) && (
+ { ((isReplyThumbnailClicked[index] && (replyMediaInfo.type === 'iframe' || replyMediaInfo.type === 'video')) || (replyMediaInfo.type === 'iframe' && !replyMediaInfo.thumbnail)) && (
[
{
handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress)} )}
+ onClick={() => handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} )}
>
(u/
- {{({ shortAuthorAddress }) => (shortAuthorAddress)} }
+ {{({ shortAuthorAddress }) => (shortAuthorAddress || "aPL4c3H0Ld3r")} }
)
@@ -2459,7 +2460,7 @@ const Thread = () => {
>
- plebchan v{version}. GPL-2.0
+ plebchan v{version}{commitRef}. GPL-2.0
{
+ const [infoMessage, setInfoMessage] = useState('');
+ const [renderCount, setRenderCount] = useState(0);
+
+ useEffect(() => {
+ if (infoMessage && infoMessage.length > 0) {
+ const showInfoToast = () => {
+ const toastId = toast.info(infoMessage.toString(), {
+ position: "top-right",
+ autoClose: false,
+ hideProgressBar: false,
+ closeOnClick: false,
+ pauseOnHover: false,
+ draggable: false,
+ progress: undefined,
+ theme: "dark",
+ });
+
+ return () => {
+ toast.dismiss(toastId);
+ };
+ };
+
+ const timeoutId = setTimeout(showInfoToast, 500);
+
+ return () => {
+ clearTimeout(timeoutId);
+ };
+ }
+ }, [infoMessage, renderCount]);
+
+ const setNewInfoMessage = (message) => {
+ setInfoMessage(message);
+ setRenderCount(prevCount => prevCount + 1);
+ };
+
+ return [infoMessage, setNewInfoMessage];
+};
+
+export default useInfo;
\ No newline at end of file