From 4c68e8f8c493733be426a905ae5db3dda885267b Mon Sep 17 00:00:00 2001 From: plebbitor Date: Sun, 16 Apr 2023 16:12:59 +0200 Subject: [PATCH] added useParams to Pending.jsx --- src/components/views/Pending.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/views/Pending.jsx b/src/components/views/Pending.jsx index 76aef2f1..b766b9cc 100644 --- a/src/components/views/Pending.jsx +++ b/src/components/views/Pending.jsx @@ -1,6 +1,7 @@ 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 { useAccountComment } from '@plebbit/plebbit-react-hooks'; import useGeneralStore from '../../hooks/stores/useGeneralStore'; import { Container, NavBar, Header, Break, PostForm, BoardForm } from '../styled/Board.styled'; import { ReplyFormLink, TopBar, BottomBar } from '../styled/Thread.styled'; @@ -20,7 +21,6 @@ const Pending = () => { const { defaultSubplebbits, isSettingsOpen, setIsSettingsOpen, - pendingComment, selectedAddress, setSelectedAddress, selectedStyle, selectedThread, @@ -28,7 +28,9 @@ const Pending = () => { showPostFormLink } = useGeneralStore(state => state); - const comment = pendingComment; + const { index } = useParams(); + + const comment = useAccountComment({commentIndex: index}); const [visible] = useState(true); const [errorMessage] = useState(null);