Skip to content

Commit 63b8abd

Browse files
committed
UI improvement, new contract
1 parent f9c1322 commit 63b8abd

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/nextjs/app/create/Create.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const Create = ({ onClose }: { onClose: any }) => {
5353
};
5454

5555
generateTokenURIString();
56-
}, [description, uploadedImageIpfsPath]);
56+
}, [name, externalUrl, description, uploadedImageIpfsPath]);
5757

5858
return (
5959
<>

packages/nextjs/components/punk-society/BookmarkButton.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

packages/nextjs/components/punk-society/PostCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from "react";
44
import Image from "next/image";
55
import Link from "next/link";
66
import BookmarkButton from "./BookmarkButton";
7-
import CommentSection from "./CommentSection";
7+
// import CommentSection from "./CommentSection";
88
// import LikeButton from "./LikedButton";
99
// import { ProfileAddress } from "./ProfileAddress";
1010
import {
@@ -30,7 +30,7 @@ export interface Post extends Partial<NFTMetaData> {
3030

3131
export const PostCard = ({ post }: { post: Post }) => {
3232
const [isModalOpen, setIsModalOpen] = useState(false);
33-
const [showCommentSection, setShowCommentSection] = useState(false);
33+
// const [showCommentSection, setShowCommentSection] = useState(false);
3434

3535
const { data: profileInfo } = useScaffoldReadContract({
3636
contractName: "BasedProfile",
@@ -156,7 +156,7 @@ export const PostCard = ({ post }: { post: Post }) => {
156156
</button>
157157
</div>
158158
</div>
159-
{showCommentSection && <CommentSection postId={BigInt(post.postId || 0)} />}
159+
{/* {showCommentSection && <CommentSection postId={BigInt(post.postId || 0)} />} */}
160160
</div>
161161

162162
{/* Modal for fullscreen image */}

0 commit comments

Comments
 (0)