Skip to content

Commit 868546e

Browse files
committed
refactor: enhance sortOptions in HashnodeCard with reactions and comments
1 parent a19477e commit 868546e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/features/cards/components/hashnodeCard/HashnodeCard.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { useCallback } from 'react'
2+
import { AiTwotoneHeart } from 'react-icons/ai'
3+
import { BiCommentDetail } from 'react-icons/bi'
24
import { Card } from 'src/components/Elements'
35
import { ListComponent } from 'src/components/List'
46
import { Article, CardPropsType } from 'src/types'
@@ -48,7 +50,19 @@ export function HashnodeCard(props: CardPropsType) {
4850
sortBy={sortBy}
4951
language={language || GLOBAL_TAG.value}
5052
globalTag={GLOBAL_TAG}
51-
sortOptions={[]}
53+
sortOptions={(defaults) => [
54+
...defaults,
55+
{
56+
label: 'Reactions',
57+
value: 'points_count',
58+
icon: <AiTwotoneHeart />,
59+
},
60+
{
61+
label: 'Comments',
62+
value: 'comments_count',
63+
icon: <BiCommentDetail />,
64+
},
65+
]}
5266
/>
5367
}
5468
{...props}>

0 commit comments

Comments
 (0)