Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

index.tsx

225 lines7.5 KB

1import { createFileRoute } from '@tanstack/react-router'
2import { allEducations, allJobs } from 'content-collections'
3import { marked } from 'marked'
4import { useMemo, useState } from 'react'
5​
6export const Route = createFileRoute('/')({
7 component: ResumePage,
8})
9​
10function ResumePage() {
11 const [selectedTags, setSelectedTags] = useState<string[]>([])
12​
13 const allTags = useMemo(() => {
14 const tags = new Set<string>()
15​
16 for (const job of allJobs) {
17 for (const tag of job.tags) tags.add(tag)
18 }
19​
20 for (const education of allEducations) {
21 for (const tag of education.tags) tags.add(tag)
22 }
23​
24 return Array.from(tags).sort((a, b) => a.localeCompare(b))
25 }, [])
26​
27 const filteredJobs = useMemo(() => {
28 const jobs =
29 selectedTags.length === 0
30 ? [...allJobs]
31 : allJobs.filter((job) => selectedTags.some((tag) => job.tags.includes(tag)))
32​
33 const getSortValue = (job: (typeof allJobs)[number]) => {
34 if (!job.endDate) {
35 return Number.POSITIVE_INFINITY
36 }
37​
38 const endTime = Date.parse(job.endDate)
39 if (Number.isFinite(endTime)) {
40 return endTime
41 }
42​
43 const startTime = Date.parse(job.startDate)
44 return Number.isFinite(startTime) ? startTime : 0
45 }
46​
47 return jobs.sort((a, b) => getSortValue(b) - getSortValue(a))
48 }, [selectedTags])
49​
50 return (
51 <main className="resume-shell">
52 <section className="resume-hero rise-in" style={{ animationDelay: '50ms' }}>
53 <div className="resume-hero-copy">
54 <p className="resume-kicker">Product-minded frontend engineer</p>
55 <h1>
56 Hi, I&apos;m <span>Jane Smith</span>.
57 </h1>
58 <p className="resume-summary">
59 I design and ship interfaces that feel calm, fast, and obvious to use. I work best on teams that care about
60 systems, product craft, and measurable outcomes.
61 </p>
62 <ul className="resume-meta" aria-label="Profile details">
63 <li>Remote-first</li>
64 <li>Staff / Lead roles</li>
65 <li>React + TypeScript + TanStack</li>
66 </ul>
67​
68 <dl className="resume-fact-row" aria-label="Quick profile facts">
69 <div>
70 <dt>Experience</dt>
71 <dd>8+ years</dd>
72 </div>
73 <div>
74 <dt>Location</dt>
75 <dd>Remote</dd>
76 </div>
77 <div>
78 <dt>Specialty</dt>
79 <dd>Design Systems</dd>
80 </div>
81 <div>
82 <dt>Timezone</dt>
83 <dd>GMT-6</dd>
84 </div>
85 </dl>
86 </div>
87​
88 <aside className="resume-identity-card" aria-label="Candidate portrait">
89 <img src="/headshot-on-white.jpg" alt="Portrait of Jane Smith" className="resume-portrait" />
90 </aside>
91 </section>
92​
93 <section className="resume-filter rise-in" style={{ animationDelay: '120ms' }}>
94 <div className="resume-filter-label">Filter by skill</div>
95 <div className="resume-tags" role="list" aria-label="Skill filters">
96 {allTags.map((tag) => {
97 const active = selectedTags.includes(tag)
98​
99 return (
100 <button
101 key={tag}
102 type="button"
103 role="listitem"
104 aria-pressed={active}
105 className="resume-tag"
106 data-active={active ? 'true' : 'false'}
107 onClick={() => {
108 setSelectedTags((prev) =>
109 prev.includes(tag) ? prev.filter((item) => item !== tag) : [...prev, tag],
110 )
111 }}
112 >
113 {tag}
114 </button>
115 )
116 })}
117 </div>
118 </section>
119​
120 <section className="resume-grid">
121 <aside className="resume-aside rise-in" style={{ animationDelay: '170ms' }}>
122 <article className="resume-panel">
123 <h2>Approach</h2>
124 <p>
125 I turn broad product goals into usable, maintainable frontend systems. I care about clarity, accessibility,
126 and helping teams move faster over time.
127 </p>
128 </article>
129​
130 <article className="resume-panel">
131 <h2>Core stack</h2>
132 <ul>
133 <li>React, TypeScript, TanStack Router + Query</li>
134 <li>Design systems with Tailwind and Radix</li>
135 <li>SSR and API-driven product surfaces</li>
136 <li>Testing with Vitest and Testing Library</li>
137 </ul>
138 </article>
139 </aside>
140​
141 <div className="resume-mainline">
142 <section className="rise-in" style={{ animationDelay: '220ms' }}>
143 <header className="section-head">
144 <h2>Experience</h2>
145 <p>{filteredJobs.length} roles shown</p>
146 </header>
147​
148 <ol className="timeline" aria-label="Work experience timeline">
149 {filteredJobs.map((job, index) => (
150 <li
151 key={`${job.company}-${job.jobTitle}`}
152 className="timeline-item rise-in"
153 style={{ animationDelay: `${280 + index * 65}ms` }}
154 >
155 <article className="timeline-card">
156 <div className="timeline-top">
157 <h3>{job.jobTitle}</h3>
158 <span>
159 {job.startDate} - {job.endDate || 'Present'}
160 </span>
161 </div>
162 <p className="timeline-company">
163 {job.company} - {job.location}
164 </p>
165 <p>{job.summary}</p>
166​
167 {job.content ? (
168 <details>
169 <summary>Highlights</summary>
170 <div
171 className="markdown"
172 dangerouslySetInnerHTML={{
173 __html: marked.parse(job.content) as string,
174 }}
175 />
176 </details>
177 ) : null}
178​
179 <ul className="chip-row" aria-label={`${job.jobTitle} technologies`}>
180 {job.tags.map((tag) => (
181 <li key={tag}>{tag}</li>
182 ))}
183 </ul>
184 </article>
185 </li>
186 ))}
187 </ol>
188 </section>
189​
190 <section className="rise-in" style={{ animationDelay: '360ms' }}>
191 <header className="section-head">
192 <h2>Education</h2>
193 </header>
194​
195 <div className="edu-grid">
196 {allEducations.map((education, index) => (
197 <article
198 key={education.school}
199 className="edu-card rise-in"
200 style={{ animationDelay: `${420 + index * 70}ms` }}
201 >
202 <div className="timeline-top">
203 <h3>{education.school}</h3>
204 <span>
205 {education.startDate} - {education.endDate || 'Present'}
206 </span>
207 </div>
208 <p>{education.summary}</p>
209 {education.content ? (
210 <div
211 className="markdown"
212 dangerouslySetInnerHTML={{
213 __html: marked.parse(education.content) as string,
214 }}
215 />
216 ) : null}
217 </article>
218 ))}
219 </div>
220 </section>
221 </div>
222 </section>
223 </main>
224 )