Skip to content

Commit 67d2bb5

Browse files
committed
Fix blog page font colors
1 parent 212899d commit 67d2bb5

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/pages/blog/[id].js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
VStack,
1111
Wrap,
1212
WrapItem,
13+
useColorMode,
1314
} from '@chakra-ui/react'
1415

1516
import { ArrowBackIcon } from '@chakra-ui/icons'
@@ -45,7 +46,12 @@ export default function Post({ source, frontmatter, postId }) {
4546
<Heading as={'h1'} textAlign={'center'} size='xl' my={4}>
4647
{frontmatter.title}
4748
</Heading>
48-
<Text fontSize={'sm'} color={'gray.700'}>
49+
<Text
50+
fontSize={'sm'}
51+
color={
52+
useColorMode().colorMode === 'dark' ? 'gray.300' : 'gray.600'
53+
}
54+
>
4955
{formatDate(date)} ({distanceToNow(date)})
5056
</Text>
5157

src/pages/blog/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Text,
1212
useColorModeValue,
1313
VStack,
14+
useColorMode,
1415
} from '@chakra-ui/react'
1516

1617
import { motion } from 'framer-motion'
@@ -41,7 +42,13 @@ const SinglePost = ({ page }) => {
4142
{page.title}
4243
</Link>
4344

44-
<Text fontSize={'sm'} color={'gray.600'} py={4}>
45+
<Text
46+
fontSize={'sm'}
47+
color={
48+
useColorMode().colorMode === 'dark' ? 'gray.300' : 'gray.600'
49+
}
50+
py={4}
51+
>
4552
{formatDate(date)} ({distanceToNow(date)})
4653
</Text>
4754

0 commit comments

Comments
 (0)