Skip to content

Commit 26cc227

Browse files
author
Roshan Jossy
committed
add components for story abstract and preview footer
1 parent eaaea14 commit 26cc227

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

src/components/feed/StoryAbstract.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type StoryAbstractProps = {
2+
abstract: string
3+
}
4+
5+
export default function StoryAbstract({ abstract }: StoryAbstractProps) {
6+
return <div>{abstract}</div>
7+
}

src/components/feed/StoryPreview.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { graphql, useFragment } from 'react-relay'
22
import { StoryPreview_node$key } from '../../queries/__generated__/StoryPreview_node.graphql'
33
import Card from '../Card'
4+
import StoryAbstract from './StoryAbstract'
5+
import StoryPreviewFooter from './StoryPreviewFooter'
46
import UserSnippet from './UserSnippet'
57

68
type StoryPreviewProps = {
@@ -25,15 +27,15 @@ const StoryPreview = ({ story }: StoryPreviewProps) => {
2527
)
2628

2729
return (
28-
<>
29-
<Card classes="my-8 flex flex-col">
30-
<UserSnippet user={data.createdBy} />
31-
<div className="prose dark:text-gray-100">
32-
<h3 className="dark:text-gray-200">{data.title}</h3>
33-
<p>{data.abstractContent}</p>
34-
</div>
35-
</Card>
36-
</>
30+
<Card classes="my-8 flex flex-col">
31+
<UserSnippet user={data.createdBy} />
32+
<div className="prose dark:text-gray-100">
33+
<h3 className="dark:text-gray-200">{data.title}</h3>
34+
<p>{data.abstractContent}</p>
35+
</div>
36+
<StoryAbstract abstract={data.abstractContent} />
37+
<StoryPreviewFooter />
38+
</Card>
3739
)
3840
}
3941

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { BiCommentDetail } from '@react-icons/all-files/bi/BiCommentDetail'
2+
import { RiHeart3Fill } from '@react-icons/all-files/ri/RiHeart3Fill'
3+
import { RiHeartLine } from '@react-icons/all-files/ri/RiHeartLine'
4+
export default function StoryPreviewFooter() {
5+
return (
6+
<div className="flex flex-row items-center">
7+
<BiCommentDetail />
8+
<span className="text-sm"> 10 </span>
9+
<RiHeart3Fill />
10+
<RiHeartLine />
11+
</div>
12+
)
13+
}

src/components/feed/UserSnippet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const UserSnippet = ({ user }: UserSnippetProps) => {
2727
<img
2828
src={data.avatar}
2929
alt={`${data.handle}'s avatar`}
30-
className="w-12 h-12 rounded-sm"
30+
className="w-12 h-12 rounded-md"
3131
/>
3232
<div className="flex flex-col mx-2">
3333
<div className="flex flex-row">

0 commit comments

Comments
 (0)