Hide rating from custom roadmaps which are not discoverable

feat/discover
Kamran Ahmed 5 months ago
parent fa8dd8d865
commit 75e933a6e4
  1. 5
      src/components/CustomRoadmap/CustomRoadmapRatingsModal.tsx
  2. 4
      src/components/CustomRoadmap/RoadmapHeader.tsx

@ -1,10 +1,7 @@
import { useState, type CSSProperties } from 'react';
import { formatCommaNumber } from '../../lib/number';
import { useState } from 'react';
import { Modal } from '../Modal';
import { Rating } from '../Rating/Rating';
import type { RoadmapDocument } from './CreateRoadmap/CreateRoadmapModal';
import { RateRoadmapForm } from './RateRoadmapForm';
import { cn } from '../../lib/classname';
import { ListRoadmapRatings } from './ListRoadmapRatings';
type ActiveTab = 'ratings' | 'feedback';

@ -8,7 +8,6 @@ import { httpDelete, httpPut } from '../../lib/http';
import { type TeamResourceConfig } from '../CreateTeam/RoadmapSelector';
import { useToast } from '../../hooks/use-toast';
import { RoadmapActionButton } from './RoadmapActionButton';
import { Lock, Pencil, PenSquare, Shapes } from 'lucide-react';
import { ShareRoadmapButton } from '../ShareRoadmapButton.tsx';
import { CustomRoadmapAlert } from './CustomRoadmapAlert.tsx';
import { CustomRoadmapRatings } from './CustomRoadmapRatings.tsx';
@ -29,6 +28,7 @@ export function RoadmapHeader(props: RoadmapHeaderProps) {
visibility,
ratings,
unseenRatingCount,
showcaseStatus,
} = useStore(currentRoadmap) || {};
const [isSharing, setIsSharing] = useState(false);
@ -172,12 +172,14 @@ export function RoadmapHeader(props: RoadmapHeaderProps) {
</>
)}
{((ratings?.average || 0) > 0 || showcaseStatus === 'visible') && (
<CustomRoadmapRatings
roadmapSlug={roadmapSlug!}
ratings={ratings!}
canManage={$canManageCurrentRoadmap}
unseenRatingCount={unseenRatingCount || 0}
/>
)}
</div>
</div>

Loading…
Cancel
Save