check if property exists in data object

This commit is contained in:
Amruth Pillai
2020-03-28 13:27:17 +05:30
parent 1fb2c9bea8
commit fef020634c
4 changed files with 35 additions and 1 deletions

View File

@ -70,6 +70,7 @@ const Castform = () => {
);
const Skills = () =>
data.skills &&
data.skills.enable && (
<div>
<Heading title="Skills" />
@ -78,7 +79,7 @@ const Castform = () => {
);
const Objective = () =>
data.objective.enable && <p className="m-5 text-sm">{data.objective.body}</p>;
data.objective && data.objective.enable && <p className="m-5 text-sm">{data.objective.body}</p>;
const WorkItem = x => (
<div key={x.title} className="my-3 px-5">
@ -96,6 +97,7 @@ const Castform = () => {
);
const Work = () =>
data.work &&
data.work.enable && (
<div>
<Heading light title={data.work.heading} />
@ -114,6 +116,7 @@ const Castform = () => {
);
const References = () =>
data.references &&
data.references.enable && (
<div>
<Heading light title={data.references.heading} />
@ -145,6 +148,7 @@ const Castform = () => {
);
const Languages = () =>
data.languages &&
data.languages.enable && (
<div>
<Heading title={data.languages.heading} />
@ -171,6 +175,7 @@ const Castform = () => {
);
const Education = () =>
data.education &&
data.education.enable && (
<div>
<Heading light title={data.education.heading} />
@ -187,6 +192,7 @@ const Castform = () => {
);
const Awards = () =>
data.awards &&
data.awards.enable && (
<div>
<Heading light title={data.awards.heading} />
@ -203,6 +209,7 @@ const Castform = () => {
);
const Certifications = () =>
data.certifications &&
data.certifications.enable && (
<div>
<Heading title={data.certifications.heading} />
@ -218,6 +225,7 @@ const Castform = () => {
);
const Extras = () =>
data.extras &&
data.extras.enable && (
<div>
<Heading title={data.extras.heading} />

View File

@ -55,6 +55,7 @@ const Gengar = () => {
);
const Objective = () =>
data.objective &&
data.objective.enable && (
<div className="flex flex-col justify-center items-start mb-6">
<Heading title={data.objective.heading} />
@ -69,6 +70,7 @@ const Gengar = () => {
);
const Skills = () =>
data.skills &&
data.skills.enable && (
<div className="mb-6">
<Heading title={data.skills.heading} />
@ -103,6 +105,7 @@ const Gengar = () => {
);
const Education = () =>
data.education &&
data.education.enable && (
<div className="mb-6">
<Heading title={data.education.heading} />
@ -119,6 +122,7 @@ const Gengar = () => {
);
const Certifications = () =>
data.certifications &&
data.certifications.enable && (
<div className="mb-6">
<Heading title={data.certifications.heading} />
@ -135,6 +139,7 @@ const Gengar = () => {
);
const Awards = () =>
data.awards &&
data.awards.enable && (
<div className="mb-6">
<Heading title={data.awards.heading} />
@ -153,6 +158,7 @@ const Gengar = () => {
);
const References = () =>
data.references &&
data.references.enable && (
<div>
<Heading title={data.references.heading} />
@ -176,6 +182,7 @@ const Gengar = () => {
);
const Work = () =>
data.work &&
data.work.enable && (
<div className="mb-6">
<Heading title={data.work.heading} />
@ -197,6 +204,7 @@ const Gengar = () => {
);
const Languages = () =>
data.languages &&
data.languages.enable && (
<div>
<Heading title={data.languages.heading} />
@ -212,6 +220,7 @@ const Gengar = () => {
);
const Extras = () =>
data.extras &&
data.extras.enable && (
<div>
<Heading title={data.extras.heading} />

View File

@ -52,6 +52,7 @@ const Onyx = () => {
);
const Objective = () =>
data.objective &&
data.objective.enable && (
<div>
<Heading title={data.objective.heading} />
@ -75,6 +76,7 @@ const Onyx = () => {
);
const Work = () =>
data.work &&
data.work.enable && (
<div>
<Heading title={data.work.heading} />
@ -101,6 +103,7 @@ const Onyx = () => {
);
const Education = () =>
data.education &&
data.education.enable && (
<div>
<Heading title={data.education.heading} />
@ -117,6 +120,7 @@ const Onyx = () => {
);
const Awards = () =>
data.awards &&
data.awards.enable && (
<div>
<Heading title={data.awards.heading} />
@ -133,6 +137,7 @@ const Onyx = () => {
);
const Certifications = () =>
data.certifications &&
data.certifications.enable && (
<div>
<Heading title={data.certifications.heading} />
@ -154,6 +159,7 @@ const Onyx = () => {
);
const Skills = () =>
data.skills &&
data.skills.enable && (
<div>
<Heading title={data.skills.heading} />
@ -175,6 +181,7 @@ const Onyx = () => {
);
const Languages = () =>
data.languages &&
data.languages.enable && (
<div>
<Heading title={data.languages.heading} />
@ -193,6 +200,7 @@ const Onyx = () => {
);
const References = () =>
data.references &&
data.references.enable && (
<div>
<Heading title={data.references.heading} />
@ -208,6 +216,7 @@ const Onyx = () => {
);
const Extras = () =>
data.extras &&
data.extras.enable && (
<div>
<Heading title={data.extras.heading} />

View File

@ -68,6 +68,7 @@ const Pikachu = () => {
);
const Skills = () =>
data.skills &&
data.skills.enable && (
<div>
<Heading title={data.skills.heading} />
@ -86,6 +87,7 @@ const Pikachu = () => {
);
const References = () =>
data.references &&
data.references.enable && (
<div>
<Heading title={data.references.heading} />
@ -107,6 +109,7 @@ const Pikachu = () => {
);
const Languages = () =>
data.languages &&
data.languages.enable && (
<div>
<Heading title={data.languages.heading} />
@ -122,6 +125,7 @@ const Pikachu = () => {
);
const Extras = () =>
data.extras &&
data.extras.enable && (
<div>
<Heading title={data.extras.heading} />
@ -145,6 +149,7 @@ const Pikachu = () => {
);
const Work = () =>
data.work &&
data.work.enable && (
<div>
<Heading title={data.work.heading} />
@ -173,6 +178,7 @@ const Pikachu = () => {
);
const Education = () =>
data.education &&
data.education.enable && (
<div>
<Heading title={data.education.heading} />
@ -189,6 +195,7 @@ const Pikachu = () => {
);
const Awards = () =>
data.awards &&
data.awards.enable && (
<div>
<Heading title={data.awards.heading} />
@ -205,6 +212,7 @@ const Pikachu = () => {
);
const Certifications = () =>
data.certifications &&
data.certifications.enable && (
<div>
<Heading title={data.certifications.heading} />