Skip to content

Implement watch page #171

@davedumto

Description

@davedumto

🐛 Bug: "Watch" Page Route (/:username/watch) Returns 404 Instead of Rendering Placeholder View

Summary
Currently, navigating to the Watch page (e.g., http://localhost:3000/chidinma/watch) results in a 404 error. This is because the route app/[username]/watch/page.tsx does not exist. We need to implement this dynamic route similar to how ClipsPage works, with placeholder logic and empty state rendering.


Expected Behavior

  • The route /username/watch should:

    • Load a page with the message {username} does not have any watched videos if the list is empty.
    • Show a loading message while data is being fetched.
    • Fallback to notFound() if the user does not exist.

Actual Behavior

  • Navigating to http://localhost:3000/username/watch leads to a 404 page.

Suggested Implementation

Create a new file:

pages/[username]/watch.tsx

Use a structure similar to ClipsPage, with:

  • A mock function like fetchWatchedVideos(username)
  • useEffect to simulate fetching
  • useState for loading and storing videos
  • Use <EmptyState type="watch" isOwner={isOwner} username={username} /> to render empty states

Example placeholder condition:

<p className={textClasses.tertiary}>{username} does not have any watched videos</p>

Acceptance Criteria

  • Page at /:username/watch renders correctly.
  • Uses dynamic route param username.
  • Shows loading state while fetching.
  • Shows empty state message if no watched videos.
  • Returns 404 via notFound() if user doesn’t exist.
  • Fully integrated with EmptyState component (type = "watch").

Labels: bug, frontend, routing, good first issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdifficulty: easyonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions