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} />