Skip to content

Commit

Permalink
Revert unnec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
joyliu-q committed Aug 24, 2023
1 parent 35fbac7 commit 190466a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/components/Blog/Byline.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { Link, useStaticQuery, graphql } from 'gatsby'
import styled from 'styled-components'
import { FluidObject, GatsbyImageFluidProps, GatsbyImageProps } from 'gatsby-image'
import { FluidObject, GatsbyImageProps } from 'gatsby-image'
import BackgroundImage from 'gatsby-background-image'

import { TEAM_MEMBER_ROUTE, HOME_ROUTE } from '../../constants/routes'
Expand Down Expand Up @@ -83,7 +83,7 @@ const Byline = ({ authors }: { authors: IMember[] }) => {
)
}

const getMemberImage = (localImage: { childImageSharp: GatsbyImageFluidProps }) =>
const getMemberImage = (localImage: { childImageSharp: GatsbyImageProps }) =>
(localImage &&
localImage.childImageSharp &&
localImage.childImageSharp.fluid) ||
Expand All @@ -94,7 +94,7 @@ const Byline = ({ authors }: { authors: IMember[] }) => {
{authors.map(({ pennkey, localImage, name }) => (
<AuthorLink key={pennkey} to={TEAM_MEMBER_ROUTE(pennkey)}>
<ThumbnailWrapper>
{localImage && <Thumbnail fluid={getMemberImage(localImage)} />}
<Thumbnail fluid={getMemberImage(localImage)} />
</ThumbnailWrapper>
<span>{name}</span>
</AuthorLink>
Expand Down
5 changes: 2 additions & 3 deletions src/components/Blog/MemberBio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
maxWidth,
M2,
} from '../../constants/measurements'
import { FluidObject } from 'gatsby-image'

const markdownProcessor = remark().use(html)

Expand Down Expand Up @@ -78,13 +77,13 @@ const MemberBio = ({
const [bioAsHtml, updateBioAsHtml] = useState(bio)
markdownProcessor
.process(bio || '')
.then(({ contents: b }) => updateBioAsHtml(b as any))
.then(({ contents: b }) => updateBioAsHtml(b))

return (
<Fade distance={M1}>
<Card shaded>
<StyledCenteredFlex>
<Thumbnail src={(localImage?.childImageSharp.fluid as FluidObject).src} />
<Thumbnail src={localImage.childImageSharp.fluid.src} />
<div>
<H4 mb2>{name}</H4>
<Bio dangerouslySetInnerHTML={{ __html: bioAsHtml }} />
Expand Down
9 changes: 4 additions & 5 deletions src/components/Team/TeamMemberPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ export const TeamMemberPreview = ({
name,
roles,
pennkey,
localImage,
localImage: {
childImageSharp: { fluid },
},
semester_joined: semesterJoined,
alumnus,
}: IMember) => (
<Col margin={M2} sm={12} md={6} lg={3} key={pennkey}>
<StyledLink to={TEAM_MEMBER_ROUTE(pennkey)}>
{
localImage?.childImageSharp.fluid && <Image fluid={localImage.childImageSharp.fluid} />
}
{fluid && <Image fluid={fluid} />}
<P mb1 lg>
<strong>{name}</strong>
</P>
Expand Down
6 changes: 2 additions & 4 deletions src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GatsbyImageFluidProps, GatsbyImageProps } from 'gatsby-image'
import { GatsbyImageProps } from 'gatsby-image'

/**
* Given the absolute file path to a markdown file, return the path to the
Expand All @@ -17,8 +17,6 @@ const semesterSeason = (season: string): string => {
return 'Summer'
case 'C':
return 'Fall'
default:
return 'Unknown'
}
}

Expand All @@ -28,7 +26,7 @@ export const semesterToString = (sem: string): string =>
sem.length - 1,
)}`

export const getSrc = (photo: { childImageSharp: GatsbyImageFluidProps }) => {
export const getSrc = (photo: { childImageSharp: GatsbyImageProps }) => {
if (Array.isArray(photo.childImageSharp.fluid)) {
return photo.childImageSharp.fluid[0].src
} else {
Expand Down

0 comments on commit 190466a

Please sign in to comment.