User
@@ -37,10 +37,10 @@
{{ i + 1 }} |
- {{ userItem.id }}
- {{ (userItem.id | slice:0:5) + '...' }}
- {{ userItem.country }}
+ {{ getEmojiFlag(userItem.country) }}
|
{{ formatDistanceToNow(userItem.createdAt) }}
diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts
index 575d433a0..0bfefb729 100644
--- a/libs/common/src/lib/helper.ts
+++ b/libs/common/src/lib/helper.ts
@@ -118,6 +118,18 @@ export function getDateWithTimeFormatString(aLocale?: string) {
return `${getDateFormatString(aLocale)}, HH:mm:ss`;
}
+export function getEmojiFlag(aCountryCode: string) {
+ if (!aCountryCode) {
+ return aCountryCode;
+ }
+
+ return aCountryCode
+ .toUpperCase()
+ .replace(/./g, (character) =>
+ String.fromCodePoint(127397 + character.charCodeAt(0))
+ );
+}
+
export function getLocale() {
return navigator.languages?.length
? navigator.languages[0]
| |