From d40a86bb6bd49796ff1da0452bf70110229c6598 Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Fri, 17 Oct 2025 09:07:32 +0100 Subject: [PATCH] - finland version release --- src/components/PlateStack/NumberPlate.tsx | 21 +++++++++------------ src/utils/utils.ts | 12 ++++++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/components/PlateStack/NumberPlate.tsx b/src/components/PlateStack/NumberPlate.tsx index 3e359fd..bc1bc3d 100644 --- a/src/components/PlateStack/NumberPlate.tsx +++ b/src/components/PlateStack/NumberPlate.tsx @@ -1,5 +1,5 @@ -import { GB } from "country-flag-icons/react/3x2"; -import { formatNumberPlate } from "../../utils/utils"; +// import { EU } from "country-flag-icons/react/3x2"; +import { formatNumberPlateEU } from "../../utils/utils"; type NumberPlateProps = { vrm?: string | undefined; @@ -40,19 +40,16 @@ const NumberPlate = ({ motion, vrm, size }: NumberPlateProps) => { return (
-
- -
-

- {vrm && formatNumberPlate(vrm)} -

+ {/*
+ + FIN +
*/} +

{vrm && formatNumberPlateEU(vrm)}

); diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 65a4fc8..b9a2206 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -2,6 +2,7 @@ import switchSound from "../assets/sounds/ui/switch.mp3"; import popup from "../assets/sounds/ui/popup_open.mp3"; import notification from "../assets/sounds/ui/notification.mp3"; import type { HotlistMatches, SightingType } from "../types/types"; +import { hasFlag } from "country-flag-icons"; export function getSoundFileURL(name: string) { const sounds: Record = { @@ -78,6 +79,12 @@ export const formatNumberPlate = (plate: string) => { const formattedPlate = splittedPlate?.join(""); return formattedPlate; }; +export const formatNumberPlateEU = (plate: string) => { + const splittedPlate = plate?.split(""); + splittedPlate?.splice(3, 0, " "); + const formattedPlate = splittedPlate?.join(""); + return formattedPlate; +}; export const BLANK_IMG = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; @@ -142,3 +149,8 @@ export function getHotlistName(obj: HotlistMatches | undefined) { export const getNPEDCategory = (r?: SightingType | null) => r?.metadata?.npedJSON?.["NPED CATEGORY"] as "A" | "B" | "C" | undefined; + +export const numberPlateFlag = (countryCode: string) => { + const result = hasFlag(countryCode) === true; + console.log(result); +};