Ignore:
Timestamp:
03/24/26 23:03:39 (3 months ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Children:
a7550ca
Parents:
73b69b2
Message:

Added functional collaboration between users

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapterx-frontend/src/pages/story/StoryDetailPage.tsx

    r73b69b2 r7fbb91c  
    102102
    103103  const isOwner = currentUser?.user_id === story.user_id
     104  const isCollaborator = currentUser ? storyCollabs.some(c => c.user_id === currentUser.user_id) : false
    104105
    105106  return (
     
    162163              </Button>
    163164            )}
    164             {isOwner && (
     165            {(isOwner || isCollaborator) && (
    165166              <Button variant="ghost" size="sm" onClick={() => navigate(`/writer/edit-story/${story.story_id}`)}>
    166167                Edit Story
     
    173174            <div className="flex items-center justify-between mb-4">
    174175              <h2 className="font-serif text-xl font-bold text-white">Chapters</h2>
    175               {isOwner && (
     176              {(isOwner || isCollaborator) && (
    176177                <Button size="sm" onClick={() => navigate(`/writer/create-chapter/${story.story_id}`)}>
    177178                  <Plus size={14} />
Note: See TracChangeset for help on using the changeset viewer.