Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix layout issues around images on the About page for narrow screens (#471) #477

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/components/about/PageTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,34 @@ const PageTemplateWrapper = styled.article`
}

.content {
display: inline-flex;
align-items: flex-start;
margin-top: 10px;

p {
margin: 0;
}

@media ${({ theme }) => theme.device.desktop} {
display: inline-flex;
align-items: flex-start;
}

@media ${({ theme }) => theme.device.mobile} {
overflow: hidden;
margin-top: 20px;

img {
max-width: 100%;
height: 100%;
float: left;
clear: left;
}
}

.div-aux {
float: left;
width: 0px;
height: 170px;
}
}
`

Expand Down
11 changes: 7 additions & 4 deletions src/components/about/PhotoGridUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@ import styled from 'styled-components/macro'

const Grid = styled.div`
@media ${({ theme }) => theme.device.mobile} {
grid-template-columns: 160px 160px;
grid-template-columns: repeat(2, 1fr);
gap: 6px;
margin-top: 17px;
margin-bottom: 17px;
justify-content: center;
float: 'top';
}
@media ${({ theme }) => theme.device.desktop} {
margin: 16px;
gap: 8px;
grid-template-columns: 156px auto;
float: ${(props) => props.float || 'right'};
}
color: ${({ theme }) => theme.secondaryText};
float: ${(props) => props.float || 'right'};
display: grid;
`

const Image = styled.img`
@media ${({ theme }) => theme.device.mobile} {
width: 160px;
height: 94px;
width: 100%;
max-height: 250px;
height: auto;
}
@media ${({ theme }) => theme.device.desktop} {
width: 156px;
Expand Down
10 changes: 10 additions & 0 deletions src/components/about/ProjectPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const Project = () => (
<h2>Staff</h2>
<div className="content">
<img src="https://fallingfruit.org/ethan_welty.jpg" alt="" />
<div className="div-aux"></div>
<p>
<em>Executive Director</em>
<br />
Expand Down Expand Up @@ -136,6 +137,7 @@ const Project = () => (
<h2>Board of directors</h2>
<div className="content">
<img src="https://fallingfruit.org/jeff_wanner.jpg" alt="" />
<div className="div-aux"></div>
<p>
<em>President</em>
<br />
Expand All @@ -158,6 +160,7 @@ const Project = () => (
</div>
<div className="content">
<img src="https://fallingfruit.org/craig_durkin.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>Craig Durkin</b>
<br />
Expand All @@ -176,6 +179,7 @@ const Project = () => (
</div>
<div className="content">
<img src="https://fallingfruit.org/emily_sigman.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>Emily Sigman</b>
<br />
Expand Down Expand Up @@ -204,6 +208,7 @@ const Project = () => (
<h2>Board of advisors</h2>
<div className="content">
<img src="https://fallingfruit.org/alan_gibson.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>Alan Gibson</b>
<br />
Expand All @@ -226,6 +231,7 @@ const Project = () => (
</div>
<div className="content">
<img src="https://fallingfruit.org/ana_carolina_de_lima.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>Ana Carolina de Lima</b>
<br />
Expand All @@ -246,6 +252,7 @@ const Project = () => (
</div>
<div className="content">
<img src="https://fallingfruit.org/caleb_phillips.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>Caleb Phillips</b>
<br />
Expand All @@ -269,6 +276,7 @@ const Project = () => (
</div>
<div className="content">
<img src="https://fallingfruit.org/cristina_rubke.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>Cristina Rubke</b>
<br />
Expand All @@ -295,6 +303,7 @@ const Project = () => (
</div>
<div className="content">
<img src="https://fallingfruit.org/david_craft.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>David Craft</b>
<br />
Expand All @@ -315,6 +324,7 @@ const Project = () => (
</div>
<div className="content">
<img src="https://fallingfruit.org/tristram_stuart.jpg" alt="" />
<div className="div-aux"></div>
<p>
<b>Tristram Stuart</b>
<br />
Expand Down