- implement ability to rename sections

- clean up kannada translations
This commit is contained in:
Amruth Pillai
2020-07-17 08:36:46 +05:30
parent c57eb2e9aa
commit 816e400b31
32 changed files with 249 additions and 156 deletions

View File

@ -10,6 +10,7 @@ import styles from './LeftNavbar.module.css';
const LeftNavbar = () => {
const { t } = useTranslation();
return (
<div className={styles.container}>
<Tooltip title={t('builder.tooltips.backToDashboard')} placement="right">

View File

@ -1,6 +1,5 @@
import React, { Fragment, memo } from 'react';
import { Element } from 'react-scroll';
import { useTranslation } from 'react-i18next';
import sections from '../../../data/leftSections';
import LeftNavbar from './LeftNavbar';
import styles from './LeftSidebar.module.css';
@ -48,30 +47,26 @@ const getComponent = (id) => {
}
};
const LeftSidebar = () => {
const { t } = useTranslation();
const SidebarSection = ({ id, event }) => {
const Component = getComponent(id);
return (
<Fragment key={id}>
<Element name={id}>
<Component id={id} event={event} />
</Element>
<hr />
</Fragment>
);
};
const LeftSidebar = () => {
return (
<div className="flex">
<LeftNavbar />
<div id="LeftSidebar" className={styles.container}>
{sections.map(({ id, event }) => {
const Component = getComponent(id);
return (
<Fragment key={id}>
<Element name={id}>
<Component
id={id}
name={t(`builder.sections.${id}`)}
event={event}
/>
</Element>
<hr />
</Fragment>
);
})}
{sections.map(SidebarSection)}
</div>
</div>
);

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Awards = ({ id, name, event }) => {
const Awards = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List
path={path}

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Certifications = ({ id, name, event }) => {
const Certifications = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List
path={path}

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Education = ({ id, name, event }) => {
const Education = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List
hasDate

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Hobbies = ({ id, name, event }) => {
const Hobbies = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List path={path} event={event} titlePath="name" />
</section>

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Languages = ({ id, name, event }) => {
const Languages = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List path={path} event={event} titlePath="name" subtitlePath="fluency" />
</section>

View File

@ -3,12 +3,18 @@ import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
const Objective = ({ name }) => {
const Objective = ({ id }) => {
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<Input
type="textarea"

View File

@ -4,12 +4,18 @@ import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import PhotoUpload from '../../../shared/PhotoUpload';
const Profile = ({ name }) => {
const Profile = ({ id }) => {
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<PhotoUpload />

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Projects = ({ id, name, event }) => {
const Projects = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List
path={path}

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const References = ({ id, name, event }) => {
const References = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List
path={path}

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Skills = ({ id, name, event }) => {
const Skills = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List path={path} event={event} titlePath="name" subtitlePath="level" />
</section>

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Social = ({ id, name, event }) => {
const Social = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List
path={path}

View File

@ -1,13 +1,22 @@
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
import Heading from '../../../shared/Heading';
import Input from '../../../shared/Input';
import List from '../../lists/List';
const Work = ({ id, name, event }) => {
const Work = ({ id, event }) => {
const path = `${id}.items`;
const { t } = useTranslation();
return (
<section>
<Heading>{name}</Heading>
<Heading id={id} />
<Input
name="heading"
label={t('builder.sections.heading')}
path={`${id}.heading`}
/>
<List
hasDate