- fix label in contact

- fix importing from json
- fix reset everything
- update dependencies
This commit is contained in:
Amruth Pillai
2020-07-31 13:33:11 +05:30
parent 714d37deca
commit 09ea3b95ab
15 changed files with 1195 additions and 3984 deletions

View File

@ -1,5 +1,6 @@
import { get } from 'lodash';
import React, { memo, useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { FaCaretRight } from 'react-icons/fa';
import PageContext from '../../../contexts/PageContext';
import { safetyCheck } from '../../../utils';
@ -7,7 +8,7 @@ import Icons from '../Icons';
const ContactItem = ({ value, icon, link }) => {
const { data } = useContext(PageContext);
const Icon = get(Icons, icon.toLowerCase(), FaCaretRight);
const Icon = get(Icons, icon && icon.toLowerCase(), FaCaretRight);
return value ? (
<div className="flex items-center">
@ -28,22 +29,23 @@ const ContactItem = ({ value, icon, link }) => {
};
const ContactA = () => {
const { t } = useTranslation();
const { data } = useContext(PageContext);
return (
<div className="text-xs grid gap-2">
<ContactItem
icon="phone"
label={t('shared.forms.phone')}
value={data.profile.phone}
link={`tel:${data.profile.phone}`}
/>
<ContactItem
icon="website"
label={t('shared.forms.website')}
value={data.profile.website}
link={data.profile.website}
/>
<ContactItem
icon="email"
label={t('shared.forms.email')}
value={data.profile.email}
link={`mailto:${data.profile.email}`}
/>

View File

@ -1,5 +1,6 @@
import { get } from 'lodash';
import React, { memo, useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { FaCaretRight } from 'react-icons/fa';
import PageContext from '../../../contexts/PageContext';
import { safetyCheck } from '../../../utils';
@ -28,22 +29,23 @@ const ContactItem = ({ value, icon, link }) => {
};
const ContactA = () => {
const { t } = useTranslation();
const { data } = useContext(PageContext);
return (
<div className="text-xs grid gap-2">
<ContactItem
icon="phone"
label={t('shared.forms.phone')}
value={data.profile.phone}
link={`tel:${data.profile.phone}`}
/>
<ContactItem
icon="website"
label={t('shared.forms.website')}
value={data.profile.website}
link={data.profile.website}
/>
<ContactItem
icon="email"
label={t('shared.forms.email')}
value={data.profile.email}
link={`mailto:${data.profile.email}`}
/>

View File

@ -40,17 +40,17 @@ const ContactC = () => {
)}
<ContactItem
label="phone"
label={t('shared.forms.phone')}
value={data.profile.phone}
link={`tel:${data.profile.phone}`}
/>
<ContactItem
label="website"
label={t('shared.forms.website')}
value={data.profile.website}
link={data.profile.website}
/>
<ContactItem
label="email"
label={t('shared.forms.email')}
value={data.profile.email}
link={`mailto:${data.profile.email}`}
/>

View File

@ -58,17 +58,17 @@ const ContactD = () => {
)}
<ContactItem
label="phone"
label={t('shared.forms.phone')}
value={data.profile.phone}
link={`tel:${data.profile.phone}`}
/>
<ContactItem
label="website"
label={t('shared.forms.website')}
value={data.profile.website}
link={data.profile.website}
/>
<ContactItem
label="email"
label={t('shared.forms.email')}
value={data.profile.email}
link={`mailto:${data.profile.email}`}
/>

View File

@ -40,17 +40,17 @@ const ContactE = () => {
</div>
<ContactItem
label="phone"
label={t('shared.forms.phone')}
value={data.profile.phone}
link={`tel:${data.profile.phone}`}
/>
<ContactItem
label="website"
label={t('shared.forms.website')}
value={data.profile.website}
link={data.profile.website}
/>
<ContactItem
label="email"
label={t('shared.forms.email')}
value={data.profile.email}
link={`mailto:${data.profile.email}`}
/>