Skip to content

Commit

Permalink
proper footer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-pr-p committed Jul 9, 2018
1 parent be72b4f commit 9053843
Showing 1 changed file with 73 additions and 63 deletions.
136 changes: 73 additions & 63 deletions src/layouts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,88 +17,98 @@ const TemplateWrapper = ({ data, children, location }) => {
socialIcons
} = data.allMarkdownRemark.edges[0].node.frontmatter;

console.log(location.pathname);

return (
<div>
<Helmet title="Justice Democrats" />
<Navbar path={location.pathname} />
<div>{children()}</div>

{(location.pathname != "/join" || location.pathname != "/join/") && (
<div className="my-footer dark-blue-bg row" style={{ color: "white" }}>
<div className="footer-section six columns">
<div className="footer-section-title extra-bold-m">Contact Us</div>
<div className="footer-section-contents medium-m standard-text contact">
<div>
General:
<a
href={`mailto:${generalEmail}`}
target="_blank"
className="bold-m"
>
{generalEmail}
</a>
</div>

<div>
Press:
<a
href={`mailto:${pressEmail}`}
target="_blank"
className="bold-m"
>
{pressEmail}
</a>
{!(location.pathname == "/join" || location.pathname == "/join/") && (
<div>
<div
className="my-footer dark-blue-bg row"
style={{ color: "white" }}
>
<div className="footer-section six columns">
<div className="footer-section-title extra-bold-m">
Contact Us
</div>
<div className="footer-section-contents medium-m standard-text contact">
<div>
General:
<a
href={`mailto:${generalEmail}`}
target="_blank"
className="bold-m"
>
{generalEmail}
</a>
</div>

<div>
Phone:
<a href={`tel:${phone}`} target="_blank" className="bold-m">
{phone}
</a>
</div>
<div>
Press:
<a
href={`mailto:${pressEmail}`}
target="_blank"
className="bold-m"
>
{pressEmail}
</a>
</div>

<div>{address}</div>
</div>
</div>
<div>
Phone:
<a href={`tel:${phone}`} target="_blank" className="bold-m">
{phone}
</a>
</div>

<div className="footer-section six columns">
<div className="footer-section-title extra-bold-m">Quick Links</div>
<div className="footer-section-contents quick-links standard-text">
{quickLinks.map(({ text, url }) => (
<a href={url} target="_blank" className="bold-m">
{text}
</a>
))}
<div>{address}</div>
</div>
</div>

<div className="social-icons">
{socialIcons
.filter(({ type }) => type == "social")
.map(({ icon, url }) => (
<a href={url} target="_blank">
<img src={icon} />
<div className="footer-section six columns">
<div className="footer-section-title extra-bold-m">
Quick Links
</div>
<div className="footer-section-contents quick-links standard-text">
{quickLinks.map(({ text, url }) => (
<a href={url} target="_blank" className="bold-m">
{text}
</a>
))}
</div>

<div className="icon-divider" />
<div className="social-icons">
{socialIcons
.filter(({ type }) => type == "social")
.map(({ icon, url }) => (
<a href={url} target="_blank">
<img src={icon} />
</a>
))}

{socialIcons
.filter(({ type }) => type == "contact")
.map(({ icon, url }) => (
<a href={url} target="_blank">
<img src={icon} />
</a>
))}
<div className="icon-divider" />

{socialIcons
.filter(({ type }) => type == "contact")
.map(({ icon, url }) => (
<a href={url} target="_blank">
<img src={icon} />
</a>
))}
</div>
</div>
</div>
<div className="disclaimer">
<div className="medium-m dark-blue-color paid-for">
{paidForMessage}
</div>
<div className="light-m dark-blue-color copyright">{copyright}</div>
</div>
</div>
)}
<div className="disclaimer">
<div className="medium-m dark-blue-color paid-for">
{paidForMessage}
</div>
<div className="light-m dark-blue-color copyright">{copyright}</div>
</div>
</div>
);
};
Expand Down

0 comments on commit 9053843

Please sign in to comment.