added useParams to Pending.jsx

This commit is contained in:
plebbitor
2023-04-16 16:12:59 +02:00
parent 2f1994f062
commit 4c68e8f8c4
+5 -3
View File
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Link, useNavigate } from 'react-router-dom'; import { Link, useNavigate, useParams } from 'react-router-dom';
import { Tooltip } from 'react-tooltip'; import { Tooltip } from 'react-tooltip';
import { useAccountComment } from '@plebbit/plebbit-react-hooks';
import useGeneralStore from '../../hooks/stores/useGeneralStore'; import useGeneralStore from '../../hooks/stores/useGeneralStore';
import { Container, NavBar, Header, Break, PostForm, BoardForm } from '../styled/Board.styled'; import { Container, NavBar, Header, Break, PostForm, BoardForm } from '../styled/Board.styled';
import { ReplyFormLink, TopBar, BottomBar } from '../styled/Thread.styled'; import { ReplyFormLink, TopBar, BottomBar } from '../styled/Thread.styled';
@@ -20,7 +21,6 @@ const Pending = () => {
const { const {
defaultSubplebbits, defaultSubplebbits,
isSettingsOpen, setIsSettingsOpen, isSettingsOpen, setIsSettingsOpen,
pendingComment,
selectedAddress, setSelectedAddress, selectedAddress, setSelectedAddress,
selectedStyle, selectedStyle,
selectedThread, selectedThread,
@@ -28,7 +28,9 @@ const Pending = () => {
showPostFormLink showPostFormLink
} = useGeneralStore(state => state); } = useGeneralStore(state => state);
const comment = pendingComment; const { index } = useParams();
const comment = useAccountComment({commentIndex: index});
const [visible] = useState(true); const [visible] = useState(true);
const [errorMessage] = useState(null); const [errorMessage] = useState(null);