finished reset password & other changes

This commit is contained in:
2024-04-24 22:37:55 +03:00
parent b1ad7b5c3e
commit 53cadc289a
58 changed files with 1520 additions and 349 deletions

View File

@@ -1,6 +1,6 @@
import { type ClassValue, clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
import { LC } from '@/config/locales'
import { LC, locales } from '@/config/locales'
import { env as dotEnv } from 'process'
@@ -16,6 +16,14 @@ export function env (variable: string, defaultValue?: string | ''): string {
return (dotEnv[variable] ?? defaultValue ?? '')
}
export function tr (el: React.ReactNode, params: object) {
export const testPathnameRegex = (
pages: string[], pathName: string): boolean => {
const pattern: string = `^(/(${locales.join('|')}))?(${pages.flatMap(
(p) => (p === '/' ? ['', '/'] : p)).join('|')})/?$`
//console.log(pattern)
return RegExp(pattern, 'is').test(pathName)
}
}