mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-25 01:15:26 +10:00
- make dates follow internationalization standard
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ module.exports = {
|
|||||||
title: 'Reactive Resume',
|
title: 'Reactive Resume',
|
||||||
siteUrl: 'https://rxresu.me',
|
siteUrl: 'https://rxresu.me',
|
||||||
description: 'A free and open source resume builder.',
|
description: 'A free and open source resume builder.',
|
||||||
version: '2.0.1',
|
version: '2.0.2',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
'gatsby-plugin-react-helmet',
|
'gatsby-plugin-react-helmet',
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { Menu, MenuItem } from '@material-ui/core';
|
import { Menu, MenuItem } from '@material-ui/core';
|
||||||
import { navigate } from 'gatsby';
|
import { navigate } from 'gatsby';
|
||||||
import moment from 'moment';
|
import moment from 'moment/min/moment-with-locales';
|
||||||
import React, { useContext, useState } from 'react';
|
import React, { useContext, useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { MdMoreHoriz, MdOpenInNew } from 'react-icons/md';
|
import { MdMoreHoriz, MdOpenInNew } from 'react-icons/md';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import DatabaseContext from '../../contexts/DatabaseContext';
|
import DatabaseContext from '../../contexts/DatabaseContext';
|
||||||
import ModalContext from '../../contexts/ModalContext';
|
import ModalContext from '../../contexts/ModalContext';
|
||||||
import styles from './ResumePreview.module.css';
|
import styles from './ResumePreview.module.css';
|
||||||
|
|
||||||
const ResumePreview = ({ resume }) => {
|
const ResumePreview = ({ resume }) => {
|
||||||
const { t } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const [anchorEl, setAnchorEl] = useState(null);
|
const [anchorEl, setAnchorEl] = useState(null);
|
||||||
const { emitter, events } = useContext(ModalContext);
|
const { emitter, events } = useContext(ModalContext);
|
||||||
const { duplicateResume, deleteResume } = useContext(DatabaseContext);
|
const { duplicateResume, deleteResume } = useContext(DatabaseContext);
|
||||||
@@ -84,7 +84,9 @@ const ResumePreview = ({ resume }) => {
|
|||||||
{resume.updatedAt && (
|
{resume.updatedAt && (
|
||||||
<span>
|
<span>
|
||||||
{t('dashboard.lastUpdated', {
|
{t('dashboard.lastUpdated', {
|
||||||
timestamp: moment(resume.updatedAt).fromNow(),
|
timestamp: moment(resume.updatedAt)
|
||||||
|
.locale(i18n.language.substr(0, 2))
|
||||||
|
.fromNow(),
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import en from './en.json';
|
import en from './en.json';
|
||||||
import kn from './kn.json';
|
|
||||||
import es from './es.json';
|
import es from './es.json';
|
||||||
import ptBr from './pt-br.json';
|
|
||||||
import fi from './fi.json';
|
import fi from './fi.json';
|
||||||
import fr from './fr.json';
|
import fr from './fr.json';
|
||||||
|
import kn from './kn.json';
|
||||||
|
import ptBr from './pt-br.json';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
en: { translation: en },
|
en: { translation: en },
|
||||||
kn: { translation: kn },
|
|
||||||
es: { translation: es },
|
es: { translation: es },
|
||||||
ptBr: { translation: ptBr },
|
|
||||||
fi: { translation: fi },
|
fi: { translation: fi },
|
||||||
fr: { translation: fr },
|
fr: { translation: fr },
|
||||||
|
kn: { translation: kn },
|
||||||
|
ptBr: { translation: ptBr },
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,27 +1,34 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment/min/moment-with-locales';
|
||||||
import React, { memo, useContext } from 'react';
|
import React, { memo, useContext } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import PageContext from '../../../contexts/PageContext';
|
import PageContext from '../../../contexts/PageContext';
|
||||||
import { safetyCheck } from '../../../utils';
|
import { safetyCheck } from '../../../utils';
|
||||||
|
|
||||||
const AwardItem = (x) => (
|
const AwardItem = (x) => {
|
||||||
<div key={x.id}>
|
const { i18n } = useTranslation();
|
||||||
<div className="flex justify-between items-center">
|
|
||||||
<div className="flex flex-col text-left mr-2">
|
return (
|
||||||
<h6 className="font-semibold">{x.title}</h6>
|
<div key={x.id}>
|
||||||
<span className="text-xs">{x.awarder}</span>
|
<div className="flex justify-between items-center">
|
||||||
|
<div className="flex flex-col text-left mr-2">
|
||||||
|
<h6 className="font-semibold">{x.title}</h6>
|
||||||
|
<span className="text-xs">{x.awarder}</span>
|
||||||
|
</div>
|
||||||
|
{x.date && (
|
||||||
|
<h6 className="text-xs font-medium text-right">
|
||||||
|
{moment(x.date)
|
||||||
|
.locale(i18n.language.substr(0, 2))
|
||||||
|
.format('MMMM YYYY')}
|
||||||
|
</h6>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{x.date && (
|
{x.summary && (
|
||||||
<h6 className="text-xs font-medium text-right">
|
<ReactMarkdown className="markdown mt-2 text-sm" source={x.summary} />
|
||||||
{moment(x.date).format('MMMM YYYY')}
|
|
||||||
</h6>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{x.summary && (
|
);
|
||||||
<ReactMarkdown className="markdown mt-2 text-sm" source={x.summary} />
|
};
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
const AwardsA = () => {
|
const AwardsA = () => {
|
||||||
const { data, heading: Heading } = useContext(PageContext);
|
const { data, heading: Heading } = useContext(PageContext);
|
||||||
|
|||||||
@@ -1,27 +1,34 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment/min/moment-with-locales';
|
||||||
import React, { memo, useContext } from 'react';
|
import React, { memo, useContext } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import PageContext from '../../../contexts/PageContext';
|
import PageContext from '../../../contexts/PageContext';
|
||||||
import { safetyCheck } from '../../../utils';
|
import { safetyCheck } from '../../../utils';
|
||||||
|
|
||||||
const CertificationItem = (x) => (
|
const CertificationItem = (x) => {
|
||||||
<div key={x.id}>
|
const { i18n } = useTranslation();
|
||||||
<div className="flex justify-between items-center">
|
|
||||||
<div className="flex flex-col text-left mr-2">
|
return (
|
||||||
<h6 className="font-semibold">{x.title}</h6>
|
<div key={x.id}>
|
||||||
<span className="text-xs">{x.issuer}</span>
|
<div className="flex justify-between items-center">
|
||||||
|
<div className="flex flex-col text-left mr-2">
|
||||||
|
<h6 className="font-semibold">{x.title}</h6>
|
||||||
|
<span className="text-xs">{x.issuer}</span>
|
||||||
|
</div>
|
||||||
|
{x.date && (
|
||||||
|
<h6 className="text-xs font-medium text-right">
|
||||||
|
{moment(x.date)
|
||||||
|
.locale(i18n.language.substr(0, 2))
|
||||||
|
.format('MMMM YYYY')}
|
||||||
|
</h6>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{x.date && (
|
{x.summary && (
|
||||||
<h6 className="text-xs font-medium text-right">
|
<ReactMarkdown className="markdown mt-2 text-sm" source={x.summary} />
|
||||||
{moment(x.date).format('MMMM YYYY')}
|
|
||||||
</h6>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{x.summary && (
|
);
|
||||||
<ReactMarkdown className="markdown mt-2 text-sm" source={x.summary} />
|
};
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
const CertificationsA = () => {
|
const CertificationsA = () => {
|
||||||
const { data, heading: Heading } = useContext(PageContext);
|
const { data, heading: Heading } = useContext(PageContext);
|
||||||
|
|||||||
@@ -1,31 +1,38 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment/min/moment-with-locales';
|
||||||
import React, { memo, useContext } from 'react';
|
import React, { memo, useContext } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import PageContext from '../../../contexts/PageContext';
|
import PageContext from '../../../contexts/PageContext';
|
||||||
import { safetyCheck } from '../../../utils';
|
import { safetyCheck } from '../../../utils';
|
||||||
|
|
||||||
const ProjectItem = (x) => (
|
const ProjectItem = (x) => {
|
||||||
<div key={x.id}>
|
const { i18n } = useTranslation();
|
||||||
<div className="flex justify-between items-center">
|
|
||||||
<div className="flex flex-col text-left mr-2">
|
return (
|
||||||
<h6 className="font-semibold">{x.title}</h6>
|
<div key={x.id}>
|
||||||
{x.link && (
|
<div className="flex justify-between items-center">
|
||||||
<a href={x.link} className="text-xs">
|
<div className="flex flex-col text-left mr-2">
|
||||||
{x.link}
|
<h6 className="font-semibold">{x.title}</h6>
|
||||||
</a>
|
{x.link && (
|
||||||
|
<a href={x.link} className="text-xs">
|
||||||
|
{x.link}
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{x.date && (
|
||||||
|
<h6 className="text-xs font-medium text-right">
|
||||||
|
{moment(x.date)
|
||||||
|
.locale(i18n.language.substr(0, 2))
|
||||||
|
.format('MMMM YYYY')}
|
||||||
|
</h6>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{x.date && (
|
{x.summary && (
|
||||||
<h6 className="text-xs font-medium text-right">
|
<ReactMarkdown className="markdown mt-2 text-sm" source={x.summary} />
|
||||||
{moment(x.date).format('MMMM YYYY')}
|
|
||||||
</h6>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{x.summary && (
|
);
|
||||||
<ReactMarkdown className="markdown mt-2 text-sm" source={x.summary} />
|
};
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
const ProjectsA = () => {
|
const ProjectsA = () => {
|
||||||
const { data, heading: Heading } = useContext(PageContext);
|
const { data, heading: Heading } = useContext(PageContext);
|
||||||
|
|||||||
+14
-5
@@ -1,5 +1,5 @@
|
|||||||
import { get, isEmpty } from 'lodash';
|
import { get, isEmpty } from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment/min/moment-with-locales';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const getModalText = (isEditMode, type) => {
|
export const getModalText = (isEditMode, type) => {
|
||||||
@@ -22,10 +22,19 @@ export const isFileImage = (file) => {
|
|||||||
return file && acceptedImageTypes.includes(file.type);
|
return file && acceptedImageTypes.includes(file.type);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const formatDateRange = ({ startDate, endDate }) =>
|
export const formatDateRange = ({ startDate, endDate }) => {
|
||||||
`${moment(startDate).format('MMMM Y')} — ${
|
const { i18n } = useTranslation();
|
||||||
moment(endDate).isValid() ? moment(endDate).format('MMMM Y') : 'Present'
|
|
||||||
}`;
|
const start = `${moment(startDate)
|
||||||
|
.locale(i18n.language.substr(0, 2))
|
||||||
|
.format('MMMM Y')}`;
|
||||||
|
|
||||||
|
const end = moment(endDate).isValid()
|
||||||
|
? `${moment(endDate).locale(i18n.language.substr(0, 2)).format('MMMM Y')}`
|
||||||
|
: 'Present';
|
||||||
|
|
||||||
|
return `${start} - ${end}`;
|
||||||
|
};
|
||||||
|
|
||||||
export const getFieldProps = (formik, schema, name) => ({
|
export const getFieldProps = (formik, schema, name) => ({
|
||||||
touched: get(formik, `touched.${name}`, false),
|
touched: get(formik, `touched.${name}`, false),
|
||||||
|
|||||||
Reference in New Issue
Block a user