Skip to content

Build aPoll View Page for Non-Host Users (pages/view-poll) #38

Description

@tran2106

Create a page that renders a public-facing view of a poll when accessed via a shared link (/poll/:slug). This is the view shown to non-host users (participants) after clicking on a poll link they received.This page should be accessible without authentication and should render based on the poll slug.

This page should render essential poll details and integrate with a separate voting component (being built by Olivia)

  • Add new component: pages/view-poll/ViewPoll.jsx

  • On component mount, fetch poll data using slug from the backend

Display the following poll info:

  • Poll title

  • Poll description

  • Poll deadline / end time

  • Include placeholder for vote form ( will be integrated by another teammate)

  • If the poll is expired, display a message like “This poll has ended.”

  • If poll doesn’t exist or slug is invalid, show a fallback message (404 or custom)

  • Add loading and error states for fetch call

  • Add loading and error states while fetching poll

  • Add a “Copy Link” button that copies the current URL (with slug) to clipboard

Image

Notes:

No voting logic included yet, use seed data to tes or slug route if that was completed.

Metadata

Metadata

Assignees

Labels

Projects

Status
Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions