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)}
+ />
+
+
+ );
+};
+
+const AddItem = ({ heading, dispatch }) => {
const [isOpen, setOpen] = useState(false);
const [item, setItem] = useState({
id: uuidv4(),
@@ -80,48 +116,12 @@ const AddItem = ({ dispatch }) => {
return (
-
setOpen(!isOpen)}
- >
-
Add Certification
- {isOpen ? 'expand_less' : 'expand_more'}
-
+
-
onChange('title', v)}
- />
+
- onChange('subtitle', v)}
- />
-
-
);
@@ -133,49 +133,19 @@ const Item = ({ item, index, onChange, dispatch, first, last }) => {
return (
-
setOpen(!isOpen)}
- >
-
{item.title}
- {isOpen ? 'expand_less' : 'expand_more'}
-
+
- onChange(`${identifier}.title`, v)}
- />
-
- onChange(`${identifier}.subtitle`, v)}
- />
-
-
diff --git a/src/components/LeftSidebar/tabs/Education.js b/src/components/LeftSidebar/tabs/Education.js
index 76751fee..75c5675b 100644
--- a/src/components/LeftSidebar/tabs/Education.js
+++ b/src/components/LeftSidebar/tabs/Education.js
@@ -13,7 +13,7 @@ import AddItemButton from '../../../shared/AddItemButton';
import ItemHeading from '../../../shared/ItemHeading';
const EducationTab = ({ data, onChange }) => {
- const { t } = useTranslation('app');
+ const { t } = useTranslation();
const context = useContext(AppContext);
const { dispatch } = context;
diff --git a/src/components/LeftSidebar/tabs/Work.js b/src/components/LeftSidebar/tabs/Work.js
index 3411e1cc..793cc6b7 100644
--- a/src/components/LeftSidebar/tabs/Work.js
+++ b/src/components/LeftSidebar/tabs/Work.js
@@ -13,7 +13,7 @@ import AddItemButton from '../../../shared/AddItemButton';
import ItemHeading from '../../../shared/ItemHeading';
const WorkTab = ({ data, onChange }) => {
- const { t } = useTranslation('app');
+ const { t } = useTranslation();
const context = useContext(AppContext);
const { dispatch } = context;
diff --git a/src/i18n/resources/en/leftSidebar/certifications.json b/src/i18n/resources/en/leftSidebar/certifications.json
new file mode 100644
index 00000000..8d8fc36d
--- /dev/null
+++ b/src/i18n/resources/en/leftSidebar/certifications.json
@@ -0,0 +1,13 @@
+{
+ "title": {
+ "label": "Title",
+ "placeholder": "Android Development Nanodegree"
+ },
+ "subtitle": {
+ "label": "Subtitle",
+ "placeholder": "Udacity"
+ },
+ "description": {
+ "placeholder": ""
+ }
+}
diff --git a/src/i18n/resources/en/leftSidebar/index.js b/src/i18n/resources/en/leftSidebar/index.js
index 908977af..e25802b5 100644
--- a/src/i18n/resources/en/leftSidebar/index.js
+++ b/src/i18n/resources/en/leftSidebar/index.js
@@ -3,6 +3,7 @@ import objective from './objective.json';
import work from './work.json';
import education from './education.json';
import awards from './awards.json';
+import certifications from './certifications.json';
export default {
profile,
@@ -10,4 +11,5 @@ export default {
work,
education,
awards,
+ certifications,
};