diff --git a/components/homepage/homeLoggedIn.tsx b/components/homepage/homeLoggedIn.tsx
index 227237a7f..138906fe5 100644
--- a/components/homepage/homeLoggedIn.tsx
+++ b/components/homepage/homeLoggedIn.tsx
@@ -18,8 +18,8 @@ import Card from '../cards/card';
import ChapterSelectCard from '../cards/chapterSelectCard';
import LevelSelect from '../cards/levelSelect';
import LoadingCard from '../cards/loadingCard';
-import FormattedReview from '../formatted/formattedReview';
import FormattedUser from '../formatted/formattedUser';
+import FormattedReview from '../level/reviews/formattedReview';
import LoadingSpinner from '../page/loadingSpinner';
import MultiSelectUser from '../page/multiSelectUser';
import RecommendedLevel from './recommendedLevel';
diff --git a/components/level/info/formattedLevelInfo.tsx b/components/level/info/formattedLevelInfo.tsx
index 58871cb38..88820766e 100644
--- a/components/level/info/formattedLevelInfo.tsx
+++ b/components/level/info/formattedLevelInfo.tsx
@@ -1,7 +1,7 @@
import { Tab } from '@headlessui/react';
import FormattedDate from '@root/components/formatted/formattedDate';
-import FormattedLevelReviews from '@root/components/formatted/formattedLevelReviews';
import Solved from '@root/components/level/info/solved';
+import FormattedLevelReviews from '@root/components/level/reviews/formattedLevelReviews';
import Image from 'next/image';
import React, { useContext, useState } from 'react';
import toast from 'react-hot-toast';
diff --git a/components/formatted/formattedLevelReviews.tsx b/components/level/reviews/formattedLevelReviews.tsx
similarity index 73%
rename from components/formatted/formattedLevelReviews.tsx
rename to components/level/reviews/formattedLevelReviews.tsx
index 67a2a0872..01a85f781 100644
--- a/components/formatted/formattedLevelReviews.tsx
+++ b/components/level/reviews/formattedLevelReviews.tsx
@@ -1,8 +1,7 @@
import React, { useContext, useEffect, useState } from 'react';
-import { AppContext } from '../../contexts/appContext';
-import { LevelContext } from '../../contexts/levelContext';
-import ReviewForm from '../forms/reviewForm';
-import FormattedReview from './formattedReview';
+import { AppContext } from '../../../contexts/appContext';
+import { LevelContext } from '../../../contexts/levelContext';
+import ReviewForm from './reviewForm';
interface FormattedLevelReviewsProps {
hideReviews?: boolean;
@@ -34,20 +33,7 @@ export default function FormattedLevelReviews({ inModal, hideReviews: hideOtherR
if (hideOtherReviews) { continue; }
reviewDivs.push(
-
+
);
}
}
@@ -60,7 +46,7 @@ export default function FormattedLevelReviews({ inModal, hideReviews: hideOtherR
<>{levelContext.reviews.length} review{levelContext.reviews.length !== 1 && 's'}>
}
)}
-
+
{hideReviews === undefined ? null : hideReviews ?
{level && }
diff --git a/components/level/reviews/reviewDropdown.tsx b/components/level/reviews/reviewDropdown.tsx
index f2a90dbc4..08c684960 100644
--- a/components/level/reviews/reviewDropdown.tsx
+++ b/components/level/reviews/reviewDropdown.tsx
@@ -1,4 +1,5 @@
import { Menu, Transition } from '@headlessui/react';
+import { AppContext } from '@root/contexts/appContext';
import { LevelContext } from '@root/contexts/levelContext';
import { PageContext } from '@root/contexts/pageContext';
import React, { Fragment, useContext, useEffect, useState } from 'react';
@@ -6,21 +7,23 @@ import DeleteReviewModal from '../../modal/deleteReviewModal';
interface ReviewDropdownProps {
onEditClick: () => void;
+ userId: string;
}
-export default function ReviewDropdown({ onEditClick }: ReviewDropdownProps) {
+export default function ReviewDropdown({ onEditClick, userId }: ReviewDropdownProps) {
const [isDeleteReviewOpen, setIsDeleteReviewOpen] = useState(false);
const levelContext = useContext(LevelContext);
const { setPreventKeyDownEvent } = useContext(PageContext);
+ const { user } = useContext(AppContext);
useEffect(() => {
setPreventKeyDownEvent(isDeleteReviewOpen);
}, [isDeleteReviewOpen, setPreventKeyDownEvent]);
return (<>
-