feat: login form as a client component, theme toggle
This commit is contained in:
8
components/PhoneInput/utils/getFlagEmoji.ts
Normal file
8
components/PhoneInput/utils/getFlagEmoji.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export default function getFlagEmoji(countryCode: string) {
|
||||
const FLAG_CODE_OFFSET = 127397;
|
||||
const codePoints = countryCode
|
||||
.toUpperCase()
|
||||
.split("")
|
||||
.map(char => FLAG_CODE_OFFSET + char.charCodeAt(0));
|
||||
return String.fromCodePoint(...codePoints);
|
||||
}
|
||||
Reference in New Issue
Block a user