From 01ace5aea391c16b7ec5e5fbe33e53a443671a83 Mon Sep 17 00:00:00 2001 From: developomp Date: Sat, 26 Mar 2022 19:26:48 +0900 Subject: [PATCH] Post Card update - fixed title color when using light theme - removed unnecessary `?` from the code - improved wording --- src/components/PostCard.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/PostCard.tsx b/src/components/PostCard.tsx index 53e3bb7..acf1118 100644 --- a/src/components/PostCard.tsx +++ b/src/components/PostCard.tsx @@ -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) => { - {postData?.title || "No title"} - {/* show (series for regex matching "/series/") */} + {postData.title || "No title"} + {/* show "(series)" for urls that matches regex "/series/" */} {/\/series\/[^/]*$/.test(postData.url) && " (series)"} @@ -93,17 +97,19 @@ const PostCard = (props: Props) => {
    - {postData?.date || "Unknown date"} + {postData.date || "Unknown date"}          - {postData?.readTime ? postData.readTime + " read" : "unknown length"} + {postData.readTime + ? postData.readTime + " read" + : "unknown read time"}          - {postData?.wordCount + {postData.wordCount ? postData.wordCount + " words" - : "unknown words"} + : "unknown length"}