Changeset 73b69b2 for chapterx-frontend/src/pages/story
- Timestamp:
- 03/24/26 22:13:36 (3 months ago)
- Branches:
- main
- Children:
- 7fbb91c
- Parents:
- acf690c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapterx-frontend/src/pages/story/StoryDetailPage.tsx
racf690c r73b69b2 23 23 const [listModalOpen, setListModalOpen] = useState(false) 24 24 const [newListName, setNewListName] = useState('') 25 const [liveLikes, setLiveLikes] = useState<number | null>(null) 26 const [liveComments, setLiveComments] = useState<number | null>(null) 25 27 26 28 const story = stories.find(s => s.story_id === Number(id)) … … 153 155 {/* Action bar */} 154 156 <div className="flex items-center gap-3 flex-wrap"> 155 <LikeButton storyId={story.story_id} authorUserId={story.user_id} totalLikes={story.total_likes} />157 <LikeButton storyId={story.story_id} authorUserId={story.user_id} totalLikes={story.total_likes} onCountChange={setLiveLikes} /> 156 158 {currentUser && ( 157 159 <Button variant="secondary" size="sm" onClick={() => setListModalOpen(true)}> … … 183 185 {/* Comments */} 184 186 <div className="border-t border-slate-700 pt-8"> 185 <CommentSection storyId={story.story_id} authorUserId={story.user_id} />187 <CommentSection storyId={story.story_id} authorUserId={story.user_id} onCountChange={setLiveComments} /> 186 188 </div> 187 189 </div> … … 203 205 <div className="flex justify-between"> 204 206 <span className="text-slate-400">Likes</span> 205 <span className="text-white">{ story.total_likes.toLocaleString()}</span>207 <span className="text-white">{(liveLikes ?? story.total_likes).toLocaleString()}</span> 206 208 </div> 207 209 <div className="flex justify-between"> … … 211 213 <div className="flex justify-between"> 212 214 <span className="text-slate-400">Comments</span> 213 <span className="text-white">{ story.total_comments}</span>215 <span className="text-white">{liveComments ?? story.total_comments}</span> 214 216 </div> 215 217 <div className="flex justify-between">
Note:
See TracChangeset
for help on using the changeset viewer.
