18 |
{componentName} is under construction
19 |
20 | This view is not implemented yet. Go to home page
21 |
22 |
23 | You've called the {location?.pathname} url
24 | {paramId && (
25 |
26 | {' '}
27 | where {paramId} is a parameter
28 |
29 | )}
30 |
31 |
32 | );
33 | };
34 |
35 | export default NotImplementedView;
36 |
--------------------------------------------------------------------------------
/src/utils/date.ts:
--------------------------------------------------------------------------------
1 | import { format } from 'date-fns';
2 |
3 | export const FORMAT_DATE_TIME = 'yyyy-MM-dd HH:mm:ss';
4 | export const FORMAT_DATE_ONLY = 'yyyy-MM-dd';
5 | export const FORMAT_TIME_ONLY = 'HH:mm:ss';
6 |
7 | /**
8 | * Main Data and Time conversion utility to keep formats the same across entire Application
9 | * @param {string|object} dateOrString - date to show as UTC string or Date object instance
10 | * @param {string} [dateFormat] - time conversion template in 'date-fns' format, `FORMAT_DATE_TIME` by default
11 | * @param {string} [fallbackValue] - optional fallback value if data conversion is not possible
12 | */
13 | export function dateToString(dateOrString: string | Date, dateFormat = FORMAT_DATE_TIME, fallbackValue = ''): string {
14 | const date = typeof dateOrString === 'object' ? dateOrString : new Date(dateOrString);
15 | let result;
16 | try {
17 | result = format(date, dateFormat);
18 | } catch (error) {
19 | result = fallbackValue;
20 | }
21 | return result;
22 | }
23 |
--------------------------------------------------------------------------------
/src/routes/PublicRoutes.tsx:
--------------------------------------------------------------------------------
1 | import { Route, Routes } from 'react-router-dom';
2 | import { PublicLayout } from '../layout';
3 | import { NotFoundView } from '../views';
4 | import AboutView from '../views/About';
5 | import DevView from '../views/Dev';
6 | import LoginEmailView from '../views/Auth/Login/LoginEmailView';
7 | import AuthRoutes from '../views/Auth';
8 |
9 | /**
10 | * List of routes available for anonymous users
11 | * Also renders the "Public Layout" composition
12 | * @routes PublicRoutes
13 | */
14 | const PublicRoutes = () => {
15 | return (
16 |