Post Card update
- fixed title color when using light theme - removed unnecessary `?` from the code - improved wording
This commit is contained in:
parent
51dbf855c2
commit
01ace5aea3
1 changed files with 13 additions and 7 deletions
|
@ -56,7 +56,11 @@ const StyledTitle = styled.h1`
|
|||
font-style: bold;
|
||||
margin: 0;
|
||||
margin-bottom: 1rem;
|
||||
color: #eeeeee;
|
||||
color: ${(props) =>
|
||||
theming.theme(props.theme.currentTheme, {
|
||||
light: theming.light.color2,
|
||||
dark: theming.dark.color2,
|
||||
})};
|
||||
`
|
||||
|
||||
const StyledMetaContainer = styled.small``
|
||||
|
@ -76,8 +80,8 @@ const PostCard = (props: Props) => {
|
|||
<StyledPostCard>
|
||||
<PostCardContainer to={process.env.PUBLIC_URL + postData.url}>
|
||||
<StyledTitle>
|
||||
{postData?.title || "No title"}
|
||||
{/* show (series for regex matching "/series/<series-title>") */}
|
||||
{postData.title || "No title"}
|
||||
{/* show "(series)" for urls that matches regex "/series/<series-title>" */}
|
||||
{/\/series\/[^/]*$/.test(postData.url) && " (series)"}
|
||||
</StyledTitle>
|
||||
|
||||
|
@ -93,17 +97,19 @@ const PostCard = (props: Props) => {
|
|||
<hr />
|
||||
<FontAwesomeIcon icon={faCalendar} />
|
||||
|
||||
{postData?.date || "Unknown date"}
|
||||
{postData.date || "Unknown date"}
|
||||
|
||||
<FontAwesomeIcon icon={faHourglass} />
|
||||
|
||||
{postData?.readTime ? postData.readTime + " read" : "unknown length"}
|
||||
{postData.readTime
|
||||
? postData.readTime + " read"
|
||||
: "unknown read time"}
|
||||
|
||||
<FontAwesomeIcon icon={faBook} />
|
||||
|
||||
{postData?.wordCount
|
||||
{postData.wordCount
|
||||
? postData.wordCount + " words"
|
||||
: "unknown words"}
|
||||
: "unknown length"}
|
||||
</StyledMetaContainer>
|
||||
</PostCardContainer>
|
||||
</StyledPostCard>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue