diff --git a/src/components/LeftSidebar/tabs/Awards.js b/src/components/LeftSidebar/tabs/Awards.js index cd94f632..2b9a61c6 100644 --- a/src/components/LeftSidebar/tabs/Awards.js +++ b/src/components/LeftSidebar/tabs/Awards.js @@ -7,13 +7,13 @@ import TextField from '../../../shared/TextField'; import AppContext from '../../../context/AppContext'; import Checkbox from '../../../shared/Checkbox'; import TextArea from '../../../shared/TextArea'; -import { addItem, deleteItem, moveItemUp, moveItemDown } from '../../../utils'; +import { addItem } from '../../../utils'; import ItemActions from '../../../shared/ItemActions'; import AddItemButton from '../../../shared/AddItemButton'; import ItemHeading from '../../../shared/ItemHeading'; const AwardsTab = ({ data, onChange }) => { - const { t } = useTranslation('app'); + const { t } = useTranslation(); const context = useContext(AppContext); const { dispatch } = context; @@ -139,16 +139,13 @@ const Item = ({ item, index, onChange, dispatch, first, last }) => {
diff --git a/src/components/LeftSidebar/tabs/Certifications.js b/src/components/LeftSidebar/tabs/Certifications.js index 5cdd5f83..18805d82 100644 --- a/src/components/LeftSidebar/tabs/Certifications.js +++ b/src/components/LeftSidebar/tabs/Certifications.js @@ -1,4 +1,5 @@ import React, { useState, useContext } from 'react'; +import { useTranslation } from 'react-i18next'; import { v4 as uuidv4 } from 'uuid'; import set from 'lodash/set'; @@ -6,10 +7,13 @@ import TextField from '../../../shared/TextField'; import AppContext from '../../../context/AppContext'; import Checkbox from '../../../shared/Checkbox'; import TextArea from '../../../shared/TextArea'; -import { addItem, deleteItem, moveItemUp, moveItemDown } from '../../../utils'; +import { addItem } from '../../../utils'; import ItemActions from '../../../shared/ItemActions'; +import ItemHeading from '../../../shared/ItemHeading'; +import AddItemButton from '../../../shared/AddItemButton'; const CertificationsTab = ({ data, onChange }) => { + const { t } = useTranslation(); const context = useContext(AppContext); const { dispatch } = context; @@ -24,7 +28,7 @@ const CertificationsTab = ({ data, onChange }) => {
onChange('data.certifications.heading', v)} /> @@ -45,12 +49,44 @@ const CertificationsTab = ({ data, onChange }) => { /> ))} - + ); }; -const AddItem = ({ dispatch }) => { +const Form = ({ item, onChange, identifier = '' }) => { + const { t } = useTranslation(['leftSidebar', 'app']); + + return ( +
+ onChange(`${identifier}title`, v)} + /> + + onChange(`${identifier}subtitle`, v)} + /> + +