@@ -37,7 +37,7 @@ const BookmarkButton: React.FC<BookmarkButtonProps> = ({ postId }) => {
3737 }
3838
3939 setBookmarkedPost ( true ) ; // Optimistically update the state
40- setBookmarkCount ( prevCount => prevCount + 1 ) ; // Optimistically update the like count
40+ setBookmarkCount ( prevCount => prevCount + 1 ) ; // Optimistically update the bookmark count
4141
4242 try {
4343 await writeContractAsync ( {
@@ -47,14 +47,14 @@ const BookmarkButton: React.FC<BookmarkButtonProps> = ({ postId }) => {
4747 notification . success ( "Bookmarked successfully!" ) ;
4848 } catch ( error ) {
4949 setBookmarkedPost ( false ) ; // Revert the optimistic update if the transaction fails
50- setBookmarkCount ( prevCount => prevCount - 1 ) ; // Revert the like count
50+ setBookmarkCount ( prevCount => prevCount - 1 ) ; // Revert the bookmark count
5151 notification . error ( "Bookmarking failed, please try again." ) ;
5252 }
5353 } ;
5454
5555 const handleRemoveBookmark = async ( ) => {
5656 setBookmarkedPost ( false ) ; // Optimistically update the state
57- setBookmarkCount ( prevCount => prevCount - 1 ) ; // Optimistically update the like count
57+ setBookmarkCount ( prevCount => prevCount - 1 ) ; // Optimistically update the bookmark count
5858
5959 try {
6060 await writeContractAsync ( {
@@ -66,7 +66,7 @@ const BookmarkButton: React.FC<BookmarkButtonProps> = ({ postId }) => {
6666 console . error ( "Error during removing bookmark:" , error ) ;
6767 notification . error ( "Removing bookmark failed, please try again." ) ;
6868 setBookmarkedPost ( true ) ; // Revert the state if the transaction fails
69- setBookmarkCount ( prevCount => prevCount + 1 ) ; // Revert the like count
69+ setBookmarkCount ( prevCount => prevCount + 1 ) ; // Revert the bookmark count
7070 }
7171 } ;
7272
@@ -83,7 +83,7 @@ const BookmarkButton: React.FC<BookmarkButtonProps> = ({ postId }) => {
8383 } , [ postBookmarks ] ) ;
8484
8585 return (
86- < div className = "like -button-container" >
86+ < div className = "bookmark -button-container" >
8787 { bookmarkedPost ? (
8888 < button className = "icon-button" onClick = { handleRemoveBookmark } >
8989 < SolidBookmarkIcon className = "text-orange-500 bookmark-icon" />
@@ -94,19 +94,19 @@ const BookmarkButton: React.FC<BookmarkButtonProps> = ({ postId }) => {
9494 </ button >
9595 ) }
9696
97- < span className = "like -counter" > { bookmarkCount } </ span >
97+ < span className = "bookmark -counter" > { bookmarkCount } </ span >
9898 < style jsx > { `
99- .like -button-container {
99+ .bookmark -button-container {
100100 display: flex;
101101 align-items: center;
102102 }
103- .like -button {
103+ .bookmark -button {
104104 font-size: 24px; /* Adjust the size of the heart icon */
105105 border: none;
106106 background: none;
107107 cursor: pointer;
108108 }
109- .like -counter {
109+ .bookmark -counter {
110110 margin-left: 8px;
111111 font-size: 16px;
112112 }
0 commit comments