Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new styles for subtask in lab #2033

Merged
merged 5 commits into from
Feb 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions src/templates/LabOverviewTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,43 @@ const LabOverviewTemplate = ({ data, location }) => {
<GuideListing.List className={labOverviewStyles.labGuideList}>
{guides?.nodes
.sort(sortProcedures)
.map(({ fields, frontmatter }, index) => (
<GuideTile
className={labOverviewStyles.labGuideCard}
to={fields.slug}
key={index}
duration={frontmatter.duration}
title={`${frontmatter.procIdx}. ${
frontmatter.tileShorthand?.title || frontmatter.title
}`}
description={
frontmatter.tileShorthand?.description ||
frontmatter.description
}
/>
))}
.map(({ fields, frontmatter }, index) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attached is the screen shot for this change so it's visible, this is OK for me, so I approve this.
Screen Shot 2022-02-04 at 9 47 45 AM

const procIdxIsInteger = Number.isInteger(
frontmatter.procIdx
);
return (
<GuideTile
css={css`
width: ${procIdxIsInteger ? '100%' : '90%'};
margin-left: ${procIdxIsInteger ? '0' : '10%'};

h3 {
margin-bottom: ${procIdxIsInteger
? '1rem'
: '0.1rem'};
}
p {
margin-bottom: ${procIdxIsInteger
? '0.8rem'
: '0.1rem'};
}
`}
className={labOverviewStyles.labGuideCard}
to={fields.slug}
key={index}
duration={frontmatter.duration}
title={`${
procIdxIsInteger ? `${frontmatter.procIdx}.` : ''
} ${
frontmatter.tileShorthand?.title || frontmatter.title
}`}
description={
frontmatter.tileShorthand?.description ||
frontmatter.description
}
/>
);
})}
</GuideListing.List>
</>
)}
Expand Down