diff --git a/components/layout/text-image-section/text-image-section.js b/components/layout/text-image-section/text-image-section.js index ad4dc9a2..2e4aa1d7 100644 --- a/components/layout/text-image-section/text-image-section.js +++ b/components/layout/text-image-section/text-image-section.js @@ -2,28 +2,34 @@ import { Box, Stack } from '@mui/material' import Image from 'next/image' import PropTypes from 'prop-types' -export const TextImageSection = ({ imageUrl, imageHeight, imageWidth, children }) => ( +export const TextImageSection = ({ imageUrl, imageHeight, imageWidth, imageAlt, children, imageAspectRatio, rounded }) => ( {imageUrl && - + + {imageAlt} + } {children} @@ -35,5 +41,8 @@ TextImageSection.propTypes = { imageUrl: PropTypes.string, imageHeight: PropTypes.number, imageWidth: PropTypes.number, + imageAlt: PropTypes.string, + imageAspectRatio: PropTypes.string, + rounded: PropTypes.bool, children: PropTypes.node.isRequired, } \ No newline at end of file diff --git a/components/people/person-card.js b/components/people/person-card.js index 329a4e2c..ea869642 100644 --- a/components/people/person-card.js +++ b/components/people/person-card.js @@ -1,48 +1,60 @@ -import React from 'react' -import PropTypes from 'prop-types' -import { Card, CardMedia, CardContent, Typography } from '@mui/material' -import { Link } from '../link' -import avatar from '../../images/generic-avatar.svg' -import { useTheme } from '@emotion/react' +import React from "react"; +import PropTypes from "prop-types"; +import { Card, CardMedia, CardContent, Typography, Box } from "@mui/material"; +import { Link } from "../link"; +import avatar from "../../images/generic-avatar.svg"; +import { useTheme } from "@emotion/react"; export const PersonCard = ({ person, showTitle = false, anchorName }) => { const theme = useTheme(); - + return ( - + + + - - [theme.breakpoints.down('sm')]: { - width: 100, - } - }} - image={ person.photoURL ? person.photoURL : avatar.src } - alt={ `${person.firstName} ${person.lastName} photo` } - /> + + + {person.firstName} {person.lastName} + - - - { person.firstName } { person.lastName } - - { showTitle && person.title && ( - { person.title } - )} - - - ) -} + {showTitle && person.title && ( + + {person.title} + + )} + + + + + ); +}; PersonCard.propTypes = { anchorName: PropTypes.string, @@ -54,4 +66,4 @@ PersonCard.propTypes = { title: PropTypes.string, photo: PropTypes.object, }), -} \ No newline at end of file +}; diff --git a/pages/collaborations/[id].js b/pages/collaborations/[id].js index 18eb3f75..39967f5e 100644 --- a/pages/collaborations/[id].js +++ b/pages/collaborations/[id].js @@ -3,6 +3,7 @@ import { fetchStrapiCollaboration } from '../../lib/strapi' import { Link, Page, PersonCard, PersonGrid, Section, Markdown } from '../../components' +import { Divider } from '@mui/material' export default function Collaboration({ collaboration }) { return ( @@ -13,36 +14,49 @@ export default function Collaboration({ collaboration }) { > { !collaboration.featuredImage && collaboration.description && ( -
- - {collaboration.description} - -
+ <> +
+ + {collaboration.description} + +
+ + ) } { collaboration.role && ( -
- - {collaboration.role} - -
+ <> +
+ + {collaboration.role} + +
+ + ) } -
-
    - { - collaboration.projects - .sort((p, q) => p.name.toLowerCase() < q.name.toLowerCase() ? -1 : 1) - .map(project => ( -
  • - { project.name } -
  • - )) - } -
-
+ { + collaboration.projects?.length !== 0 && ( + <> +
+
    + { + collaboration.projects + .sort((p, q) => p.name.toLowerCase() < q.name.toLowerCase() ? -1 : 1) + .map(project => ( +
  • + { project.name } +
  • + )) + } +
+
+ + + ) + }

People

diff --git a/pages/people/[slug].js b/pages/people/[slug].js index aeb1ed79..19438d18 100644 --- a/pages/people/[slug].js +++ b/pages/people/[slug].js @@ -10,6 +10,9 @@ export default function Person({ person }) { imageUrl={ person.photoURL } imageWidth={400} imageHeight={400} + imageAspectRatio={"1 / 1"} + imageAlt={ `Photo of ${ person.firstName } ${ person.lastName }` } + rounded={true} > { person.fullName } diff --git a/pages/teams/index.js b/pages/teams/index.js index 8ec6d762..3aeb7026 100644 --- a/pages/teams/index.js +++ b/pages/teams/index.js @@ -28,7 +28,7 @@ export default function Teams({ teams }) { Learn more about RENCI's Operations teams below. -
    +
      { teams.map(team => (