Skip to content

Commit

Permalink
feat: added a timeline component
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdavis committed Jul 24, 2024
1 parent e32dd10 commit 860c523
Show file tree
Hide file tree
Showing 10 changed files with 478 additions and 248 deletions.
1 change: 1 addition & 0 deletions apps/registry/app/[username]/ProfileLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function Layout({ children, resume, username, session }) {

const navLinks = [
{ href: `/${username}/dashboard`, label: 'Dashboard' },
{ href: `/${username}/timeline`, label: 'Timeline' },
{ href: `/${username}/jobs`, label: 'Jobs' },
{ href: `/${username}/suggestions`, label: 'Suggestions' },
{ href: `/${username}/letter`, label: 'Letter' },
Expand Down
239 changes: 0 additions & 239 deletions apps/registry/app/[username]/dashboard2/Dashboard.js

This file was deleted.

5 changes: 0 additions & 5 deletions apps/registry/app/[username]/dashboard2/layout.js

This file was deleted.

68 changes: 68 additions & 0 deletions apps/registry/app/[username]/timeline/Timeline.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import React from 'react';
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from '@repo/ui/components/ui/card';

import {
Timeline,
TimelineContent,
TimelineDot,
TimelineHeading,
TimelineItem,
TimelineLine,
} from '@repo/ui/components/ui/timeline';
import { Briefcase } from 'lucide-react';

const SimpleVerticalTimeline = ({ resume }) => {
const workExperiences = resume.work || [];

return (
<div className="min-h-screen p-8">
<Card className="mb-8">
<CardHeader>
<CardTitle className="text-xl font-semibold flex items-center">
<Briefcase className="w-5 h-5 mr-2" />
Career Timeline
</CardTitle>
</CardHeader>

<CardContent>
<div>
<Timeline positions="center">
{workExperiences.map((work, index) => {
const side = index % 2 === 0 ? 'left' : 'right';
const opposite = side === 'left' ? 'right' : 'left';
return (
<TimelineItem key={index} status="done">
<TimelineHeading className="text-xl" side={side}>
{work.name}
</TimelineHeading>
<TimelineHeading side={opposite} variant="secondary">
{work.startDate} - {work.endDate}
</TimelineHeading>
<TimelineDot status="done" />
<TimelineLine done />
<TimelineContent className="text-sm" side={side}>
<span className="font-bold">{work.position}</span> <br />
{work.summary}
</TimelineContent>
</TimelineItem>
);
})}

<TimelineItem>
<TimelineDot />
<TimelineHeading>Beginning!</TimelineHeading>
</TimelineItem>
</Timeline>
</div>
</CardContent>
</Card>
</div>
);
};

export default SimpleVerticalTimeline;
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import React from 'react';
import styled from 'styled-components';
import { useProfileData } from '../ProfileContext';
import ResumeDashboard from './Dashboard';
import TimelineComponent from './Timeline';

const Container = styled.div`
font-size: 1.4rem;
`;

const Resumes = () => {
const Timeline = () => {
const { resume } = useProfileData();

return (
<Container>
<ResumeDashboard resume={resume} />
<TimelineComponent resume={resume} />
</Container>
);
};

export default Resumes;
export default Timeline;
2 changes: 2 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.1.0",
"class-variance-authority": "^0.7.0",
Expand Down
Loading

0 comments on commit 860c523

Please sign in to comment.