fix/navigation
Arik Chakma 4 weeks ago
parent 5a2101e244
commit 6ab4c647ef
  1. 27
      src/components/Projects/ProjectTabs.tsx
  2. 7
      src/pages/projects/[projectId]/index.astro
  3. 1
      src/pages/projects/[projectId]/solutions.astro

@ -1,13 +1,5 @@
import { cn } from '../../lib/classname'; import { cn } from '../../lib/classname';
import { import { ArrowLeft, Blocks, type LucideIcon, Text } from 'lucide-react';
ArrowLeft,
Blocks,
BoxSelect,
type LucideIcon,
StepBackIcon,
StickyNote,
Text,
} from 'lucide-react';
export const allowedProjectTabs = ['details', 'solutions'] as const; export const allowedProjectTabs = ['details', 'solutions'] as const;
export type AllowedProjectTab = (typeof allowedProjectTabs)[number]; export type AllowedProjectTab = (typeof allowedProjectTabs)[number];
@ -53,15 +45,20 @@ export function ProjectTabs(props: ProjectTabsProps) {
return ( return (
<div className="my-3 flex flex-row flex-wrap items-center gap-1.5 overflow-hidden rounded-md border bg-white px-2.5 text-sm"> <div className="my-3 flex flex-row flex-wrap items-center gap-1.5 overflow-hidden rounded-md border bg-white px-2.5 text-sm">
<a <button
href={`/${parentRoadmapId}/projects`} onClick={(e) => {
className={ if (window.history.length > 1) {
'-ml-1.5 flex items-center rounded-md bg-gray-300 px-2 py-1.5 text-xs tracking-wide text-black hover:bg-gray-400/60' window.history.back();
} return;
}
window.location.href = `/${parentRoadmapId}/projects`;
}}
className="-ml-1.5 flex items-center rounded-md bg-gray-300 px-2 py-1.5 text-xs tracking-wide text-black hover:bg-gray-400/60"
> >
<ArrowLeft className="mr-1 inline-block h-3.5 w-3.5" strokeWidth={2} /> <ArrowLeft className="mr-1 inline-block h-3.5 w-3.5" strokeWidth={2} />
<span className="hidden sm:inline">Back to Projects</span> <span className="hidden sm:inline">Back to Projects</span>
</a> </button>
<TabButton <TabButton
text={'Project Detail'} text={'Project Detail'}
icon={Text} icon={Text}

@ -49,7 +49,12 @@ const parentRoadmapId = projectData?.roadmapIds?.[0] || '';
> >
<div class='bg-gray-50'> <div class='bg-gray-50'>
<div class='container'> <div class='container'>
<ProjectTabs parentRoadmapId={parentRoadmapId} projectId={projectId} activeTab='details' /> <ProjectTabs
parentRoadmapId={parentRoadmapId}
projectId={projectId}
activeTab='details'
client:load
/>
<div <div
class='mb-4 rounded-lg border bg-gradient-to-b from-gray-100 to-white to-10% p-4 py-2 sm:p-5' class='mb-4 rounded-lg border bg-gradient-to-b from-gray-100 to-white to-10% p-4 py-2 sm:p-5'

@ -52,6 +52,7 @@ const githubUrl = `https://github.com/kamranahmedse/developer-roadmap/tree/maste
parentRoadmapId={parentRoadmapId} parentRoadmapId={parentRoadmapId}
projectId={projectId} projectId={projectId}
activeTab='solutions' activeTab='solutions'
client:load
/> />
<ListProjectSolutions <ListProjectSolutions

Loading…
Cancel
Save