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;
|
font-style: bold;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
color: #eeeeee;
|
color: ${(props) =>
|
||||||
|
theming.theme(props.theme.currentTheme, {
|
||||||
|
light: theming.light.color2,
|
||||||
|
dark: theming.dark.color2,
|
||||||
|
})};
|
||||||
`
|
`
|
||||||
|
|
||||||
const StyledMetaContainer = styled.small``
|
const StyledMetaContainer = styled.small``
|
||||||
|
@ -76,8 +80,8 @@ const PostCard = (props: Props) => {
|
||||||
<StyledPostCard>
|
<StyledPostCard>
|
||||||
<PostCardContainer to={process.env.PUBLIC_URL + postData.url}>
|
<PostCardContainer to={process.env.PUBLIC_URL + postData.url}>
|
||||||
<StyledTitle>
|
<StyledTitle>
|
||||||
{postData?.title || "No title"}
|
{postData.title || "No title"}
|
||||||
{/* show (series for regex matching "/series/<series-title>") */}
|
{/* show "(series)" for urls that matches regex "/series/<series-title>" */}
|
||||||
{/\/series\/[^/]*$/.test(postData.url) && " (series)"}
|
{/\/series\/[^/]*$/.test(postData.url) && " (series)"}
|
||||||
</StyledTitle>
|
</StyledTitle>
|
||||||
|
|
||||||
|
@ -93,17 +97,19 @@ const PostCard = (props: Props) => {
|
||||||
<hr />
|
<hr />
|
||||||
<FontAwesomeIcon icon={faCalendar} />
|
<FontAwesomeIcon icon={faCalendar} />
|
||||||
|
|
||||||
{postData?.date || "Unknown date"}
|
{postData.date || "Unknown date"}
|
||||||
|
|
||||||
<FontAwesomeIcon icon={faHourglass} />
|
<FontAwesomeIcon icon={faHourglass} />
|
||||||
|
|
||||||
{postData?.readTime ? postData.readTime + " read" : "unknown length"}
|
{postData.readTime
|
||||||
|
? postData.readTime + " read"
|
||||||
|
: "unknown read time"}
|
||||||
|
|
||||||
<FontAwesomeIcon icon={faBook} />
|
<FontAwesomeIcon icon={faBook} />
|
||||||
|
|
||||||
{postData?.wordCount
|
{postData.wordCount
|
||||||
? postData.wordCount + " words"
|
? postData.wordCount + " words"
|
||||||
: "unknown words"}
|
: "unknown length"}
|
||||||
</StyledMetaContainer>
|
</StyledMetaContainer>
|
||||||
</PostCardContainer>
|
</PostCardContainer>
|
||||||
</StyledPostCard>
|
</StyledPostCard>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue