-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
styles(blog): UI improvements (#468)
* fix: truncate featured article title and excerpt * styles: allow more excerpt lines in larger viewports * styles: gradient fill to category label * feat: change the blog date to en-US format * feat: create a Meta component for blog posts * styles: hover effect on blog article cards * styles: update Breadcrumbs style * styles: move cover image and excerpt * styles: share buttons * style: table of contents * styles: post meta data * styles: change breadcrumbs color
- Loading branch information
1 parent
471dab5
commit c9f2ba7
Showing
16 changed files
with
283 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
import { Avatar, AvatarGroup, Typography } from '@mui/material' | ||
import css from '../styles.module.css' | ||
import { Avatar, AvatarGroup } from '@mui/material' | ||
import type { Entry } from 'contentful' | ||
import type { TypeAuthorSkeleton } from '@/contentful/types' | ||
import { isAsset } from '@/lib/typeGuards' | ||
import { formatAuthorsList } from '@/components/Blog/utils/formatAuthorsList' | ||
|
||
export type AuthorsProps = Entry<TypeAuthorSkeleton, undefined, string>[] | ||
|
||
const Authors = ({ authors }: { authors: AuthorsProps }) => { | ||
return ( | ||
<div className={css.authors}> | ||
<AvatarGroup className={css.avatarGroup} max={3}> | ||
{authors.map((author) => { | ||
const { name, picture } = author.fields | ||
const Authors = ({ authors }: { authors: AuthorsProps }) => ( | ||
<AvatarGroup max={3}> | ||
{authors.map((author) => { | ||
const { name, picture } = author.fields | ||
|
||
return isAsset(picture) && picture.fields.file?.url ? ( | ||
<Avatar key={name} src={picture.fields.file.url} alt={picture.fields.title} /> | ||
) : undefined | ||
})} | ||
</AvatarGroup> | ||
|
||
<Typography variant="caption" color="text.primary"> | ||
{formatAuthorsList(authors)} | ||
</Typography> | ||
</div> | ||
) | ||
} | ||
return isAsset(picture) && picture.fields.file?.url ? ( | ||
<Avatar key={name} src={picture.fields.file.url} alt={picture.fields.title} /> | ||
) : undefined | ||
})} | ||
</AvatarGroup> | ||
) | ||
|
||
export default Authors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
.breadcrumbs, | ||
.breadcrumbs li { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.breadcrumbs a { | ||
color: var(--mui-palette-text-primary); | ||
margin-bottom: 24px; | ||
transition-duration: var(--transition-duration); | ||
} | ||
|
||
.breadcrumbs a:hover { | ||
color: var(--mui-palette-primary-light); | ||
text-decoration: underline; | ||
} | ||
|
||
.breadcrumbs :global .MuiBreadcrumbs-separator { | ||
margin: 0 4px; | ||
width: 8px; | ||
height: 8px; | ||
} | ||
|
||
.breadcrumbs :global .MuiTypography-root { | ||
line-height: inherit; | ||
} | ||
|
||
.category { | ||
display: flex; | ||
gap: 4px; | ||
align-items: center; | ||
.title { | ||
width: 290px; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
color: var(--mui-palette-primary-light); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.contentsTable { | ||
margin: 0; | ||
border: 1px solid var(--mui-palette-border-light); | ||
border-radius: 8px; | ||
padding: 24px; | ||
margin-bottom: 24px; | ||
} | ||
|
||
.contentsTable ol { | ||
list-style-type: none; | ||
padding-left: 0px; | ||
} | ||
|
||
.contentsTable li { | ||
counter-increment: step-counter; | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 8px; | ||
} | ||
|
||
.contentsTable li::before { | ||
content: counter(step-counter) ' '; | ||
white-space: pre; | ||
color: var(--mui-palette-primary-light); | ||
} | ||
|
||
.contentsTable a:hover { | ||
text-decoration: underline; | ||
color: var(--mui-palette-primary-main); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.