diff --git a/src/components/RoadmapHeader.astro b/src/components/RoadmapHeader.astro index 17fff115a..798f92008 100644 --- a/src/components/RoadmapHeader.astro +++ b/src/components/RoadmapHeader.astro @@ -14,6 +14,7 @@ import { ScheduleButton } from './Schedule/ScheduleButton'; import { ShareRoadmapButton } from './ShareRoadmapButton'; import { TabLink } from './TabLink'; import { PersonalizedRoadmap } from './PersonalizedRoadmap/PersonalizedRoadmap'; +import RoadmapFeedbackAlert from './Roadmaps/RoadmapFeedbackAlert.astro'; export interface Props { title: string; @@ -29,6 +30,7 @@ export interface Props { coursesCount?: number; hasAIChat?: boolean; isForkable?: boolean; + isNew?: boolean; activeTab?: 'roadmap' | 'projects' | 'courses'; } @@ -41,6 +43,7 @@ const { projectCount = 0, activeTab = 'roadmap', coursesCount = 0, + isNew = false, } = Astro.props; const hasCourses = coursesCount > 0; @@ -65,6 +68,8 @@ const hasProjects = projectCount > 0; ) } + {isNew && } +
diff --git a/src/components/Roadmaps/RoadmapFeedbackAlert.astro b/src/components/Roadmaps/RoadmapFeedbackAlert.astro new file mode 100644 index 000000000..239ec0c60 --- /dev/null +++ b/src/components/Roadmaps/RoadmapFeedbackAlert.astro @@ -0,0 +1,37 @@ +--- +import { Bell } from 'lucide-react'; + +export interface Props { + roadmapId: string; + title: string; +} + +const { roadmapId, title } = Astro.props; + +const issueTitle = encodeURIComponent(`[New Roadmap Feedback] ${title}`); +const roadmapUrl = encodeURIComponent(`https://roadmap.sh/${roadmapId}`); +const feedbackUrl = `https://github.com/kamranahmedse/developer-roadmap/issues/new?template=01-suggest-changes.yml&title=${issueTitle}&url=${roadmapUrl}`; +--- + + diff --git a/src/pages/[roadmapId]/index.astro b/src/pages/[roadmapId]/index.astro index b66c5d39c..74d4beb6c 100644 --- a/src/pages/[roadmapId]/index.astro +++ b/src/pages/[roadmapId]/index.astro @@ -7,6 +7,7 @@ import { ShareIcons } from '../../components/ShareIcons/ShareIcons'; import { TopicDetail } from '../../components/TopicDetail/TopicDetail'; import { UserProgressModal } from '../../components/UserProgress/UserProgressModal'; import BaseLayout from '../../layouts/BaseLayout.astro'; +import { isNewRoadmap } from '../../queries/official-roadmap'; import { generateArticleSchema, generateFAQSchema, @@ -75,6 +76,8 @@ if (faqs.length) { const projects = await listOfficialProjects({ roadmapId }); const courses = roadmapData.courses || []; + +const isNew = isNewRoadmap(roadmapData.createdAt); ---