Skip to content

refactor(dashboard): extract PROFILE_URL helper from ShareSheet into utils/urls.ts #356

@JhaSourav07

Description

@JhaSourav07

🧩 Background

PROFILE_URL in components/dashboard/ShareSheet.tsx is a function that builds the dashboard URL. This URL format is likely needed in other places (og route, landing page, etc.) and should be centralized.

🎯 Objective

Move PROFILE_URL to utils/urls.ts and import from there.

📁 Files to touch

  • utils/urls.ts (new)
  • components/dashboard/ShareSheet.tsx

🛠️ Implementation steps

  • Create getDashboardUrl(username: string): string using window.location.origin with an SSR fallback.
  • Import and use in ShareSheet.
  • Add a unit test.

✅ Definition of done

  • URL helper is in one place.
  • All ShareSheet tests pass.

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions