diff --git a/CHANGELOG.md b/CHANGELOG.md index 74e9b81f2..cadd77304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Improved the styling in the admin control panel + ## 1.232.0 - 2023-02-05 ### Changed diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html index 18f6dffa3..5ca7a5c2f 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -151,16 +151,23 @@ >
Coupons
-
- {{ coupon.code }} ({{ coupon.duration }}) - -
+ + + + + + +
{{ coupon.code }} + {{ coupon.duration }} + + +
User Country @@ -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]