From b51768973f80549172f53139edfe831893614fa2 Mon Sep 17 00:00:00 2001
From: keshav-005
Date: Wed, 22 Apr 2026 20:32:45 +0530
Subject: [PATCH 1/2] Override Taiwan country label
---
components/forms/CountrySelectField.tsx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/components/forms/CountrySelectField.tsx b/components/forms/CountrySelectField.tsx
index f5d1c927..2c17bedc 100644
--- a/components/forms/CountrySelectField.tsx
+++ b/components/forms/CountrySelectField.tsx
@@ -22,6 +22,10 @@ import { Check, ChevronsUpDown } from 'lucide-react';
import { cn } from '@/lib/utils';
import countryList from 'react-select-country-list';
+const COUNTRY_LABEL_OVERRIDES: Record = {
+ TW: 'Taiwan',
+};
+
type CountrySelectProps = {
name: string;
label: string;
@@ -40,7 +44,10 @@ const CountrySelect = ({
const [open, setOpen] = useState(false);
// Get country options with flags
- const countries = countryList().getData();
+ const countries = countryList().getData().map((country) => ({
+ ...country,
+ label: COUNTRY_LABEL_OVERRIDES[country.value] ?? country.label,
+ }));
// Helper function to get flag emoji
const getFlagEmoji = (countryCode: string) => {
@@ -143,4 +150,4 @@ export const CountrySelectField = ({
);
-};
\ No newline at end of file
+};
From 2a339c6d711dbddd78dd5c192d125d3e4b221cba Mon Sep 17 00:00:00 2001
From: keshav-005
Date: Wed, 22 Apr 2026 20:49:45 +0530
Subject: [PATCH 2/2] Hoist static country label options
---
components/forms/CountrySelectField.tsx | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/components/forms/CountrySelectField.tsx b/components/forms/CountrySelectField.tsx
index 2c17bedc..23cbaeee 100644
--- a/components/forms/CountrySelectField.tsx
+++ b/components/forms/CountrySelectField.tsx
@@ -26,6 +26,11 @@ const COUNTRY_LABEL_OVERRIDES: Record = {
TW: 'Taiwan',
};
+const COUNTRY_OPTIONS = countryList().getData().map((country) => ({
+ ...country,
+ label: COUNTRY_LABEL_OVERRIDES[country.value] ?? country.label,
+}));
+
type CountrySelectProps = {
name: string;
label: string;
@@ -43,12 +48,6 @@ const CountrySelect = ({
}) => {
const [open, setOpen] = useState(false);
- // Get country options with flags
- const countries = countryList().getData().map((country) => ({
- ...country,
- label: COUNTRY_LABEL_OVERRIDES[country.value] ?? country.label,
- }));
-
// Helper function to get flag emoji
const getFlagEmoji = (countryCode: string) => {
const codePoints = countryCode
@@ -70,7 +69,7 @@ const CountrySelect = ({
{value ? (
{getFlagEmoji(value)}
- {countries.find((c) => c.value === value)?.label}
+ {COUNTRY_OPTIONS.find((c) => c.value === value)?.label}
) : (
'Select your country...'
@@ -92,7 +91,7 @@ const CountrySelect = ({
- {countries.map((country) => (
+ {COUNTRY_OPTIONS.map((country) => (