From b0746be9df89c6b0fccb1e45649d037dd6a4f6ba Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Mon, 7 Dec 2020 08:48:03 +1100 Subject: [PATCH] quick new part fix --- web/src/components/PartProfile/PartProfile.js | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/web/src/components/PartProfile/PartProfile.js b/web/src/components/PartProfile/PartProfile.js index 03397a0..e93a0e5 100644 --- a/web/src/components/PartProfile/PartProfile.js +++ b/web/src/components/PartProfile/PartProfile.js @@ -14,8 +14,6 @@ const PartProfile = ({ userPart, isEditable, onSave, - loading, - error, onReaction, onComment, }) => { @@ -23,13 +21,14 @@ const PartProfile = ({ const { currentUser } = useAuth() const canEdit = currentUser?.sub === userPart.id const part = userPart?.Part + console.log(part) const emotes = countEmotes(part?.Reaction) const userEmotes = part?.userReactions.map(({ emote }) => emote) useEffect(() => { isEditable && !canEdit && navigate( - routes.part2({ userName: userPart.userName, partTitle: part.title }) + routes.part2({ userName: userPart.userName, partTitle: part?.title }) ) }, [currentUser]) const [input, setInput] = useState({ @@ -55,7 +54,7 @@ const PartProfile = ({ return } navigate( - routes.editPart2({ userName: userPart.userName, partTitle: part.title }) + routes.editPart2({ userName: userPart?.userName, partTitle: part?.title }) ) } return ( @@ -70,11 +69,11 @@ const PartProfile = ({ className="rounded-half rounded-br-lg shadow-md border-2 border-gray-200 border-solid" onImageUpload={() => {}} aspectRatio={1} - imageUrl={userPart.image} + imageUrl={userPart?.image} width={300} />

- + {userPart?.name}

@@ -92,12 +91,12 @@ const PartProfile = ({ document.getElementById('comment-section').scrollIntoView() }} > - {userPart.Part.Comment.length} Comments + {userPart?.Part?.Comment.length} Comments