revert test

This commit is contained in:
plebbitor
2023-03-22 13:17:38 +01:00
parent 0717921b94
commit 35e37160f9
7 changed files with 61 additions and 26 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
"@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-logger": "https://github.com/plebbit/plebbit-logger.git", "@plebbit/plebbit-logger": "https://github.com/plebbit/plebbit-logger.git",
"@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#1ee06ac4dae8f2fc330205031d86fc959d431fe0", "@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#b4428eb09249497c8b9584e9b56941876de76ab7",
"@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",
+3 -3
View File
@@ -7,7 +7,7 @@ import ImageBanner from '../ImageBanner';
import PostLoader from '../PostLoader'; import PostLoader from '../PostLoader';
import ReplyModal from '../ReplyModal'; import ReplyModal from '../ReplyModal';
import SettingsModal from '../SettingsModal'; import SettingsModal from '../SettingsModal';
import { useFeed, usePublishComment } from '@plebbit/plebbit-react-hooks'; import { useFeed, useAccountsActions } from '@plebbit/plebbit-react-hooks';
import InfiniteScroll from 'react-infinite-scroller'; import InfiniteScroll from 'react-infinite-scroller';
import { Tooltip } from 'react-tooltip'; import { Tooltip } from 'react-tooltip';
import handleStyleChange from '../../utils/handleStyleChange'; import handleStyleChange from '../../utils/handleStyleChange';
@@ -34,7 +34,7 @@ const Board = () => {
const [name, setName] = useState(''); const [name, setName] = useState('');
const [subject, setSubject] = useState(''); const [subject, setSubject] = useState('');
const [comment, setComment] = useState(''); const [comment, setComment] = useState('');
const { publishComment } = usePublishComment(); const { publishComment } = useAccountsActions();
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('');
@@ -42,7 +42,7 @@ const Board = () => {
const [prevScrollPos, setPrevScrollPos] = useState(0); const [prevScrollPos, setPrevScrollPos] = useState(0);
const [visible, setVisible] = useState(true); const [visible, setVisible] = useState(true);
const [endIndex, setEndIndex] = useState(2); const [endIndex, setEndIndex] = useState(2);
const { feed, hasMore, loadMore } = useFeed({subplebbitAddresses: ['test2'], sortType: 'new'}); const { feed, hasMore, loadMore } = useFeed([`${selectedAddress}`], 'new');
const [selectedFeed, setSelectedFeed] = useState(feed); const [selectedFeed, setSelectedFeed] = useState(feed);
const renderedFeed = selectedFeed.slice(0, endIndex); const renderedFeed = selectedFeed.slice(0, endIndex);
const { subplebbitAddress } = useParams(); const { subplebbitAddress } = useParams();
+3 -3
View File
@@ -4,7 +4,7 @@ import useAppStore from '../../useAppStore';
import { Container, NavBar, Header, Break, PostForm, PostFormLink, PostFormTable } from './styles/Board.styled'; import { Container, NavBar, Header, Break, PostForm, PostFormLink, PostFormTable } from './styles/Board.styled';
import { TopBar } from './styles/Thread.styled'; import { TopBar } from './styles/Thread.styled';
import { Threads } from './styles/Catalog.styled'; import { Threads } from './styles/Catalog.styled';
import { useFeed, usePublishComment } from '@plebbit/plebbit-react-hooks'; import { useFeed, useAccountsActions } from '@plebbit/plebbit-react-hooks';
import ImageBanner from '../ImageBanner'; import ImageBanner from '../ImageBanner';
import CaptchaModal from '../CaptchaModal'; import CaptchaModal from '../CaptchaModal';
import CatalogLoader from '../CatalogLoader'; import CatalogLoader from '../CatalogLoader';
@@ -32,13 +32,13 @@ const Catalog = () => {
const [name, setName] = useState(''); const [name, setName] = useState('');
const [subject, setSubject] = useState(''); const [subject, setSubject] = useState('');
const [comment, setComment] = useState(''); const [comment, setComment] = useState('');
const { publishComment } = usePublishComment(); const { publishComment } = useAccountsActions();
const [isCaptchaOpen, setIsCaptchaOpen] = useState(false); const [isCaptchaOpen, setIsCaptchaOpen] = useState(false);
const [captchaImage, setCaptchaImage] = useState(''); const [captchaImage, setCaptchaImage] = useState('');
const navigate = useNavigate(); const navigate = useNavigate();
const [prevScrollPos, setPrevScrollPos] = useState(0); const [prevScrollPos, setPrevScrollPos] = useState(0);
const [visible, setVisible] = useState(true); const [visible, setVisible] = useState(true);
const { feed, hasMore, loadMore } = useFeed({subplebbitAddresses: [`thisIsATest`], sortType: 'new'}); const { feed, hasMore, loadMore } = useFeed([`${selectedAddress}`], 'new');
const { subplebbitAddress } = useParams(); const { subplebbitAddress } = useParams();
const handleClickForm = useClickForm(); const handleClickForm = useClickForm();
+1 -1
View File
@@ -66,7 +66,7 @@ const Home = () => {
{defaultSubplebbits.map(subplebbit => ( {defaultSubplebbits.map(subplebbit => (
<div className="board" key={subplebbit.address}> <div className="board" key={subplebbit.address}>
<div className="board-title">{subplebbit.title}</div> <div className="board-title">{subplebbit.title}</div>
<Link to={`/test2`} onClick={() => { <Link to={`/${subplebbit.address}`} onClick={() => {
handleClick(subplebbit.title, subplebbit.address); handleClick(subplebbit.title, subplebbit.address);
}} > }} >
<img alt="board logo" src="/assets/plebchan.png" /> <img alt="board logo" src="/assets/plebchan.png" />
+3 -7
View File
@@ -3,7 +3,7 @@ import { Link, useNavigate, useParams } from 'react-router-dom';
import useAppStore from '../../useAppStore'; import useAppStore from '../../useAppStore';
import { Container, NavBar, Header, Break, PostForm, PostFormTable, BoardForm } from './styles/Board.styled'; import { Container, NavBar, Header, Break, PostForm, PostFormTable, BoardForm } from './styles/Board.styled';
import { ReplyFormLink, TopBar, BottomBar } from './styles/Thread.styled'; import { ReplyFormLink, TopBar, BottomBar } from './styles/Thread.styled';
import { useComment, usePublishComment } from '@plebbit/plebbit-react-hooks'; import { useComment, useAccountsActions } from '@plebbit/plebbit-react-hooks';
import { Tooltip } from 'react-tooltip'; import { Tooltip } from 'react-tooltip';
import CaptchaModal from '../CaptchaModal'; import CaptchaModal from '../CaptchaModal';
import ImageBanner from '../ImageBanner'; import ImageBanner from '../ImageBanner';
@@ -35,21 +35,17 @@ const Thread = () => {
const [name, setName] = useState(''); const [name, setName] = useState('');
const [subject, setSubject] = useState(''); const [subject, setSubject] = useState('');
const [commentContent, setCommentContent] = useState(''); const [commentContent, setCommentContent] = useState('');
const { publishComment } = usePublishComment(); const { publishComment } = useAccountsActions();
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('');
const navigate = useNavigate(); const navigate = useNavigate();
const [prevScrollPos, setPrevScrollPos] = useState(0); const [prevScrollPos, setPrevScrollPos] = useState(0);
const [visible, setVisible] = useState(true); const [visible, setVisible] = useState(true);
const comment = useComment({selectedThread}); const comment = useComment(selectedThread);
const { subplebbitAddress, threadCid } = useParams(); const { subplebbitAddress, threadCid } = useParams();
const handleClickForm = useClickForm(); const handleClickForm = useClickForm();
useEffect(() => {
console.log(comment);
}, [comment]);
// temporary title from JSON, gets subplebbitAddress and threadCid from URL // temporary title from JSON, gets subplebbitAddress and threadCid from URL
useEffect(() => { useEffect(() => {
+2 -2
View File
@@ -1,6 +1,6 @@
const getDate = (commentTimestamp) => { const getDate = (commentTimestamp) => {
const locale = Intl.DateTimeFormat().resolvedOptions().locale; const locale = Intl.DateTimeFormat().resolvedOptions().locale;
const string = /*new Intl.DateTimeFormat(locale, { const string = new Intl.DateTimeFormat(locale, {
hour12: false, hour12: false,
year: '2-digit', year: '2-digit',
month: '2-digit', month: '2-digit',
@@ -9,7 +9,7 @@ const getDate = (commentTimestamp) => {
hour: '2-digit', hour: '2-digit',
minute: '2-digit', minute: '2-digit',
second: '2-digit' second: '2-digit'
}).format(new Date(commentTimestamp * 1000))*/ ""; }).format(new Date(commentTimestamp * 1000));
if (locale.startsWith('ar')) { if (locale.startsWith('ar')) {
return string return string
} }
+48 -9
View File
@@ -2417,6 +2417,40 @@
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#bea28433713a50fca9a4d2a44f75fc6cda69c0bf":
version "0.0.3"
resolved "https://github.com/plebbit/plebbit-js.git#bea28433713a50fca9a4d2a44f75fc6cda69c0bf"
dependencies:
"@keyv/sqlite" "3.6.2"
"@plebbit/plebbit-logger" "github:plebbit/plebbit-logger"
"@types/node-fetch" "2.6.2"
"@types/proper-lockfile" "4.1.2"
"@types/uuid" "8.3.4"
assert "2.0.0"
async-wait-until "2.0.12"
buffer "6.0.3"
captcha-canvas "3.2.1"
err-code "3.0.1"
ethers "5.7.2"
file-type "16.5.4"
form-data "4.0.0"
ipfs-http-client "56.0.3"
ipfs-only-hash "4.0.0"
is-ipfs "6.0.2"
jose "4.11.0"
js-sha256 "0.9.0"
keyv "4.5.2"
knex "2.3.0"
libp2p-crypto "0.21.2"
lodash-es "4.17.21"
peer-id "0.16.0"
proper-lockfile "github:Rinse12/node-proper-lockfile"
safe-stable-stringify "2.4.1"
skia-canvas "1.0.0"
sqlite3 "5.1.2"
tinycache "1.1.2"
uuid "9.0.0"
"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#f1279f55558db3cdf0459be786217b9bfe845194": "@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#f1279f55558db3cdf0459be786217b9bfe845194":
version "0.0.3" version "0.0.3"
resolved "https://github.com/plebbit/plebbit-js.git#f1279f55558db3cdf0459be786217b9bfe845194" resolved "https://github.com/plebbit/plebbit-js.git#f1279f55558db3cdf0459be786217b9bfe845194"
@@ -2465,9 +2499,9 @@
dependencies: dependencies:
debug "4.3.3" debug "4.3.3"
"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks": "@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#1ee06ac4dae8f2fc330205031d86fc959d431fe0":
version "0.0.1" version "0.0.1"
resolved "https://github.com/plebbit/plebbit-react-hooks#1ee06ac4dae8f2fc330205031d86fc959d431fe0" resolved "https://github.com/plebbit/plebbit-react-hooks.git#1ee06ac4dae8f2fc330205031d86fc959d431fe0"
dependencies: dependencies:
"@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#f1279f55558db3cdf0459be786217b9bfe845194" "@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#f1279f55558db3cdf0459be786217b9bfe845194"
"@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git" "@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git"
@@ -2480,19 +2514,16 @@
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#1ee06ac4dae8f2fc330205031d86fc959d431fe0": "@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#b4428eb09249497c8b9584e9b56941876de76ab7":
version "0.0.1" version "0.0.1"
uid "1ee06ac4dae8f2fc330205031d86fc959d431fe0" resolved "https://github.com/plebbit/plebbit-react-hooks.git#b4428eb09249497c8b9584e9b56941876de76ab7"
resolved "https://github.com/plebbit/plebbit-react-hooks.git#1ee06ac4dae8f2fc330205031d86fc959d431fe0"
dependencies: dependencies:
"@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#f1279f55558db3cdf0459be786217b9bfe845194" "@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#bea28433713a50fca9a4d2a44f75fc6cda69c0bf"
"@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git" "@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git"
"@types/uuid" "8.3.4"
assert "2.0.0" assert "2.0.0"
ethers "5.6.9" ethers "5.6.9"
localforage "1.10.0" localforage "1.10.0"
lodash.isequal "4.5.0"
memoizee "0.4.15"
quick-lru "5.1.1"
uuid "8.3.2" uuid "8.3.2"
zustand "4.0.0" zustand "4.0.0"
@@ -9954,6 +9985,14 @@ prop-types@^15.5.8, prop-types@^15.7.2, prop-types@^15.8.1:
object-assign "^4.1.1" object-assign "^4.1.1"
react-is "^16.13.1" react-is "^16.13.1"
"proper-lockfile@github:Rinse12/node-proper-lockfile":
version "4.1.2"
resolved "https://codeload.github.com/Rinse12/node-proper-lockfile/tar.gz/072ee9e37d52858cf8410ce55c281599cef1fb92"
dependencies:
graceful-fs "^4.2.4"
retry "^0.12.0"
signal-exit "^3.0.2"
"proper-lockfile@github:plebbit/node-proper-lockfile": "proper-lockfile@github:plebbit/node-proper-lockfile":
version "4.1.2" version "4.1.2"
resolved "https://codeload.github.com/plebbit/node-proper-lockfile/tar.gz/072ee9e37d52858cf8410ce55c281599cef1fb92" resolved "https://codeload.github.com/plebbit/node-proper-lockfile/tar.gz/072ee9e37d52858cf8410ce55c281599cef1fb92"