Add AI announcement on homepage

pull/5320/head^2
Kamran Ahmed 9 months ago
parent 18db62748c
commit 58a5d27854
  1. 16
      src/components/AIAnnouncement.tsx
  2. 4
      src/components/HeroSection/EmptyProgress.tsx
  3. 6
      src/components/HeroSection/HeroRoadmaps.tsx
  4. 8
      src/components/HeroSection/HeroSection.astro

@ -0,0 +1,16 @@
type AIAnnouncementProps = {};
export function AIAnnouncement(props: AIAnnouncementProps) {
return (
<a
className="rounded-md border border-dashed border-green-600 px-3 py-1.5 text-green-400 transition-colors hover:border-green-400 hover:text-green-200"
href="/ai"
>
<span className="relative -top-[1px] mr-1 text-xs font-semibold uppercase text-white">
New
</span>{' '}
<span className={'hidden sm:inline'}>Generate visual roadmaps with AI</span>
<span className={'inline text-sm sm:hidden'}>AI Roadmap Generator!</span>
</a>
);
}

@ -1,5 +1,5 @@
import { CheckIcon } from '../ReactIcons/CheckIcon'; import { CheckIcon } from '../ReactIcons/CheckIcon';
import { TeamAnnouncement } from '../TeamAnnouncement'; import { AIAnnouncement } from '../AIAnnouncement.tsx';
type EmptyProgressProps = { type EmptyProgressProps = {
title?: string; title?: string;
@ -23,7 +23,7 @@ export function EmptyProgress(props: EmptyProgressProps) {
<p className={'text-sm text-gray-400 sm:text-base'}>{message}</p> <p className={'text-sm text-gray-400 sm:text-base'}>{message}</p>
<p className="mt-5"> <p className="mt-5">
<TeamAnnouncement /> <AIAnnouncement />
</p> </p>
</div> </div>
); );

@ -7,7 +7,7 @@ import { MapIcon, Users2 } from 'lucide-react';
import { CreateRoadmapButton } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapButton'; import { CreateRoadmapButton } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapButton';
import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal'; import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal';
import { type ReactNode, useState } from 'react'; import { type ReactNode, useState } from 'react';
import { TeamAnnouncement } from '../TeamAnnouncement'; import { AIAnnouncement } from '../AIAnnouncement.tsx';
type ProgressRoadmapProps = { type ProgressRoadmapProps = {
url: string; url: string;
@ -97,7 +97,7 @@ export function HeroRoadmaps(props: ProgressListProps) {
return ( return (
<div className="relative pb-12 pt-4 sm:pt-7"> <div className="relative pb-12 pt-4 sm:pt-7">
<p className="mb-7 mt-2 text-sm"> <p className="mb-7 mt-2 text-sm">
<TeamAnnouncement /> <AIAnnouncement />
</p> </p>
{isCreatingRoadmap && ( {isCreatingRoadmap && (
<CreateRoadmapModal <CreateRoadmapModal
@ -187,7 +187,7 @@ export function HeroRoadmaps(props: ProgressListProps) {
const currentTeam: UserProgressResponse[0]['team'] = const currentTeam: UserProgressResponse[0]['team'] =
teamRoadmaps?.[teamName]?.[0]?.team; teamRoadmaps?.[teamName]?.[0]?.team;
const roadmapsList = teamRoadmaps[teamName].filter( const roadmapsList = teamRoadmaps[teamName].filter(
(roadmap) => !!roadmap.resourceTitle (roadmap) => !!roadmap.resourceTitle,
); );
const canManageTeam = ['admin', 'manager'].includes(currentTeam?.role!); const canManageTeam = ['admin', 'manager'].includes(currentTeam?.role!);

@ -1,17 +1,17 @@
--- ---
import { FavoriteRoadmaps } from './FavoriteRoadmaps'; import { FavoriteRoadmaps } from './FavoriteRoadmaps';
import {TeamAnnouncement} from "../TeamAnnouncement"; import { AIAnnouncement } from "../AIAnnouncement";
--- ---
<div <div
class='min-h-auto relative min-h-[192px] border-b border-b-[#1e293c] sm:min-h-[281px] transition-all' class='min-h-auto relative min-h-[192px] border-b border-b-[#1e293c] transition-all sm:min-h-[281px]'
> >
<div <div
class='container px-5 py-6 pb-14 text-left transition-opacity duration-300 sm:px-0 sm:py-20 sm:text-center' class='container px-5 py-6 pb-14 text-left transition-opacity duration-300 sm:px-0 sm:py-20 sm:text-center'
id='hero-text' id='hero-text'
> >
<p class='-mt-4 sm:-mt-10 mb-7'> <p class='-mt-4 mb-7 sm:-mt-10'>
<TeamAnnouncement /> <AIAnnouncement />
</p> </p>
<h1 <h1

Loading…
Cancel
Save