feat: redesign landing page with brand system and section blocks
Build & Push Docker Image / build (push) Has been cancelled
Build & Push Docker Image / build (push) Has been cancelled
Refresh the homepage around new hero/services/roadmap sections, shared design tokens, and updated brand assets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
const LATIN_TO_PERSIAN: Record<string, string> = {
|
||||
"0": "۰",
|
||||
"1": "۱",
|
||||
"2": "۲",
|
||||
"3": "۳",
|
||||
"4": "۴",
|
||||
"5": "۵",
|
||||
"6": "۶",
|
||||
"7": "۷",
|
||||
"8": "۸",
|
||||
"9": "۹",
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert Latin digits in a string to Persian digits.
|
||||
* Leaves non-digit characters unchanged. Use for UI labels, stats,
|
||||
* dates, and counters — not for technical IDs or code.
|
||||
*/
|
||||
export function toPersianDigits(value: string | number): string {
|
||||
return String(value).replace(/[0-9]/g, (digit) => LATIN_TO_PERSIAN[digit] ?? digit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a number for Persian UI (locale grouping + Persian digits).
|
||||
*/
|
||||
export function formatPersianNumber(
|
||||
value: number,
|
||||
options?: Intl.NumberFormatOptions
|
||||
): string {
|
||||
return toPersianDigits(
|
||||
new Intl.NumberFormat("fa-IR", options).format(value)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user