Skip to content

rewrote TierSelectionStep#1481

Open
matthias-luger wants to merge 10 commits intodevelopfrom
rewrite-tier-selection-step
Open

rewrote TierSelectionStep#1481
matthias-luger wants to merge 10 commits intodevelopfrom
rewrite-tier-selection-step

Conversation

@matthias-luger
Copy link
Collaborator

extracted country logic

extracted country logic
@matthias-luger matthias-luger requested a review from Copilot March 18, 2026 19:32

This comment was marked as outdated.

matthias-luger and others added 3 commits March 18, 2026 21:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@matthias-luger matthias-luger requested a review from Copilot March 18, 2026 20:54

This comment was marked as outdated.

@matthias-luger matthias-luger requested a review from Copilot March 18, 2026 21:14

This comment was marked as outdated.

matthias-luger and others added 5 commits March 18, 2026 22:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@matthias-luger matthias-luger requested a review from Copilot March 18, 2026 22:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors Premium purchase flows by extracting country detection/persistence into a shared hook and rewriting the tier selection UI into a config-driven implementation, reducing duplicated country logic across components.

Changes:

  • Added useCountryDetection hook to centralize country detection (localStorage + api.country.is + language fallback) and persistence.
  • Rewrote TierSelectionStep to use a TierCard component and tier config maps, simplifying tier rendering logic.
  • Updated Premium wizard, subscription purchase, CoflCoins purchase, and CountrySelect to use the new country detection approach.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
hooks/useCountryDetection.ts New hook encapsulating country detection + persistence.
components/Premium/PremiumPurchaseWizard/Steps/TierSelectionStep.tsx Refactored tier selection step; uses configs + TierCard; delegates country selection to CountrySelect.
components/Premium/PremiumPurchaseWizard/Steps/TierCard.tsx New reusable tier card component for the tier grid.
components/Premium/PremiumPurchaseWizard/Steps/PurchaseCompletionStep.tsx Removed obsolete commented countryCode prop notes.
components/Premium/PremiumPurchaseWizard/PremiumPurchaseWizard.tsx Uses useCountryDetection and threads detected country into later steps.
components/Premium/BuySubscription/BuySubscription.tsx Uses detected country for pricing/VAT and API calls.
components/Premium/BuyPremium/BuyPremium.tsx Removes unused duration display helper.
components/CountrySelect/CountrySelect.tsx Now uses useCountryDetection internally and shows loading state until detected.
components/CoflCoins/CoflCoinsPurchase.tsx Replaced inline country detection with useCountryDetection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants