Skip to content

Commit 5a5651e

Browse files
committed
about me section ready
1 parent 80253a6 commit 5a5651e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+582
-8
lines changed

apps/react-app/src/pods/template-export/components/export-config/export-config.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface Props {
1717
}
1818

1919
const DOWNLOAD_MESSAGE_TIMEOUT = 2500;
20-
const DESING_OPTIONS: TemplateCV[] = ['Sith Elegance', 'Galactic CleanTech'];
20+
const DESING_OPTIONS: TemplateCV[] = ['Sith Elegance', 'Galactic CleanTech', 'Jedi minimalism'];
2121
const LANGUAGE_OPTIONS: Language[] = ['es', 'en'];
2222

2323
export const ExportConfig: React.FC<Props> = props => {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<%_ if (profile && profile !== 'undefined' ) { -%>
2+
<section>
3+
<h3><%- labels.ABOUT_ME_HEADING %></h3>
4+
<div class="section__content">
5+
<p><%= profile?.description %></p>
6+
</div>
7+
</section>
8+
<hr/>
9+
<%_ } -%>
10+
11+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import ejs from 'ejs';
2+
import { ProfileSectionVm, mapFromMacCvToProfileSectionVm } from '@lemoncode/manfred-common/profile-section';
3+
import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const';
4+
import { ManfredAwesomicCV, Settings, Language } from '@/model';
5+
import { getLabels } from './labels';
6+
import aboutSection from './about-me-section.ejs?raw';
7+
8+
export const generateAboutSection = (cv: ManfredAwesomicCV, settings: Settings): string => {
9+
const profileSectionVm = mapFromMacCvToProfileSectionVm(cv);
10+
11+
return generateAboutMeSectionInner(profileSectionVm, settings.language);
12+
};
13+
14+
const generateAboutMeSectionInner = (
15+
profileSectionVm: ProfileSectionVm,
16+
language: Language = ISO_SPANISH_LANGUAGE
17+
): string => {
18+
const rootObject = {
19+
profile: profileSectionVm,
20+
labels: getLabels(language),
21+
};
22+
23+
return ejs.render(aboutSection, rootObject);
24+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './about-me-section.part';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { AboutMeLabels } from './about-me-labels.model';
2+
3+
export const englishAboutMeLabels: AboutMeLabels = {
4+
ABOUT_ME_HEADING: 'About me',
5+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface AboutMeLabels {
2+
ABOUT_ME_HEADING: string;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { AboutMeLabels } from './about-me-labels.model';
2+
3+
export const spanishAboutMeLabels: AboutMeLabels = {
4+
ABOUT_ME_HEADING: 'Sobre mí',
5+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Language } from '@/model';
2+
import { AboutMeLabels } from './about-me-labels.model';
3+
import { spanishAboutMeLabels } from './about-me-spanish-labels.const';
4+
import { englishAboutMeLabels } from './about-me-english-labels.const';
5+
6+
export const getLabels = (language: Language): AboutMeLabels => {
7+
switch (language) {
8+
case 'es':
9+
return spanishAboutMeLabels;
10+
case 'en':
11+
return englishAboutMeLabels;
12+
default:
13+
throw new Error(`Language not supported: ${language}`);
14+
}
15+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
</aside>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import ejs from 'ejs';
2+
import asideElementEnd from './aside-element-end.ejs?raw';
3+
4+
export const generateAsideElementEnd = (): string => ejs.render(asideElementEnd);

0 commit comments

Comments
 (0)