Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
sspenst committed Jun 1, 2024
1 parent 5121264 commit 7d531f9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions components/level/reviews/formattedReview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ export default function FormattedReview({ hideBorder, inModal, level, onEditClic
<FormattedUser id={level ? `review-${level._id.toString()}` : 'review'} user={user} />
<FormattedDate ts={review.ts} />
</div>
{onEditClick && user && (
{user &&
<ReviewDropdown
inModal={inModal}
onEditClick={onEditClick}
userId={user._id.toString()}
/>
)}
}
</div>
{level && <FormattedLevelLink id={`review-${user?._id?.toString() ?? 'deleted'}`} level={level} />}
</div>
Expand Down
36 changes: 19 additions & 17 deletions components/level/reviews/reviewDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DeleteReviewModal from '../../modal/deleteReviewModal';

interface ReviewDropdownProps {
inModal?: boolean;
onEditClick: () => void;
onEditClick?: () => void;
userId: string;
}

Expand Down Expand Up @@ -44,22 +44,24 @@ export default function ReviewDropdown({ inModal, onEditClick, userId }: ReviewD
>
<Menu.Items className='absolute right-0 m-1 w-fit origin-top-right rounded-[10px] shadow-lg border z-20 bg-1 border-color-3'>
<div className='px-1 py-1'>
<Menu.Item>
{({ active }) => (
<div
className={classNames('flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3', { 'text-red-500': isNotAuthor })}
onClick={() => onEditClick()}
style={{
backgroundColor: active ? 'var(--bg-color-3)' : undefined,
}}
>
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' strokeWidth={1.5} stroke='currentColor' className='w-4 h-4'>
<path strokeLinecap='round' strokeLinejoin='round' d='M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125' />
</svg>
Edit
</div>
)}
</Menu.Item>
{onEditClick &&
<Menu.Item>
{({ active }) => (
<div
className={classNames('flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3', { 'text-red-500': isNotAuthor })}
onClick={() => onEditClick()}
style={{
backgroundColor: active ? 'var(--bg-color-3)' : undefined,
}}
>
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' strokeWidth={1.5} stroke='currentColor' className='w-4 h-4'>
<path strokeLinecap='round' strokeLinejoin='round' d='M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125' />
</svg>
Edit
</div>
)}
</Menu.Item>
}
<Menu.Item>
{({ active }) => (
<div
Expand Down

0 comments on commit 7d531f9

Please sign in to comment.