[fix]: Conditional rendering of SectionTitles
This commit is contained in:
Generated
+317
-933
File diff suppressed because it is too large
Load Diff
@@ -316,10 +316,12 @@ const Markdown = props => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
{isSocial(props.social) ? `<p align="left">` : ""} <br />
|
{isSocial(props.social) ? (
|
||||||
<>
|
<>
|
||||||
<SectionTitle label="Connect with me:" />
|
<SectionTitle label="Connect with me:" />
|
||||||
</>
|
{`<p align="left">`}
|
||||||
|
</>) : ""}
|
||||||
|
<br />
|
||||||
<>
|
<>
|
||||||
<DisplaySocial
|
<DisplaySocial
|
||||||
base="https://codepen.io"
|
base="https://codepen.io"
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ const MarkdownPreview = props => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const SectionTitle = props => {
|
const SectionTitle = props => {
|
||||||
if (props.label) {
|
if (!props.visible)
|
||||||
|
return null
|
||||||
|
else if (props.label) {
|
||||||
return <h3 className="w-full text-lg sm:text-xl">{props.label}</h3>
|
return <h3 className="w-full text-lg sm:text-xl">{props.label}</h3>
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
@@ -111,9 +113,14 @@ const MarkdownPreview = props => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const SocialPreview = props => {
|
const SocialPreview = props => {
|
||||||
|
let viewSocial = false;
|
||||||
|
Object.keys(props.social).forEach(key => {
|
||||||
|
if (props.social[key] && key != 'github')
|
||||||
|
viewSocial = true;
|
||||||
|
})
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-start items-end flex-wrap">
|
<div className="flex justify-start items-end flex-wrap">
|
||||||
<SectionTitle label="Connect with me:" />
|
<SectionTitle label="Connect with me:" visible={viewSocial}/>
|
||||||
<DisplaySocial
|
<DisplaySocial
|
||||||
base="https://codepen.io"
|
base="https://codepen.io"
|
||||||
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codepen.svg"
|
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codepen.svg"
|
||||||
@@ -307,7 +314,7 @@ const MarkdownPreview = props => {
|
|||||||
})
|
})
|
||||||
return listSkills.length > 0 ? (
|
return listSkills.length > 0 ? (
|
||||||
<div className="flex flex-wrap justify-start items-center">
|
<div className="flex flex-wrap justify-start items-center">
|
||||||
<SectionTitle label="Languages and Tools:" />
|
<SectionTitle label="Languages and Tools:" visible={true}/>
|
||||||
{listSkills}
|
{listSkills}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user