mirror of
https://github.com/tjsga/tj-sga-website-react.git
synced 2025-04-03 20:00:17 -04:00
Limit photo height for committee and class council
This commit is contained in:
parent
769a72eb8b
commit
35a8cefc14
|
@ -2,7 +2,13 @@ import imageUrl from '../lib/imageUrl';
|
|||
import '../css/article.css';
|
||||
import RowItemHeader from './RowItemHeader';
|
||||
|
||||
export default function MemberRow({ member }: { member: SGA.MemberDocument }) {
|
||||
export default function MemberRow({
|
||||
member,
|
||||
limitPhotoHeight = false,
|
||||
}: {
|
||||
member: SGA.MemberDocument;
|
||||
limitPhotoHeight?: boolean;
|
||||
}) {
|
||||
let thumbnail: React.ReactElement | null = null;
|
||||
if (member.profile_photo) {
|
||||
thumbnail = (
|
||||
|
@ -12,7 +18,15 @@ export default function MemberRow({ member }: { member: SGA.MemberDocument }) {
|
|||
|
||||
return (
|
||||
<div className='d-flex my-4'>
|
||||
<div className='article-row-thumbnail'>{thumbnail}</div>
|
||||
<div
|
||||
className={
|
||||
limitPhotoHeight
|
||||
? 'article-row-thumbnail-height-constrained'
|
||||
: 'article-row-thumbnail'
|
||||
}
|
||||
>
|
||||
{thumbnail}
|
||||
</div>
|
||||
<div className='article-row-content'>
|
||||
<RowItemHeader>{member.name}</RowItemHeader>
|
||||
<i>
|
||||
|
|
|
@ -3,11 +3,17 @@
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
.article-row-thumbnail {
|
||||
.article-row-thumbnail,
|
||||
.article-row-thumbnail-height-constrained {
|
||||
flex: 1;
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
padding-right: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.article-row-thumbnail-height-constrained>img {
|
||||
max-height: 200px;
|
||||
}
|
||||
|
||||
.article-row-content {
|
||||
|
|
|
@ -50,7 +50,11 @@ export default function ClassCouncil() {
|
|||
<>
|
||||
<PrimaryHeader>Class Council {year}</PrimaryHeader>
|
||||
{members.map((member) => (
|
||||
<MemberRow key={member._id} member={member}></MemberRow>
|
||||
<MemberRow
|
||||
limitPhotoHeight
|
||||
key={member._id}
|
||||
member={member}
|
||||
></MemberRow>
|
||||
))}
|
||||
</>
|
||||
))}
|
||||
|
|
|
@ -18,7 +18,7 @@ export default function Committee() {
|
|||
/>
|
||||
<main>
|
||||
{excomm.map((member) => (
|
||||
<MemberRow key={member._id} member={member} />
|
||||
<MemberRow limitPhotoHeight key={member._id} member={member} />
|
||||
))}
|
||||
</main>
|
||||
</>
|
||||
|
|
Loading…
Reference in New Issue
Block a user