Merge pull request #599 from adamantike/allow-links-for-awards-and-certs

Allow links for certifications
This commit is contained in:
Amruth Pillai
2022-01-10 08:42:35 +01:00
committed by GitHub
2 changed files with 16 additions and 1 deletions
+9
View File
@@ -11,6 +11,7 @@ const initialValues = {
title: '',
issuer: '',
date: '',
url: '',
summary: '',
};
@@ -21,6 +22,7 @@ const CertificateModal = () => {
title: Yup.string().required(t('shared.forms.validation.required')),
issuer: Yup.string().required(t('shared.forms.validation.required')),
date: Yup.date().max(new Date()),
url: Yup.string().url(t('shared.forms.validation.url')),
summary: Yup.string(),
});
@@ -56,6 +58,13 @@ const CertificateModal = () => {
{...getFieldProps(formik, schema, 'date')}
/>
<Input
label={t('shared.forms.website')}
className="col-span-2"
placeholder="https://"
{...getFieldProps(formik, schema, 'url')}
/>
<Input
type="textarea"
label={t('shared.forms.summary')}
@@ -7,7 +7,13 @@ const CertificationItem = ({ item, language }) => (
<div>
<div className="flex justify-between items-center">
<div className="flex flex-col text-left mr-2">
<h6 className="font-semibold text-sm">{item.title}</h6>
{item.url ? (
<a href={item.url} target="_blank" rel="noopener noreferrer">
<h6 className="font-semibold text-sm">{item.title}</h6>
</a>
) : (
<h6 className="font-semibold text-sm">{item.title}</h6>
)}
<span className="text-xs">{item.issuer}</span>
</div>
{item.date && (