fix posting

This commit is contained in:
plebbitor
2023-04-03 15:08:45 +02:00
parent 06eae0e563
commit a63471aff6
6 changed files with 170 additions and 154 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"@babel/core": "^7.21.3", "@babel/core": "^7.21.3",
"@babel/plugin-syntax-flow": "^7.18.6", "@babel/plugin-syntax-flow": "^7.18.6",
"@babel/plugin-transform-react-jsx": "^7.21.0", "@babel/plugin-transform-react-jsx": "^7.21.0",
"@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#47c89c104bf3f16f790282fbdf26f672c395df52", "@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#6de131a2e9f23578efd9faf4670d2cc43ce6d5ba",
"@testing-library/dom": "^9.0.1", "@testing-library/dom": "^9.0.1",
"@testing-library/jest-dom": "^5.14.1", "@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^14.0.0", "@testing-library/react": "^14.0.0",
+15 -12
View File
@@ -1,4 +1,4 @@
import React from 'react'; import React, { useRef } from 'react';
import useAppStore from '../useAppStore'; import useAppStore from '../useAppStore';
import Modal from 'react-modal'; import Modal from 'react-modal';
import styled from 'styled-components'; import styled from 'styled-components';
@@ -246,18 +246,21 @@ const StyledModal = styled(Modal)`
const CaptchaModal = ({ isOpen, closeModal, captchaImage }) => { const CaptchaModal = ({ isOpen, closeModal, captchaImage }) => {
const { captchaResponse, setCaptchaResponse } = useAppStore(state => state); const { setCaptchaResponse } = useAppStore(state => state);
const selectedStyle = useAppStore(state => state.selectedStyle); const selectedStyle = useAppStore(state => state.selectedStyle);
const handleCloseModal = () => { const responseRef = useRef();
closeModal(); const nodeRef = useRef(null);
const handleKeyDown = (event) => {
if (event.key === "Enter") {
event.preventDefault();
setCaptchaResponse(responseRef.current.value);
closeModal();
}
}; };
const handleChallengeResponse = (event) => {
setCaptchaResponse(event.target.value);
};
const nodeRef = React.useRef(null);
return ( return (
<StyledModal <StyledModal
@@ -272,7 +275,7 @@ const CaptchaModal = ({ isOpen, closeModal, captchaImage }) => {
<div className="modal-content" ref={nodeRef}> <div className="modal-content" ref={nodeRef}>
<div className="modal-header"> <div className="modal-header">
Challenges for Challenges for
<button className="icon" onClick={handleCloseModal} title="close" /> <button className="icon" onClick={() => closeModal()} title="close" />
</div> </div>
<div id="form"> <div id="form">
<div> <div>
@@ -287,8 +290,8 @@ const CaptchaModal = ({ isOpen, closeModal, captchaImage }) => {
type="text" type="text"
autoComplete='off' autoComplete='off'
placeholder="TYPE THE CAPTCHA HERE AND PRESS ENTER" placeholder="TYPE THE CAPTCHA HERE AND PRESS ENTER"
value={captchaResponse} ref={responseRef}
onChange={handleChallengeResponse} onKeyDown={handleKeyDown}
autoFocus /> autoFocus />
<img src={captchaImage} alt="captcha" /> <img src={captchaImage} alt="captcha" />
</div> </div>
+43 -38
View File
@@ -1,4 +1,4 @@
import React, { useState, useEffect, Fragment } from 'react'; import React, { useState, useEffect, useRef, Fragment } from 'react';
import { Link, useNavigate, useParams } from 'react-router-dom'; import { Link, useNavigate, useParams } from 'react-router-dom';
import InfiniteScroll from 'react-infinite-scroller'; import InfiniteScroll from 'react-infinite-scroller';
import { Tooltip } from 'react-tooltip'; import { Tooltip } from 'react-tooltip';
@@ -34,10 +34,11 @@ const Board = () => {
showPostFormLink showPostFormLink
} = useAppStore(state => state); } = useAppStore(state => state);
const [name, setName] = useState(''); const nameRef = useRef();
const [subject, setSubject] = useState(''); const subjectRef = useRef();
const [comment, setComment] = useState(''); const commentRef = useRef();
const { publishComment } = usePublishComment(); const linkRef = useRef();
const [isCaptchaOpen, setIsCaptchaOpen] = useState(false); const [isCaptchaOpen, setIsCaptchaOpen] = useState(false);
const [isReplyOpen, setIsReplyOpen] = useState(false); const [isReplyOpen, setIsReplyOpen] = useState(false);
const [captchaImage, setCaptchaImage] = useState(''); const [captchaImage, setCaptchaImage] = useState('');
@@ -46,12 +47,11 @@ const Board = () => {
const [visible, setVisible] = useState(true); const [visible, setVisible] = useState(true);
const { feed, hasMore, loadMore } = useFeed({subplebbitAddresses: [`${selectedAddress}`], sortType: 'new'}); const { feed, hasMore, loadMore } = useFeed({subplebbitAddresses: [`${selectedAddress}`], sortType: 'new'});
const [selectedFeed, setSelectedFeed] = useState(feed); const [selectedFeed, setSelectedFeed] = useState(feed);
const { subplebbitAddress } = useParams(); const { subplebbitAddress } = useParams();
const handleClickForm = useClickForm();
// useEffect(() => { // useEffect(() => {
// console.log(selectedFeed); // console.log(selectedFeed[3]);
// }, [selectedFeed]); // }, [selectedFeed]);
// temporary title from JSON, gets subplebbitAddress from URL // temporary title from JSON, gets subplebbitAddress from URL
@@ -89,7 +89,7 @@ const Board = () => {
await new Promise(resolve => setTimeout(resolve, 1000)); await new Promise(resolve => setTimeout(resolve, 1000));
} }
}; };
const onChallengeVerification = (challengeVerification) => { const onChallengeVerification = (challengeVerification) => {
if (challengeVerification.challengeSuccess === true) { if (challengeVerification.challengeSuccess === true) {
@@ -103,6 +103,7 @@ const Board = () => {
const onChallenge = async (challenges, comment) => { const onChallenge = async (challenges, comment) => {
console.log("onChallenge:", challenges, comment)
let challengeAnswers = []; let challengeAnswers = [];
try { try {
challengeAnswers = await getChallengeAnswersFromUser(challenges) challengeAnswers = await getChallengeAnswersFromUser(challenges)
@@ -114,8 +115,31 @@ const Board = () => {
await comment.publishChallengeAnswers(challengeAnswers) await comment.publishChallengeAnswers(challengeAnswers)
} }
} }
const publishCommentOptions = {
displayName: nameRef.current ? nameRef.current.value : undefined,
title: subjectRef.current ? subjectRef.current.value : undefined,
content: commentRef.current ? commentRef.current.value : undefined,
link: linkRef.current ? linkRef.current.value : undefined,
subplebbitAddress: selectedAddress,
onChallenge,
onChallengeVerification,
onError
};
const resetFields = () => {
nameRef.current.value = '';
subjectRef.current.value = '';
commentRef.current.value = '';
linkRef.current.value = '';
};
const { publishComment } = usePublishComment(publishCommentOptions);
const getChallengeAnswersFromUser = async (challenges) => { const getChallengeAnswersFromUser = async (challenges) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const imageString = challenges?.challenges[0].challenge; const imageString = challenges?.challenges[0].challenge;
@@ -133,6 +157,7 @@ const Board = () => {
resolve(captchaResponse); resolve(captchaResponse);
setIsCaptchaOpen(false); setIsCaptchaOpen(false);
document.removeEventListener('keydown', handleKeyDown); document.removeEventListener('keydown', handleKeyDown);
event.preventDefault();
} }
}; };
@@ -162,26 +187,6 @@ const Board = () => {
navigate(`/${selected}`); navigate(`/${selected}`);
}; };
const handlePublishComment = async () => {
try {
const pendingComment = await publishComment({
content: comment,
title: subject,
subplebbitAddress: selectedAddress,
onChallengeVerification,
onChallenge,
onError: onError,
});
console.log(`Comment pending with index: ${pendingComment.index}`);
setName('');
setSubject('');
setComment('');
} catch (error) {
onError(error);
}
};
// scroll to post when quote is clicked // scroll to post when quote is clicked
function handleQuoteClick(reply, event) { function handleQuoteClick(reply, event) {
event.preventDefault(); event.preventDefault();
@@ -194,7 +199,6 @@ const Board = () => {
}; };
return ( return (
<Container> <Container>
<CaptchaModal <CaptchaModal
@@ -267,12 +271,12 @@ const Board = () => {
<PostFormLink id="post-form-link" showPostFormLink={showPostFormLink} selectedStyle={selectedStyle} > <PostFormLink id="post-form-link" showPostFormLink={showPostFormLink} selectedStyle={selectedStyle} >
<div id="post-form-link-desktop"> <div id="post-form-link-desktop">
[ [
<a onClick={handleClickForm} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a> <a onClick={useClickForm()} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a>
] ]
</div> </div>
<div id="post-form-link-mobile"> <div id="post-form-link-mobile">
<span className="btn-wrap"> <span className="btn-wrap">
<a onClick={handleClickForm} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a> <a onClick={useClickForm()} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a>
</span> </span>
</div> </div>
</PostFormLink> </PostFormLink>
@@ -281,26 +285,27 @@ const Board = () => {
<tr data-type="Name"> <tr data-type="Name">
<td id="td-name">Name</td> <td id="td-name">Name</td>
<td> <td>
<input name="name" type="text" tabIndex={1} placeholder="Anonymous" /> <input name="name" type="text" tabIndex={1} placeholder="Anonymous" ref={nameRef} />
</td> </td>
</tr> </tr>
<tr data-type="Subject"> <tr data-type="Subject">
<td>Subject</td> <td>Subject</td>
<td> <td>
<input name="sub" type="text" tabIndex={3} /> <input name="sub" type="text" tabIndex={3} ref={subjectRef}/>
<input id="post-button" type="submit" value="Post" tabIndex={6} onClick={handlePublishComment} /> <input id="post-button" type="submit" value="Post" tabIndex={6}
onClick={async () => {await publishComment(); resetFields();}} />
</td> </td>
</tr> </tr>
<tr data-type="Comment"> <tr data-type="Comment">
<td>Comment</td> <td>Comment</td>
<td> <td>
<textarea name="com" cols="48" rows="4" tabIndex={4} wrap="soft" /> <textarea name="com" cols="48" rows="4" tabIndex={4} wrap="soft" ref={commentRef} />
</td> </td>
</tr> </tr>
<tr data-type="File"> <tr data-type="File">
<td>Embed File</td> <td>Embed File</td>
<td> <td>
<input name="embed" type="text" tabIndex={7} placeholder="Paste link" /> <input name="embed" type="text" tabIndex={7} placeholder="Paste link" ref={linkRef} />
<button id="t-help" type="button" onClick={ <button id="t-help" type="button" onClick={
() => alert("- Embedding media is optional, posts can be text-only. \n- A CAPTCHA challenge will appear after posting. \n- The CAPTCHA is case-sensitive.") () => alert("- Embedding media is optional, posts can be text-only. \n- A CAPTCHA challenge will appear after posting. \n- The CAPTCHA is case-sensitive.")
} data-tip="Help">?</button> } data-tip="Help">?</button>
+65 -60
View File
@@ -1,4 +1,4 @@
import React, { useState, useEffect, Fragment } from 'react'; import React, { useState, useEffect, useRef, Fragment } from 'react';
import { Link, useNavigate, useParams } from 'react-router-dom'; import { Link, useNavigate, useParams } from 'react-router-dom';
import InfiniteScroll from 'react-infinite-scroller'; import InfiniteScroll from 'react-infinite-scroller';
import { useFeed, usePublishComment } from '@plebbit/plebbit-react-hooks'; import { useFeed, usePublishComment } from '@plebbit/plebbit-react-hooks';
@@ -32,10 +32,11 @@ const Catalog = () => {
showPostFormLink showPostFormLink
} = useAppStore(state => state); } = useAppStore(state => state);
const [name, setName] = useState(''); const nameRef = useRef();
const [subject, setSubject] = useState(''); const subjectRef = useRef();
const [comment, setComment] = useState(''); const commentRef = useRef();
const { publishComment } = usePublishComment(); const linkRef = useRef();
const [isCaptchaOpen, setIsCaptchaOpen] = useState(false); const [isCaptchaOpen, setIsCaptchaOpen] = useState(false);
const [captchaImage, setCaptchaImage] = useState(''); const [captchaImage, setCaptchaImage] = useState('');
const navigate = useNavigate(); const navigate = useNavigate();
@@ -43,9 +44,8 @@ const Catalog = () => {
const [visible, setVisible] = useState(true); const [visible, setVisible] = useState(true);
const { feed, hasMore, loadMore } = useFeed({subplebbitAddresses: [`${selectedAddress}`], sortType: 'new'}); const { feed, hasMore, loadMore } = useFeed({subplebbitAddresses: [`${selectedAddress}`], sortType: 'new'});
const { subplebbitAddress } = useParams(); const { subplebbitAddress } = useParams();
const handleClickForm = useClickForm();
// temporary title from JSON, gets subplebbitAddress from URL
useEffect(() => { useEffect(() => {
setSelectedAddress(subplebbitAddress); setSelectedAddress(subplebbitAddress);
const selectedSubplebbit = defaultSubplebbits.find((subplebbit) => subplebbit.address === subplebbitAddress); const selectedSubplebbit = defaultSubplebbits.find((subplebbit) => subplebbit.address === subplebbitAddress);
@@ -87,6 +87,7 @@ const Catalog = () => {
const onChallenge = async (challenges, comment) => { const onChallenge = async (challenges, comment) => {
// console.log("onChallenge:", challenges, comment);
let challengeAnswers = []; let challengeAnswers = [];
try { try {
challengeAnswers = await getChallengeAnswersFromUser(challenges) challengeAnswers = await getChallengeAnswersFromUser(challenges)
@@ -100,6 +101,29 @@ const Catalog = () => {
}; };
const publishCommentOptions = {
displayName: nameRef.current ? nameRef.current.value : undefined,
title: subjectRef.current ? subjectRef.current.value : undefined,
content: commentRef.current ? commentRef.current.value : undefined,
link: linkRef.current ? linkRef.current.value : undefined,
subplebbitAddress: selectedAddress,
onChallenge,
onChallengeVerification,
onError
};
const resetFields = () => {
nameRef.current.value = '';
subjectRef.current.value = '';
commentRef.current.value = '';
linkRef.current.value = '';
};
const { publishComment } = usePublishComment(publishCommentOptions);
const getChallengeAnswersFromUser = async (challenges) => { const getChallengeAnswersFromUser = async (challenges) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const imageString = challenges?.challenges[0].challenge; const imageString = challenges?.challenges[0].challenge;
@@ -117,6 +141,7 @@ const Catalog = () => {
resolve(captchaResponse); resolve(captchaResponse);
setIsCaptchaOpen(false); setIsCaptchaOpen(false);
document.removeEventListener('keydown', handleKeyDown); document.removeEventListener('keydown', handleKeyDown);
event.preventDefault();
} }
}; };
@@ -130,7 +155,7 @@ const Catalog = () => {
}); });
}; };
// mobile navbar board select functionality
const handleSelectChange = (event) => { const handleSelectChange = (event) => {
const selected = event.target.value; const selected = event.target.value;
const selectedTitle = defaultSubplebbits.find((subplebbit) => subplebbit.address === selected).title; const selectedTitle = defaultSubplebbits.find((subplebbit) => subplebbit.address === selected).title;
@@ -140,27 +165,6 @@ const Catalog = () => {
}; };
const handlePublishComment = async () => {
// Event.preventDefault();
try {
const pendingComment = await publishComment({
content: comment,
title: subject,
subplebbitAddress: selectedAddress,
onChallengeVerification,
onChallenge,
onError: onError,
});
console.log(`Comment pending with index: ${pendingComment.index}`);
setName('');
setSubject('');
setComment('');
} catch (error) {
onError(error);
}
};
return ( return (
<Container> <Container>
<CaptchaModal <CaptchaModal
@@ -232,46 +236,47 @@ const Catalog = () => {
<PostFormLink id="post-form-link" showPostFormLink={showPostFormLink} selectedStyle={selectedStyle} > <PostFormLink id="post-form-link" showPostFormLink={showPostFormLink} selectedStyle={selectedStyle} >
<div id="post-form-link-desktop"> <div id="post-form-link-desktop">
[ [
<a onClick={handleClickForm} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a> <a onClick={useClickForm()} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a>
] ]
</div> </div>
<div id="post-form-link-mobile"> <div id="post-form-link-mobile">
<span className="btn-wrap"> <span className="btn-wrap">
<a onClick={handleClickForm} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a> <a onClick={useClickForm()} onMouseOver={(event) => event.target.style.cursor='pointer'}>Start a New Thread</a>
</span> </span>
</div> </div>
</PostFormLink> </PostFormLink>
<PostFormTable id="post-form" showPostForm={showPostForm} selectedStyle={selectedStyle} className="post-form"> <PostFormTable id="post-form" showPostForm={showPostForm} selectedStyle={selectedStyle} className="post-form">
<tbody> <tbody>
<tr data-type="Name"> <tr data-type="Name">
<td id="td-name">Name</td> <td id="td-name">Name</td>
<td> <td>
<input name="name" type="text" tabIndex={1} placeholder="Anonymous" value={name} onChange={(event) => setName(event.target.value)} /> <input name="name" type="text" tabIndex={1} placeholder="Anonymous" ref={nameRef} />
</td> </td>
</tr> </tr>
<tr data-type="Subject"> <tr data-type="Subject">
<td>Subject</td> <td>Subject</td>
<td> <td>
<input name="sub" type="text" tabIndex={3} value={subject} onChange={(event) => setSubject(event.target.value)} /> <input name="sub" type="text" tabIndex={3} ref={subjectRef}/>
<input id="post-button" type="submit" value="Post" tabIndex={6} onClick={handlePublishComment} /> <input id="post-button" type="submit" value="Post" tabIndex={6}
</td> onClick={async () => {await publishComment(); resetFields();}} />
</tr> </td>
<tr data-type="Comment"> </tr>
<td>Comment</td> <tr data-type="Comment">
<td> <td>Comment</td>
<textarea name="com" cols="48" rows="4" tabIndex={4} wrap="soft" value={comment} onChange={(event) => setComment(event.target.value)}></textarea> <td>
</td> <textarea name="com" cols="48" rows="4" tabIndex={4} wrap="soft" ref={commentRef} />
</tr> </td>
<tr data-type="File"> </tr>
<td>Embed File</td> <tr data-type="File">
<td> <td>Embed File</td>
<input name="embed" type="text" tabIndex={7} placeholder="Paste link" /> <td>
<button id="t-help" type="button" onClick={ <input name="embed" type="text" tabIndex={7} placeholder="Paste link" ref={linkRef} />
() => alert("- Embedding media is optional, posts can be text-only. \n- A CAPTCHA challenge will appear after posting. \n- The CAPTCHA is case-sensitive.") <button id="t-help" type="button" onClick={
} data-tip="Help">?</button> () => alert("- Embedding media is optional, posts can be text-only. \n- A CAPTCHA challenge will appear after posting. \n- The CAPTCHA is case-sensitive.")
</td> } data-tip="Help">?</button>
</tr> </td>
</tbody> </tr>
</tbody>
</PostFormTable> </PostFormTable>
</PostForm> </PostForm>
<TopBar selectedStyle={selectedStyle}> <TopBar selectedStyle={selectedStyle}>
+34 -28
View File
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Link, useNavigate, useParams } from 'react-router-dom'; import { Link, useNavigate, useParams } from 'react-router-dom';
import { Tooltip } from 'react-tooltip'; import { Tooltip } from 'react-tooltip';
import { useComment, usePublishComment } from '@plebbit/plebbit-react-hooks'; import { useComment, usePublishComment } from '@plebbit/plebbit-react-hooks';
@@ -33,12 +33,12 @@ const Thread = () => {
showPostForm, showPostForm,
showPostFormLink showPostFormLink
} = useAppStore(state => state); } = useAppStore(state => state);
const [name, setName] = useState(''); const nameRef = useRef();
const [subject, setSubject] = useState(''); const commentRef = useRef();
const linkRef = useRef();
const [commentContent, setCommentContent] = useState(''); const [commentContent, setCommentContent] = useState('');
const { publishComment } = usePublishComment();
const [isCaptchaOpen, setIsCaptchaOpen] = useState(false); const [isCaptchaOpen, setIsCaptchaOpen] = useState(false);
const [isReplyOpen, setIsReplyOpen] = useState(false); const [isReplyOpen, setIsReplyOpen] = useState(false);
const [captchaImage, setCaptchaImage] = useState(''); const [captchaImage, setCaptchaImage] = useState('');
@@ -93,6 +93,7 @@ const Thread = () => {
const onChallenge = async (challenges, comment) => { const onChallenge = async (challenges, comment) => {
// console.log("onChallenge:", challenges, comment);
let challengeAnswers = []; let challengeAnswers = [];
try { try {
challengeAnswers = await getChallengeAnswersFromUser(challenges) challengeAnswers = await getChallengeAnswersFromUser(challenges)
@@ -106,6 +107,28 @@ const Thread = () => {
}; };
const publishCommentOptions = {
displayName: nameRef.current ? nameRef.current.value : undefined,
content: commentRef.current ? commentRef.current.value : undefined,
link: linkRef.current ? linkRef.current.value : undefined,
parentCid: selectedThread,
subplebbitAddress: selectedAddress,
onChallenge,
onChallengeVerification,
onError
};
const resetFields = () => {
nameRef.current.value = '';
commentRef.current.value = '';
linkRef.current.value = '';
};
const { publishComment } = usePublishComment(publishCommentOptions);
const getChallengeAnswersFromUser = async (challenges) => { const getChallengeAnswersFromUser = async (challenges) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const imageString = challenges?.challenges[0].challenge; const imageString = challenges?.challenges[0].challenge;
@@ -123,6 +146,7 @@ const Thread = () => {
resolve(captchaResponse); resolve(captchaResponse);
setIsCaptchaOpen(false); setIsCaptchaOpen(false);
document.removeEventListener('keydown', handleKeyDown); document.removeEventListener('keydown', handleKeyDown);
event.preventDefault();
} }
}; };
@@ -146,25 +170,6 @@ const Thread = () => {
}; };
const handlePublishComment = async () => {
try {
const pendingComment = await publishComment({
content: commentContent,
title: subject,
subplebbitAddress: selectedAddress,
onChallengeVerification,
onChallenge,
onError: onError,
});
console.log(`Comment pending with index: ${pendingComment.index}`);
setName('');
setSubject('');
setCommentContent('');
} catch (error) {
onError(error);
}
};
// scroll to post when quote is clicked // scroll to post when quote is clicked
function handleQuoteClick(reply, event) { function handleQuoteClick(reply, event) {
event.preventDefault(); event.preventDefault();
@@ -282,20 +287,21 @@ const Thread = () => {
<tr data-type="Name"> <tr data-type="Name">
<td id="td-name">Name</td> <td id="td-name">Name</td>
<td> <td>
<input name="name" type="text" tabIndex={1} placeholder="Anonymous" value={name} onChange={(event) => setName(event.target.value)} /> <input name="name" type="text" tabIndex={1} placeholder="Anonymous" ref={nameRef} />
<input id="post-button" type="submit" value="Post" tabIndex={6} onClick={handlePublishComment} /> <input id="post-button" type="submit" value="Post" tabIndex={6}
onClick={async () => {await publishComment(); resetFields();}} />
</td> </td>
</tr> </tr>
<tr data-type="Comment"> <tr data-type="Comment">
<td>Comment</td> <td>Comment</td>
<td> <td>
<textarea name="com" cols="48" rows="4" tabIndex={4} wrap="soft" value={commentContent} onChange={(event) => setCommentContent(event.target.value)}></textarea> <textarea name="com" cols="48" rows="4" tabIndex={4} wrap="soft" ref={commentRef} />
</td> </td>
</tr> </tr>
<tr data-type="File"> <tr data-type="File">
<td>Embed File</td> <td>Embed File</td>
<td> <td>
<input name="embed" type="text" tabIndex={7} placeholder="Paste link" /> <input name="embed" type="text" tabIndex={7} placeholder="Paste link" ref={linkRef} />
<button id="t-help" type="button" onClick={ <button id="t-help" type="button" onClick={
() => alert("- Embedding media is optional, posts can be text-only. \n- A CAPTCHA challenge will appear after posting. \n- The CAPTCHA is case-sensitive.")} () => alert("- Embedding media is optional, posts can be text-only. \n- A CAPTCHA challenge will appear after posting. \n- The CAPTCHA is case-sensitive.")}
data-tip="Help" data-tip="Help"
+12 -15
View File
@@ -2417,9 +2417,9 @@
mkdirp "^1.0.4" mkdirp "^1.0.4"
rimraf "^3.0.2" rimraf "^3.0.2"
"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#7e6f4d7d90f628e474e02c51a89e2723fb71a73d": "@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#d5f312ef577dc4a845e15d1f87c4273cb2195c08":
version "0.0.3" version "0.0.3"
resolved "https://github.com/plebbit/plebbit-js.git#7e6f4d7d90f628e474e02c51a89e2723fb71a73d" resolved "https://github.com/plebbit/plebbit-js.git#d5f312ef577dc4a845e15d1f87c4273cb2195c08"
dependencies: dependencies:
"@keyv/sqlite" "3.6.2" "@keyv/sqlite" "3.6.2"
"@plebbit/plebbit-logger" "github:plebbit/plebbit-logger" "@plebbit/plebbit-logger" "github:plebbit/plebbit-logger"
@@ -2434,6 +2434,7 @@
ethers "5.7.2" ethers "5.7.2"
file-type "16.5.4" file-type "16.5.4"
form-data "4.0.0" form-data "4.0.0"
hpagent "1.2.0"
ipfs-http-client "56.0.3" ipfs-http-client "56.0.3"
ipfs-only-hash "4.0.0" ipfs-only-hash "4.0.0"
is-ipfs "6.0.2" is-ipfs "6.0.2"
@@ -2442,8 +2443,9 @@
keyv "4.5.2" keyv "4.5.2"
knex "2.3.0" knex "2.3.0"
libp2p-crypto "0.21.2" libp2p-crypto "0.21.2"
limiter "2.1.0"
lodash-es "4.17.21" lodash-es "4.17.21"
open-graph-scraper "^5.2.2" open-graph-scraper "5.2.3"
peer-id "0.16.0" peer-id "0.16.0"
proper-lockfile "github:plebbit/node-proper-lockfile" proper-lockfile "github:plebbit/node-proper-lockfile"
retry "0.13.1" retry "0.13.1"
@@ -2452,12 +2454,12 @@
sqlite3 "5.1.2" sqlite3 "5.1.2"
tiny-typed-emitter "2.1.0" tiny-typed-emitter "2.1.0"
tinycache "1.1.2" tinycache "1.1.2"
tunnel "0.0.6" ts-custom-error "3.3.1"
uuid "9.0.0" uuid "9.0.0"
"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#d5f312ef577dc4a845e15d1f87c4273cb2195c08": "@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#ef0f3c6dd5e72c58dab1dffc486addf2819bd638":
version "0.0.3" version "0.0.3"
resolved "https://github.com/plebbit/plebbit-js.git#d5f312ef577dc4a845e15d1f87c4273cb2195c08" resolved "https://github.com/plebbit/plebbit-js.git#ef0f3c6dd5e72c58dab1dffc486addf2819bd638"
dependencies: dependencies:
"@keyv/sqlite" "3.6.2" "@keyv/sqlite" "3.6.2"
"@plebbit/plebbit-logger" "github:plebbit/plebbit-logger" "@plebbit/plebbit-logger" "github:plebbit/plebbit-logger"
@@ -2523,11 +2525,11 @@
uuid "8.3.2" uuid "8.3.2"
zustand "4.0.0" zustand "4.0.0"
"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#b42bcb6a4f74ab23bbb8dfa49e43e9cccef3ece6": "@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#6de131a2e9f23578efd9faf4670d2cc43ce6d5ba":
version "0.0.1" version "0.0.1"
resolved "https://github.com/plebbit/plebbit-react-hooks.git#b42bcb6a4f74ab23bbb8dfa49e43e9cccef3ece6" resolved "https://github.com/plebbit/plebbit-react-hooks.git#6de131a2e9f23578efd9faf4670d2cc43ce6d5ba"
dependencies: dependencies:
"@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#7e6f4d7d90f628e474e02c51a89e2723fb71a73d" "@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#ef0f3c6dd5e72c58dab1dffc486addf2819bd638"
"@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git" "@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git"
assert "2.0.0" assert "2.0.0"
ethers "5.6.9" ethers "5.6.9"
@@ -9630,7 +9632,7 @@ onetime@^5.1.2:
dependencies: dependencies:
mimic-fn "^2.1.0" mimic-fn "^2.1.0"
open-graph-scraper@5.2.3, open-graph-scraper@^5.2.2: open-graph-scraper@5.2.3:
version "5.2.3" version "5.2.3"
resolved "https://registry.yarnpkg.com/open-graph-scraper/-/open-graph-scraper-5.2.3.tgz#8a84b4f48d42e18d9ec44453377499acf57cfe66" resolved "https://registry.yarnpkg.com/open-graph-scraper/-/open-graph-scraper-5.2.3.tgz#8a84b4f48d42e18d9ec44453377499acf57cfe66"
integrity sha512-OFKyI3Zv60onbwjUtwTdLwMB9P1O0+U2JV0HD4hHdwyKGwDhyM09udZVU5vEwe/PxI4MyPuVaxcdy1okc4SgWw== integrity sha512-OFKyI3Zv60onbwjUtwTdLwMB9P1O0+U2JV0HD4hHdwyKGwDhyM09udZVU5vEwe/PxI4MyPuVaxcdy1okc4SgWw==
@@ -12338,11 +12340,6 @@ tsutils@^3.21.0:
dependencies: dependencies:
tslib "^1.8.1" tslib "^1.8.1"
tunnel@0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==
type-check@^0.4.0, type-check@~0.4.0: type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0" version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"