Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

extracted strings from certifications tab

Amruth Pillai5cfad6767c5e
diff --git a/src/components/LeftSidebar/tabs/Awards.js b/src/components/LeftSidebar/tabs/Awards.js
index cd94f632b..2b9a61c6e 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 }) => {
<Form item={item} onChange={onChange} identifier={identifier} />
<ItemActions
- item={item}
- onChange={onChange}
- type="awards"
- identifier={identifier}
dispatch={dispatch}
- deleteItem={deleteItem}
first={first}
- moveItemUp={moveItemUp}
+ identifier={identifier}
+ item={item}
last={last}
- moveItemDown={moveItemDown}
+ onChange={onChange}
+ type="awards"
/>
</div>
</div>
diff --git a/src/components/LeftSidebar/tabs/Certifications.js b/src/components/LeftSidebar/tabs/Certifications.js
index 5cdd5f832..18805d820 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 }) => {
</div>
<div className="col-span-5">
<TextField
- placeholder="Heading"
+ placeholder={t('heading.placeholder')}
value={data.certifications.heading}
onChange={v => onChange('data.certifications.heading', v)}
/>
@@ -45,12 +49,44 @@ const CertificationsTab = ({ data, onChange }) => {
/>
))}
- <AddItem dispatch={dispatch} />
+ <AddItem heading={data.certifications.heading} dispatch={dispatch} />
</>
);
};
-const AddItem = ({ dispatch }) => {
+const Form = ({ item, onChange, identifier = '' }) => {
+ const { t } = useTranslation(['leftSidebar', 'app']);
+
+ return (
+ <div>
+ <TextField
+ className="mb-6"
+ label={t('certifications.title.label')}
+ placeholder={t('certifications.title.placeholder')}
+ value={item.title}
+ onChange={v => onChange(`${identifier}title`, v)}
+ />
+
+ <TextField
+ className="mb-6"
+ label={t('certifications.subtitle.label')}
+ placeholder={t('certifications.subtitle.placeholder')}
+ value={item.subtitle}
+ onChange={v => onChange(`${identifier}subtitle`, v)}
+ />
+
+ <TextArea
+ className="mb-6"
+ label={t('app:item.description.label')}
+ placeholder={t('certifications.description.placeholder')}
+ value={item.description}
+ onChange={v => onChange(`${identifier}description`, v)}
+ />
+ </div>
+ );
+};
+
+const AddItem = ({ heading, dispatch }) => {
const [isOpen, setOpen] = useState(false);
const [item, setItem] = useState({
id: uuidv4(),
@@ -80,48 +116,12 @@ const AddItem = ({ dispatch }) => {
return (
<div className="my-4 border border-gray-200 rounded p-5">
- <div
- className="flex justify-between items-center cursor-pointer"
- onClick={() => setOpen(!isOpen)}
- >
- <h6 className="text-sm font-medium">Add Certification</h6>
- <i className="material-icons">{isOpen ? 'expand_less' : 'expand_more'}</i>
- </div>
+ <ItemHeading heading={heading} setOpen={setOpen} isOpen={isOpen} />
<div className={`mt-6 ${isOpen ? 'block' : 'hidden'}`}>
- <TextField
- label="Title"
- className="mb-6"
- placeholder="Android Development Nanodegree"
- value={item.title}
- onChange={v => onChange('title', v)}
- />
-
- <TextField
- label="Subtitle"
- className="mb-6"
- placeholder="Udacity"
- value={item.subtitle}
- onChange={v => onChange('subtitle', v)}
- />
+ <Form item={item} onChange={onChange} />
- <TextArea
- label="Description"
- className="mb-6"
- value={item.description}
- onChange={v => onChange('description', v)}
- />
-
- <button
- type="button"
- onClick={onSubmit}
- className="bg-gray-600 hover:bg-gray-700 text-white text-sm font-medium py-2 px-5 rounded"
- >
- <div className="flex items-center">
- <i className="material-icons mr-2 font-bold text-base">add</i>
- <span className="text-sm">Add</span>
- </div>
- </button>
+ <AddItemButton onSubmit={onSubmit} />
</div>
</div>
);
@@ -133,49 +133,19 @@ const Item = ({ item, index, onChange, dispatch, first, last }) => {
return (
<div className="my-4 border border-gray-200 rounded p-5">
- <div
- className="flex justify-between items-center cursor-pointer"
- onClick={() => setOpen(!isOpen)}
- >
- <h6 className="text-sm font-medium">{item.title}</h6>
- <i className="material-icons">{isOpen ? 'expand_less' : 'expand_more'}</i>
- </div>
+ <ItemHeading title={item.title} setOpen={setOpen} isOpen={isOpen} />
<div className={`mt-6 ${isOpen ? 'block' : 'hidden'}`}>
- <TextField
- label="Title"
- className="mb-6"
- placeholder="Android Development Nanodegree"
- value={item.title}
- onChange={v => onChange(`${identifier}.title`, v)}
- />
-
- <TextField
- label="Subtitle"
- className="mb-6"
- placeholder="Udacity"
- value={item.subtitle}
- onChange={v => onChange(`${identifier}.subtitle`, v)}
- />
-
- <TextArea
- label="Description"
- className="mb-6"
- value={item.description}
- onChange={v => onChange(`${identifier}.description`, v)}
- />
+ <Form item={item} onChange={onChange} identifier={identifier} />
<ItemActions
- item={item}
- onChange={onChange}
- type="certifications"
- identifier={identifier}
dispatch={dispatch}
- deleteItem={deleteItem}
first={first}
- moveItemUp={moveItemUp}
+ identifier={identifier}
+ item={item}
last={last}
- moveItemDown={moveItemDown}
+ onChange={onChange}
+ type="certifications"
/>
</div>
</div>
diff --git a/src/components/LeftSidebar/tabs/Education.js b/src/components/LeftSidebar/tabs/Education.js
index 76751feed..75c5675b6 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 3411e1ccb..793cc6b7f 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 000000000..8d8fc36d7
--- /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 908977afa..e25802b50 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,
};