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
+3 -3
View File
@@ -7,7 +7,7 @@ import ImageBanner from '../ImageBanner';
import PostLoader from '../PostLoader';
import ReplyModal from '../ReplyModal';
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 { Tooltip } from 'react-tooltip';
import handleStyleChange from '../../utils/handleStyleChange';
@@ -34,7 +34,7 @@ const Board = () => {
const [name, setName] = useState('');
const [subject, setSubject] = useState('');
const [comment, setComment] = useState('');
const { publishComment } = usePublishComment();
const { publishComment } = useAccountsActions();
const [isCaptchaOpen, setIsCaptchaOpen] = useState(false);
const [isReplyOpen, setIsReplyOpen] = useState(false);
const [captchaImage, setCaptchaImage] = useState('');
@@ -42,7 +42,7 @@ const Board = () => {
const [prevScrollPos, setPrevScrollPos] = useState(0);
const [visible, setVisible] = useState(true);
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 renderedFeed = selectedFeed.slice(0, endIndex);
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 { TopBar } from './styles/Thread.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 CaptchaModal from '../CaptchaModal';
import CatalogLoader from '../CatalogLoader';
@@ -32,13 +32,13 @@ const Catalog = () => {
const [name, setName] = useState('');
const [subject, setSubject] = useState('');
const [comment, setComment] = useState('');
const { publishComment } = usePublishComment();
const { publishComment } = useAccountsActions();
const [isCaptchaOpen, setIsCaptchaOpen] = useState(false);
const [captchaImage, setCaptchaImage] = useState('');
const navigate = useNavigate();
const [prevScrollPos, setPrevScrollPos] = useState(0);
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 handleClickForm = useClickForm();
+1 -1
View File
@@ -66,7 +66,7 @@ const Home = () => {
{defaultSubplebbits.map(subplebbit => (
<div className="board" key={subplebbit.address}>
<div className="board-title">{subplebbit.title}</div>
<Link to={`/test2`} onClick={() => {
<Link to={`/${subplebbit.address}`} onClick={() => {
handleClick(subplebbit.title, subplebbit.address);
}} >
<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 { Container, NavBar, Header, Break, PostForm, PostFormTable, BoardForm } from './styles/Board.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 CaptchaModal from '../CaptchaModal';
import ImageBanner from '../ImageBanner';
@@ -35,21 +35,17 @@ const Thread = () => {
const [name, setName] = useState('');
const [subject, setSubject] = useState('');
const [commentContent, setCommentContent] = useState('');
const { publishComment } = usePublishComment();
const { publishComment } = useAccountsActions();
const [isCaptchaOpen, setIsCaptchaOpen] = useState(false);
const [isReplyOpen, setIsReplyOpen] = useState(false);
const [captchaImage, setCaptchaImage] = useState('');
const navigate = useNavigate();
const [prevScrollPos, setPrevScrollPos] = useState(0);
const [visible, setVisible] = useState(true);
const comment = useComment({selectedThread});
const comment = useComment(selectedThread);
const { subplebbitAddress, threadCid } = useParams();
const handleClickForm = useClickForm();
useEffect(() => {
console.log(comment);
}, [comment]);
// temporary title from JSON, gets subplebbitAddress and threadCid from URL
useEffect(() => {
+2 -2
View File
@@ -1,6 +1,6 @@
const getDate = (commentTimestamp) => {
const locale = Intl.DateTimeFormat().resolvedOptions().locale;
const string = /*new Intl.DateTimeFormat(locale, {
const string = new Intl.DateTimeFormat(locale, {
hour12: false,
year: '2-digit',
month: '2-digit',
@@ -9,7 +9,7 @@ const getDate = (commentTimestamp) => {
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
}).format(new Date(commentTimestamp * 1000))*/ "";
}).format(new Date(commentTimestamp * 1000));
if (locale.startsWith('ar')) {
return string
}