This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
forked from phoinixi/jsonresume-theme-stackoverflow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #2
- Loading branch information
Showing
21 changed files
with
660 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { initReactI18next } from "react-i18next"; | ||
import i18n from "i18next"; | ||
import Backend from "i18next-http-backend"; | ||
import LanguageDetector from "i18next-browser-languagedetector"; | ||
import translations from "../src/translations.json"; | ||
i18n | ||
.use(initReactI18next) | ||
.use(LanguageDetector) | ||
.use(Backend) | ||
.init({ | ||
fallbackLng: "en", | ||
interpolation: { escapeValue: false }, | ||
react: { useSuspense: false }, | ||
supportedLngs: ["en", "de"], | ||
resources: translations, | ||
}); | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,42 @@ | ||
import React from "react"; | ||
import { Award } from "./types"; | ||
import { withTranslation, WithTranslation } from "react-i18next"; | ||
|
||
export const Awards: React.FC<{ awards: Award[] }> = ({ awards }) => ( | ||
<> | ||
{awards.length > 0 && ( | ||
<section className="section"> | ||
<header> | ||
<h2 className="section-title">Awards</h2> | ||
</header> | ||
<section id="awards"> | ||
{awards.map((award, index) => ( | ||
<section key={index} className="award-item"> | ||
{award.summary && <label htmlFor={`award-item-${index}`} />} | ||
<header className="clear"> | ||
{award.date && ( | ||
<div className="date"> | ||
{new Date(award.date).getFullYear()} | ||
export const Awards = withTranslation()( | ||
({ awards, t }: { awards: Award[] } & WithTranslation) => ( | ||
<> | ||
{awards.length > 0 && ( | ||
<section className="section"> | ||
<header> | ||
<h2 className="section-title">{t("Awards")}</h2> | ||
</header> | ||
<section id="awards"> | ||
{awards.map((award, index) => ( | ||
<section key={index} className="award-item"> | ||
{award.summary && <label htmlFor={`award-item-${index}`} />} | ||
<header className="clear"> | ||
{award.date && ( | ||
<div className="date"> | ||
{new Date(award.date).getFullYear()} | ||
</div> | ||
)} | ||
<div className="header-left"> | ||
{award.title && <div className="title">{award.title}</div>} | ||
{award.awarder && ( | ||
<div className="awarder">{award.awarder}</div> | ||
)} | ||
</div> | ||
)} | ||
<div className="header-left"> | ||
{award.title && <div className="title">{award.title}</div>} | ||
{award.awarder && ( | ||
<div className="awarder">{award.awarder}</div> | ||
</header> | ||
<div className="item"> | ||
{award.summary && ( | ||
<div className="summary">{award.summary}</div> | ||
)} | ||
</div> | ||
</header> | ||
<div className="item"> | ||
{award.summary && ( | ||
<div className="summary">{award.summary}</div> | ||
)} | ||
</div> | ||
</section> | ||
))} | ||
</section> | ||
))} | ||
</section> | ||
</section> | ||
</section> | ||
)} | ||
</> | ||
)} | ||
</> | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
import React from "react"; | ||
import { Certificate } from "./types"; | ||
import { withTranslation, WithTranslation } from "react-i18next"; | ||
|
||
export const Certificates: React.FC<{ certificates: Certificate[] }> = ({ | ||
certificates, | ||
}) => ( | ||
<> | ||
{certificates.length > 0 && ( | ||
<section className="section"> | ||
<header> | ||
<h2 className="section-title">Certificates</h2> | ||
</header> | ||
<section id="certificates"> | ||
{certificates.map((certificate, index) => ( | ||
<section key={index} className="certificate-item"> | ||
<header className="clear"> | ||
{certificate.date && ( | ||
<div className="date">{certificate.date}</div> | ||
)} | ||
<div className="header-left"> | ||
{certificate.name && ( | ||
<div className="name">{certificate.name}</div> | ||
export const Certificates = withTranslation()( | ||
({ certificates, t }: { certificates: Certificate[] } & WithTranslation) => ( | ||
<> | ||
{certificates.length > 0 && ( | ||
<section className="section"> | ||
<header> | ||
<h2 className="section-title">{t("Certificates")}</h2> | ||
</header> | ||
<section id="certificates"> | ||
{certificates.map((certificate, index) => ( | ||
<section key={index} className="certificate-item"> | ||
<header className="clear"> | ||
{certificate.date && ( | ||
<div className="date">{certificate.date}</div> | ||
)} | ||
{certificate.issuer && ( | ||
<div className="issuer">{certificate.issuer}</div> | ||
<div className="header-left"> | ||
{certificate.name && ( | ||
<div className="name">{certificate.name}</div> | ||
)} | ||
{certificate.issuer && ( | ||
<div className="issuer">{certificate.issuer}</div> | ||
)} | ||
</div> | ||
</header> | ||
<div className="item"> | ||
{certificate.url && ( | ||
<span className="url"> | ||
<span className="fas fa-external-link-alt"></span> | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href={certificate.url} | ||
> | ||
{"\u00A0"} | ||
{certificate.url} | ||
</a> | ||
</span> | ||
)} | ||
</div> | ||
</header> | ||
<div className="item"> | ||
{certificate.url && ( | ||
<span className="url"> | ||
<span className="fas fa-external-link-alt"></span> | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href={certificate.url} | ||
> | ||
{"\u00A0"} | ||
{certificate.url} | ||
</a> | ||
</span> | ||
)} | ||
</div> | ||
</section> | ||
))} | ||
</section> | ||
))} | ||
</section> | ||
</section> | ||
</section> | ||
)} | ||
</> | ||
)} | ||
</> | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,78 @@ | ||
import React from "react"; | ||
import { EducationProps } from "./types"; | ||
import { withTranslation, WithTranslation } from "react-i18next"; | ||
|
||
export const Education: React.FC<{ education: EducationProps[] }> = ({ | ||
education, | ||
}) => { | ||
if (!education.length) return null; | ||
export const Education = withTranslation()( | ||
({ education, t }: { education: EducationProps[] } & WithTranslation) => { | ||
if (!education.length) return null; | ||
|
||
const formatDate = (date: string) => { | ||
return new Date(date).getFullYear(); | ||
}; | ||
const formatDate = (date: string) => { | ||
return new Date(date).getFullYear(); | ||
}; | ||
|
||
return ( | ||
<section className="section"> | ||
<header> | ||
<h2 className="section-title"> | ||
Education <span className="item-count">({education.length})</span> | ||
</h2> | ||
</header> | ||
return ( | ||
<section className="section"> | ||
<header> | ||
<h2 className="section-title"> | ||
{t("Education")}{" "} | ||
<span className="item-count">({education.length})</span> | ||
</h2> | ||
</header> | ||
|
||
<section id="education"> | ||
{education.map((edu, index) => ( | ||
<section className="education-item" key={index}> | ||
<header className="clear"> | ||
<div className="date"> | ||
{edu.startDate && ( | ||
<span className="startDate">{formatDate(edu.startDate)}</span> | ||
)} | ||
{edu.endDate ? ( | ||
<span className="endDate"> - {formatDate(edu.endDate)}</span> | ||
) : ( | ||
<span className="endDate"> - Current</span> | ||
)} | ||
</div> | ||
<div className="header-left"> | ||
{edu.studyType && ( | ||
<div className="studyType">{edu.studyType}</div> | ||
)} | ||
{edu.area && ( | ||
<div className="area"> | ||
{"\u00A0"} | ||
{edu.area} | ||
<section id="education"> | ||
{education.map((edu, index) => ( | ||
<section className="education-item" key={index}> | ||
<header className="clear"> | ||
<div className="date"> | ||
{edu.startDate && ( | ||
<span className="startDate"> | ||
{formatDate(edu.startDate)} | ||
</span> | ||
)} | ||
{edu.endDate ? ( | ||
<span className="endDate"> | ||
{" "} | ||
- {formatDate(edu.endDate)} | ||
</span> | ||
) : ( | ||
<span className="endDate"> - Current</span> | ||
)} | ||
</div> | ||
<div className="header-left"> | ||
{edu.studyType && ( | ||
<div className="studyType">{edu.studyType}</div> | ||
)} | ||
{edu.area && ( | ||
<div className="area"> | ||
{"\u00A0"} | ||
{edu.area} | ||
</div> | ||
)} | ||
{edu.institution && ( | ||
<div className="institution">{edu.institution}</div> | ||
)} | ||
</div> | ||
</header> | ||
|
||
{edu.courses?.length && ( | ||
<ul className="courses"> | ||
{edu.courses.map((course, i) => ( | ||
<li key={i}>{course}</li> | ||
))} | ||
</ul> | ||
)} | ||
|
||
<div className="item"> | ||
{edu.score && ( | ||
<div className="gpa"> | ||
<strong> Grade:</strong> <span>{edu.score}</span> | ||
</div> | ||
)} | ||
{edu.institution && ( | ||
<div className="institution">{edu.institution}</div> | ||
)} | ||
</div> | ||
</header> | ||
|
||
{edu.courses?.length && ( | ||
<ul className="courses"> | ||
{edu.courses.map((course, i) => ( | ||
<li key={i}>{course}</li> | ||
))} | ||
</ul> | ||
)} | ||
|
||
<div className="item"> | ||
{edu.score && ( | ||
<div className="gpa"> | ||
<strong> Grade:</strong> <span>{edu.score}</span> | ||
</div> | ||
)} | ||
</div> | ||
</section> | ||
))} | ||
</section> | ||
))} | ||
</section> | ||
</section> | ||
</section> | ||
); | ||
}; | ||
); | ||
} | ||
); |
Oops, something went wrong.