mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-27 10:24:48 +10:00
70064be7de
- Implement functionality to move items between sections or pages - Enhance custom sections to have a `type` property - Update the v4 importer to account for custom sections - Update healthcheck to be a simple curl command - Update dependencies to latest and a lot more changes
98 lines
2.9 KiB
TypeScript
98 lines
2.9 KiB
TypeScript
import { EnvelopeIcon, GlobeIcon, MapPinIcon, PhoneIcon } from "@phosphor-icons/react";
|
|
import { cn } from "@/utils/style";
|
|
import { getSectionComponent } from "../shared/get-section-component";
|
|
import { PageIcon } from "../shared/page-icon";
|
|
import { PageLink } from "../shared/page-link";
|
|
import { PagePicture } from "../shared/page-picture";
|
|
import { useResumeStore } from "../store/resume";
|
|
import type { TemplateProps } from "./types";
|
|
|
|
const sectionClassName = cn(
|
|
// Section Heading
|
|
"[&>h6]:border-(--page-primary-color) [&>h6]:border-b [&>h6]:pb-0.5 [&>h6]:text-center",
|
|
);
|
|
|
|
/**
|
|
* Template: Kakuna
|
|
*/
|
|
export function KakunaTemplate({ pageIndex, pageLayout }: TemplateProps) {
|
|
const isFirstPage = pageIndex === 0;
|
|
const { main, sidebar, fullWidth } = pageLayout;
|
|
|
|
return (
|
|
<div className="template-kakuna page-content space-y-4 px-(--page-margin-x) py-(--page-margin-y) print:p-0">
|
|
{isFirstPage && <Header />}
|
|
|
|
<main data-layout="main" className="group page-main space-y-4">
|
|
{main.map((section) => {
|
|
const Component = getSectionComponent(section, { sectionClassName });
|
|
return <Component key={section} id={section} />;
|
|
})}
|
|
</main>
|
|
|
|
{!fullWidth && (
|
|
<aside data-layout="sidebar" className="group page-sidebar space-y-4">
|
|
{sidebar.map((section) => {
|
|
const Component = getSectionComponent(section, { sectionClassName });
|
|
return <Component key={section} id={section} />;
|
|
})}
|
|
</aside>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function Header() {
|
|
const basics = useResumeStore((state) => state.resume.data.basics);
|
|
|
|
return (
|
|
<div className="page-header flex flex-col items-center gap-y-2">
|
|
<PagePicture />
|
|
|
|
<div className="page-basics space-y-2 text-center">
|
|
<div>
|
|
<h2 className="basics-name">{basics.name}</h2>
|
|
<p className="basics-headline">{basics.headline}</p>
|
|
</div>
|
|
|
|
<div className="basics-items flex flex-wrap justify-center gap-x-3 gap-y-0.5 *:flex *:items-center *:gap-x-1.5">
|
|
{basics.email && (
|
|
<div className="basics-item-email">
|
|
<EnvelopeIcon />
|
|
<PageLink url={`mailto:${basics.email}`} label={basics.email} />
|
|
</div>
|
|
)}
|
|
|
|
{basics.phone && (
|
|
<div className="basics-item-phone">
|
|
<PhoneIcon />
|
|
<PageLink url={`tel:${basics.phone}`} label={basics.phone} />
|
|
</div>
|
|
)}
|
|
|
|
{basics.location && (
|
|
<div className="basics-item-location">
|
|
<MapPinIcon />
|
|
<span>{basics.location}</span>
|
|
</div>
|
|
)}
|
|
|
|
{basics.website.url && (
|
|
<div className="basics-item-website">
|
|
<GlobeIcon />
|
|
<PageLink {...basics.website} />
|
|
</div>
|
|
)}
|
|
|
|
{basics.customFields.map((field) => (
|
|
<div key={field.id} className="basics-item-custom">
|
|
<PageIcon icon={field.icon} />
|
|
{field.link ? <PageLink url={field.link} label={field.text} /> : <span>{field.text}</span>}
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|