changed post card from div
to a
This commit is contained in:
parent
bc064e4307
commit
14737aa71d
1 changed files with 33 additions and 32 deletions
|
@ -1,5 +1,5 @@
|
|||
import styled from "styled-components"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
import { Link } from "react-router-dom"
|
||||
|
||||
import { PostData } from "../../types/types"
|
||||
|
||||
|
@ -55,12 +55,10 @@ interface Props {
|
|||
|
||||
const PostCard = (props: Props) => {
|
||||
const { postData } = props
|
||||
const navigate = useNavigate()
|
||||
|
||||
return (
|
||||
<StyledPostCard
|
||||
onClick={() => navigate(process.env.PUBLIC_URL + postData.url)}
|
||||
>
|
||||
<Link to={process.env.PUBLIC_URL + postData.url}>
|
||||
<StyledPostCard>
|
||||
<StyledTitle>
|
||||
{postData?.title || "No title"}
|
||||
{/* show (series for regex matching "/series/<series-title>") */}
|
||||
|
@ -87,9 +85,12 @@ const PostCard = (props: Props) => {
|
|||
|
||||
<FontAwesomeIcon icon={faBook} />
|
||||
|
||||
{postData?.wordCount ? postData.wordCount + " words" : "unknown words"}
|
||||
{postData?.wordCount
|
||||
? postData.wordCount + " words"
|
||||
: "unknown words"}
|
||||
</StyledMetaContainer>
|
||||
</StyledPostCard>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue