Skip to content

Commit

Permalink
Fix layout issues around images on the About page for narrow screens (#…
Browse files Browse the repository at this point in the history
…471):

- Updated image grid to span full width on mobile.
- In the staff section, images remain aligned to the left, with text on the right. When the text exceeds the image height, it wraps beneath and occupies full width for better readability.
  • Loading branch information
marceloams committed Oct 9, 2024
1 parent a69e0ed commit 18deada
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
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

0 comments on commit 18deada

Please sign in to comment.