Support visible property in pdf pages (#180)

This commit is contained in:
Szymon Kin 2023-01-26 21:03:13 +01:00 committed by GitHub
parent c5c6872cc5
commit 2d09310352
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,8 @@ const { config, sections } = cv(
renameSkillSet('I speak', 'Languages'),
hideProject('Disco Ninjas')
);
const shouldRenderSection = (section: keyof typeof sections) => sections[section] && sections[section].config.visible;
---
<!DOCTYPE html>
@ -23,11 +25,11 @@ const { config, sections } = cv(
<title>PDF preview</title>
</head>
<body class="flex flex-col bg-white p-[10mm] print:p-0">
<MainSection {...sections.main} />
{sections.skills && <SkillsSection {...sections.skills} />}
{sections.experience && <ExperienceSection {...sections.experience} />}
{sections.portfolio && <PortfolioSection {...sections.portfolio} />}
{sections.education && <EducationSection {...sections.education} />}
{shouldRenderSection('main') && <MainSection {...sections.main} />}
{shouldRenderSection('skills') && <SkillsSection {...sections.skills} />}
{shouldRenderSection('experience') && <ExperienceSection {...sections.experience} />}
{shouldRenderSection('portfolio') && <PortfolioSection {...sections.portfolio} />}
{shouldRenderSection('education') && <EducationSection {...sections.education} />}
{config.pdf?.footer && <Footer>{config.pdf.footer}</Footer>}
</body>
</html>