mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-25 14:11:38 +10:00
solving bugs reported in GH issues
This commit is contained in:
@ -1,40 +1,50 @@
|
||||
import React, { memo, useContext } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import PageContext from '../../../contexts/PageContext';
|
||||
import { formatDateRange, safetyCheck } from '../../../utils';
|
||||
|
||||
const EducationItem = (x) => (
|
||||
<div key={x.id}>
|
||||
const EducationItem = ({ item, i18n }) => (
|
||||
<div>
|
||||
<div className="flex justify-between items-center">
|
||||
<div className="flex flex-col text-left mr-2">
|
||||
<h6 className="font-semibold">{x.institution}</h6>
|
||||
<h6 className="font-semibold">{item.institution}</h6>
|
||||
<span className="text-xs">
|
||||
<strong>{x.degree}</strong> {x.field}
|
||||
<strong>{item.degree}</strong> {item.field}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-col items-end text-right">
|
||||
{x.startDate && (
|
||||
{item.startDate && (
|
||||
<h6 className="text-xs font-medium mb-1">
|
||||
({formatDateRange({ startDate: x.startDate, endDate: x.endDate })})
|
||||
(
|
||||
{formatDateRange({
|
||||
startDate: item.startDate,
|
||||
endDate: item.endDate,
|
||||
language: i18n.language,
|
||||
})}
|
||||
)
|
||||
</h6>
|
||||
)}
|
||||
<span className="text-sm font-medium">{x.gpa}</span>
|
||||
<span className="text-sm font-medium">{item.gpa}</span>
|
||||
</div>
|
||||
</div>
|
||||
{x.summary && (
|
||||
<ReactMarkdown className="markdown mt-2 text-sm" source={x.summary} />
|
||||
{item.summary && (
|
||||
<ReactMarkdown className="markdown mt-2 text-sm" source={item.summary} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
const EducationA = () => {
|
||||
const { i18n } = useTranslation();
|
||||
const { data, heading: Heading } = useContext(PageContext);
|
||||
|
||||
return safetyCheck(data.education) ? (
|
||||
<div>
|
||||
<Heading>{data.education.heading}</Heading>
|
||||
<div className="grid gap-4">
|
||||
{data.education.items.map(EducationItem)}
|
||||
{data.education.items.map((x) => (
|
||||
<EducationItem key={x.id} item={x} i18n={i18n} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
Reference in New Issue
Block a user