From 75e933a6e487d58f4ead8e4f3ae3ab2a802be23a Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 30 Jul 2024 03:28:12 +0100 Subject: [PATCH] Hide rating from custom roadmaps which are not discoverable --- .../CustomRoadmap/CustomRoadmapRatingsModal.tsx | 5 +---- src/components/CustomRoadmap/RoadmapHeader.tsx | 16 +++++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/CustomRoadmap/CustomRoadmapRatingsModal.tsx b/src/components/CustomRoadmap/CustomRoadmapRatingsModal.tsx index f0c5f5812..9424ec268 100644 --- a/src/components/CustomRoadmap/CustomRoadmapRatingsModal.tsx +++ b/src/components/CustomRoadmap/CustomRoadmapRatingsModal.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'; diff --git a/src/components/CustomRoadmap/RoadmapHeader.tsx b/src/components/CustomRoadmap/RoadmapHeader.tsx index 69e30e3cb..4d689b4d0 100644 --- a/src/components/CustomRoadmap/RoadmapHeader.tsx +++ b/src/components/CustomRoadmap/RoadmapHeader.tsx @@ -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') && ( + + )}