This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feat: Use country-state-city to populate state dropdown in St…
- Loading branch information
1 parent
58cde5d
commit 9dc662f
Showing
6 changed files
with
122 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
src/payment/checkout/payment-form/utils/countryStatesMap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
const COUNTRY_STATES_MAP = { | ||
CA: { | ||
AB: 'Alberta', | ||
BC: 'British Columbia', | ||
MB: 'Manitoba', | ||
NB: 'New Brunswick', | ||
NL: 'Newfoundland and Labrador', | ||
NS: 'Nova Scotia', | ||
NT: 'Northwest Territories', | ||
NU: 'Nunavut', | ||
ON: 'Ontario', | ||
PE: 'Prince Edward Island', | ||
QC: 'Québec', | ||
SK: 'Saskatchewan', | ||
YT: 'Yukon', | ||
}, | ||
IN: { | ||
AN: 'Andaman and Nicobar Islands', | ||
AP: 'Andhra Pradesh', | ||
AR: 'Arunachal Pradesh', | ||
AS: 'Assam', | ||
BR: 'Bihar', | ||
CH: 'Chandigarh', | ||
CT: 'Chhattisgarh', | ||
DN: 'Dadra and Nagar Haveli', | ||
DD: 'Daman and Diu', | ||
DL: 'Delhi', | ||
GA: 'Goa', | ||
GJ: 'Gujarat', | ||
HR: 'Haryana', | ||
HP: 'Himachal Pradesh', | ||
JK: 'Jammu and Kashmir', | ||
JH: 'Jharkhand', | ||
KA: 'Karnataka', | ||
KL: 'Kerala', | ||
LD: 'Lakshadweep', | ||
MP: 'Madhya Pradesh', | ||
MH: 'Maharashtra', | ||
MN: 'Manipur', | ||
ML: 'Meghalaya', | ||
MZ: 'Mizoram', | ||
NL: 'Nagaland', | ||
OR: 'Odisha', | ||
PY: 'Puducherry', | ||
PB: 'Punjab', | ||
RJ: 'Rajasthan', | ||
SK: 'Sikkim', | ||
TN: 'Tamil Nadu', | ||
TG: 'Telangana', | ||
TR: 'Tripura', | ||
UP: 'Uttar Pradesh', | ||
UT: 'Uttarakhand', | ||
WB: 'West Bengal', | ||
}, | ||
US: { | ||
AL: 'Alabama', | ||
AK: 'Alaska', | ||
AZ: 'Arizona', | ||
AR: 'Arkansas', | ||
AA: 'Armed Forces Americas', | ||
AE: 'Armed Forces Europe', | ||
AP: 'Armed Forces Pacific', | ||
CA: 'California', | ||
CO: 'Colorado', | ||
CT: 'Connecticut', | ||
DE: 'Delaware', | ||
DC: 'District Of Columbia', | ||
FL: 'Florida', | ||
GA: 'Georgia', | ||
HI: 'Hawaii', | ||
ID: 'Idaho', | ||
IL: 'Illinois', | ||
IN: 'Indiana', | ||
IA: 'Iowa', | ||
KS: 'Kansas', | ||
KY: 'Kentucky', | ||
LA: 'Louisiana', | ||
ME: 'Maine', | ||
MD: 'Maryland', | ||
MA: 'Massachusetts', | ||
MI: 'Michigan', | ||
MN: 'Minnesota', | ||
MS: 'Mississippi', | ||
MO: 'Missouri', | ||
MT: 'Montana', | ||
NE: 'Nebraska', | ||
NV: 'Nevada', | ||
NH: 'New Hampshire', | ||
NJ: 'New Jersey', | ||
NM: 'New Mexico', | ||
NY: 'New York', | ||
NC: 'North Carolina', | ||
ND: 'North Dakota', | ||
OH: 'Ohio', | ||
OK: 'Oklahoma', | ||
OR: 'Oregon', | ||
PA: 'Pennsylvania', | ||
RI: 'Rhode Island', | ||
SC: 'South Carolina', | ||
SD: 'South Dakota', | ||
TN: 'Tennessee', | ||
TX: 'Texas', | ||
UT: 'Utah', | ||
VT: 'Vermont', | ||
VA: 'Virginia', | ||
WA: 'Washington', | ||
WV: 'West Virginia', | ||
WI: 'Wisconsin', | ||
WY: 'Wyoming', | ||
}, | ||
}; | ||
|
||
export default function getStates(country) { | ||
return country && COUNTRY_STATES_MAP[country.toUpperCase()]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters