Skip to content

Commit

Permalink
Ok
Browse files Browse the repository at this point in the history
  • Loading branch information
joyliu-q committed Aug 24, 2023
1 parent 78e473d commit 8344261
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/templates/members/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ export type IGenericMemberTemplateProps = IMemberTemplateProps | IAlumniTemplate
export const GenericMemberTemplate = ({ data }: IGenericMemberTemplateProps) => {
// if data is alumniJson, then we are rendering an alumni page
const isAlumni = 'alumniJson' in data
const json = isAlumni ? data.alumniJson : data.membersJson
if (!json) {
return (
<Layout>
<SEO title="Member not found" />
<MediumContainer>
<H1>Member not found</H1>
</MediumContainer>
</Layout>
)
}

const
{
Expand All @@ -206,9 +217,8 @@ export const GenericMemberTemplate = ({ data }: IGenericMemberTemplateProps) =>
team,
website,
semester_joined: semesterJoined,
alumnus,
posts,
} = isAlumni ? data.alumniJson : data.membersJson
} = json

// Bios may contain markdown. Make sure to parse these into HTML!
const [bioAsHtml, updateBioAsHtml] = useState(bio)
Expand Down

0 comments on commit 8344261

Please sign in to comment.