From d2f372fd6fe1660a829eb6124801d1cd91cecbcc Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 1 Mar 2024 17:21:06 +0000 Subject: [PATCH] Add community roadmap alert --- .../CustomRoadmap/CustomRoadmapAlert.tsx | 55 +++++++++++++++++++ .../CustomRoadmap/RoadmapHeader.tsx | 3 + src/components/NavigationDropdown.tsx | 1 - src/env.d.ts | 2 +- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/components/CustomRoadmap/CustomRoadmapAlert.tsx diff --git a/src/components/CustomRoadmap/CustomRoadmapAlert.tsx b/src/components/CustomRoadmap/CustomRoadmapAlert.tsx new file mode 100644 index 000000000..ead638713 --- /dev/null +++ b/src/components/CustomRoadmap/CustomRoadmapAlert.tsx @@ -0,0 +1,55 @@ +import { BadgeCheck, MessageCircleHeart, PencilRuler } from 'lucide-react'; +import { showLoginPopup } from '../../lib/popup.ts'; +import { isLoggedIn } from '../../lib/jwt.ts'; +import { useState } from 'react'; +import { CreateRoadmapModal } from './CreateRoadmap/CreateRoadmapModal.tsx'; + +export function CustomRoadmapAlert() { + const [isCreatingRoadmap, setIsCreatingRoadmap] = useState(false); + + return ( + <> + {isCreatingRoadmap && ( + { + setIsCreatingRoadmap(false); + }} + /> + )} +
+

+ Community Roadmap +

+

+ This is a custom roadmap made by community and isn't verified by{' '} + roadmap.sh +

+
+ + + Visit Official Roadmaps + + · + +
+ + +
+ + ); +} diff --git a/src/components/CustomRoadmap/RoadmapHeader.tsx b/src/components/CustomRoadmap/RoadmapHeader.tsx index a59abb7e6..4c4c059fa 100644 --- a/src/components/CustomRoadmap/RoadmapHeader.tsx +++ b/src/components/CustomRoadmap/RoadmapHeader.tsx @@ -12,6 +12,7 @@ import { Lock, Shapes } from 'lucide-react'; import { Modal } from '../Modal'; import { ShareSuccess } from '../ShareOptions/ShareSuccess'; import { ShareRoadmapButton } from '../ShareRoadmapButton.tsx'; +import { CustomRoadmapAlert } from './CustomRoadmapAlert.tsx'; type RoadmapHeaderProps = {}; @@ -89,6 +90,8 @@ export function RoadmapHeader(props: RoadmapHeaderProps) { return (
+ {!$canManageCurrentRoadmap && } + {creator?.name && (
interface ImportMetaEnv { GITHUB_SHA: string;