US-015: Modify EducationTile: richer content, panel trigger
- Add OSCE score (80%) to MPharm inline details via educationExtras data - Show research project with full description (Drug delivery & cocrystals, 75.1%) - Display A-level grades as Mathematics (A*) · Chemistry (B) · Politics (C) - Include Mary Seacole programme detail from educationExtras - Import and use educationExtras data for dynamic inline content - Add osceScore field to EducationExtra type - Each entry clickable to open detail panel, hover border shift intact Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { useState } from 'react'
|
|||||||
import { Card, CardHeader } from '../Card'
|
import { Card, CardHeader } from '../Card'
|
||||||
import { useDetailPanel } from '@/contexts/DetailPanelContext'
|
import { useDetailPanel } from '@/contexts/DetailPanelContext'
|
||||||
import { documents } from '@/data/documents'
|
import { documents } from '@/data/documents'
|
||||||
|
import { educationExtras } from '@/data/educationExtras'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Education tile - displays academic qualifications
|
* Education tile - displays academic qualifications
|
||||||
@@ -19,36 +20,48 @@ export function EducationTile() {
|
|||||||
documents.find((d) => d.id === 'doc-alevels')!,
|
documents.find((d) => d.id === 'doc-alevels')!,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// Look up education extras by document ID
|
||||||
|
const getExtras = (docId: string) =>
|
||||||
|
educationExtras.find((e) => e.documentId === docId)
|
||||||
|
|
||||||
// Build rich inline content for each entry
|
// Build rich inline content for each entry
|
||||||
const getInlineContent = (doc: typeof educationDocuments[0]) => {
|
const getInlineDetails = (doc: (typeof educationDocuments)[0]) => {
|
||||||
|
const extras = getExtras(doc.id)
|
||||||
|
|
||||||
switch (doc.id) {
|
switch (doc.id) {
|
||||||
case 'doc-mpharm':
|
case 'doc-mpharm':
|
||||||
return {
|
return {
|
||||||
title: 'MPharm (Hons) — 2:1',
|
title: 'MPharm (Hons) — 2:1',
|
||||||
institution: 'University of East Anglia',
|
institution: 'University of East Anglia',
|
||||||
year: '2015',
|
year: '2011–2015',
|
||||||
extra: 'Research project: 75.1% (Distinction)',
|
details: [
|
||||||
|
`Research project: Drug delivery & cocrystals, 75.1% (Distinction)`,
|
||||||
|
...(extras?.osceScore ? [`4th year OSCE: ${extras.osceScore}`] : []),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
case 'doc-mary-seacole':
|
case 'doc-mary-seacole':
|
||||||
return {
|
return {
|
||||||
title: 'NHS Leadership Academy — Mary Seacole Programme',
|
title: 'NHS Leadership Academy — Mary Seacole Programme',
|
||||||
institution: 'NHS Leadership Academy',
|
institution: 'NHS Leadership Academy',
|
||||||
year: '2018',
|
year: '2018',
|
||||||
extra: 'Programme score: 78%',
|
details: [
|
||||||
|
`Programme score: 78%`,
|
||||||
|
...(extras?.programmeDetail ? [extras.programmeDetail] : []),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
case 'doc-alevels':
|
case 'doc-alevels':
|
||||||
return {
|
return {
|
||||||
title: 'A-Levels',
|
title: 'A-Levels',
|
||||||
institution: 'Highworth Grammar School',
|
institution: 'Highworth Grammar School',
|
||||||
year: '2009–2011',
|
year: '2009–2011',
|
||||||
extra: 'Mathematics A* · Chemistry B · Politics C',
|
details: ['Mathematics (A*) · Chemistry (B) · Politics (C)'],
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return {
|
return {
|
||||||
title: doc.title,
|
title: doc.title,
|
||||||
institution: doc.institution,
|
institution: doc.institution,
|
||||||
year: doc.date,
|
year: doc.date,
|
||||||
extra: doc.classification,
|
details: doc.classification ? [doc.classification] : [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,7 +72,7 @@ export function EducationTile() {
|
|||||||
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
|
||||||
{educationDocuments.map((doc, index) => {
|
{educationDocuments.map((doc, index) => {
|
||||||
const content = getInlineContent(doc)
|
const content = getInlineDetails(doc)
|
||||||
const isHovered = hoveredIndex === index
|
const isHovered = hoveredIndex === index
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -110,20 +123,31 @@ export function EducationTile() {
|
|||||||
style={{
|
style={{
|
||||||
color: 'var(--text-secondary)',
|
color: 'var(--text-secondary)',
|
||||||
fontSize: '11px',
|
fontSize: '11px',
|
||||||
marginBottom: '4px',
|
marginBottom: content.details.length > 0 ? '6px' : '0',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{content.institution}
|
{content.institution}
|
||||||
</div>
|
</div>
|
||||||
{content.extra && (
|
{content.details.length > 0 && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
color: 'var(--text-tertiary)',
|
display: 'flex',
|
||||||
fontSize: '10.5px',
|
flexDirection: 'column',
|
||||||
fontFamily: 'var(--font-geist-mono)',
|
gap: '2px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{content.extra}
|
{content.details.map((detail, i) => (
|
||||||
|
<div
|
||||||
|
key={i}
|
||||||
|
style={{
|
||||||
|
color: 'var(--text-tertiary)',
|
||||||
|
fontSize: '10.5px',
|
||||||
|
fontFamily: 'var(--font-geist-mono)',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{detail}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export const educationExtras: EducationExtra[] = [
|
|||||||
'Publicity Officer for UEA Alzheimer\'s Society',
|
'Publicity Officer for UEA Alzheimer\'s Society',
|
||||||
],
|
],
|
||||||
researchDescription: 'Final year research project investigating cocrystal formation for improved drug delivery properties. Awarded Distinction grade (75.1%).',
|
researchDescription: 'Final year research project investigating cocrystal formation for improved drug delivery properties. Awarded Distinction grade (75.1%).',
|
||||||
|
osceScore: '80%',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
documentId: 'doc-mary-seacole',
|
documentId: 'doc-mary-seacole',
|
||||||
|
|||||||
@@ -193,4 +193,5 @@ export interface EducationExtra {
|
|||||||
extracurriculars?: string[]
|
extracurriculars?: string[]
|
||||||
researchDescription?: string
|
researchDescription?: string
|
||||||
programmeDetail?: string
|
programmeDetail?: string
|
||||||
|
osceScore?: string
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user