Skip to content

Rebuild components/rating/rating-modal.tsx with shadcn Dialog primitives #279

Description

@Benjtalkshow

components/rating/rating-modal.tsx uses raw HTML and inline styles instead of the project's design system:

<div className="modal"> ... </div>
<button onClick={onClose}>Close</button>
<button onClick={handleSubmit} disabled={loading}>Submit</button>
<textarea style={{ width: '100%', marginBottom: 8 }} />
{error && <div style={{ color: 'red', marginBottom: 8 }}>{error}</div>}

This is the only component in the repo that does this. Every other dialog uses shadcn Dialog or AlertDialog primitives with semantic tokens.

What to do

Rebuild the component using:

  • Dialog + DialogContent + DialogHeader + DialogTitle + DialogDescription + DialogFooter from components/ui/dialog
  • Button from components/ui/button (use variant="ghost" for Cancel, default for Submit)
  • Textarea from components/ui/textarea
  • Replace inline style={{...}} with Tailwind classes
  • Replace color: 'red' with the text-destructive token
  • Keep the props (contributor, bounty, onSubmit, onClose) unchanged so the existing caller in components/bounty/bounty-sidebar.tsx keeps working

Acceptance criteria

  • No <div className="modal">, raw <button>, raw <textarea>, or style={{...}} in the file
  • Modal matches the visual treatment of other AlertDialogs in the bounty surface
  • Submit and Cancel buttons behave identically to before
  • Success state and error state render correctly
  • pnpm tsc --noEmit and pnpm lint pass

Files

  • components/rating/rating-modal.tsx

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfrontendFrontend developmentgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions