NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import React, { useEffect } from "react";

import { Container } from "react-bootstrap";
import { useSelector, useDispatch } from "react-redux";
import { Router, Redirect, Route, Switch } from "react-router";

import "typeface-arimo";

import { URL } from "./constants";
import { history } from "./helpers";

import { Footer } from "./components/Footer";
import { Header } from "./components/Header";
import { PageRoute, AuthenticatedRoute } from "./components/PageRoute";

// import { Language } from "./modules/Language";
import { PageUnavailable } from "./modules/ErrorFallback";
import { PrivacyPolicy } from "./modules/PrivacyPolicy";
// import { Contact } from "./modules/Contact";
// import { Appointment } from "./modules/Appointment";
import Circumstances from "./modules/Screener/Circumstances";
import Deny from "./modules/Screener/Deny";
import Symptoms from "./modules/Screener/Symptoms";
import { Impairment } from "./modules/Impairment";
// import { Locator } from "./modules/Locator";
// import { PageBuilder } from "./modules/PageBuilder";
import { Ticket } from "./modules/Ticket";
import TicketExpired from "./modules/Ticket/TicketExpired";
import { ErrorFallback } from "./modules/ErrorFallback";
import Ciu_Error from "./modules/ErrorFallback/Ciu_Error";
import OfficeClosed from "./modules/ErrorFallback/OfficeClosed";
import ApptDetails from "./modules/Appointment/ApptDetails";
import appVersion from './app-version.json';

import {
isChrome,
isFirefox,
isEdgeChromium,
isSafari,
isMobileSafari,
} from "react-device-detect";

import "./App.scss";

const { PRIVACY_POLICY, SYMPTOMS, CIRCUMSTANCES, IMPAIRMENT } = URL;
const locationVisibilityPaths = [PRIVACY_POLICY, SYMPTOMS, CIRCUMSTANCES, IMPAIRMENT];

function App() {
// const dispatch = useDispatch();
const hideBackButton = useSelector((state) => state.config.hideBackButton);
const hideRestartButton = useSelector(
(state) => state.config.hideRestartButton
);

const showFooter = () => {
return !hideRestartButton || !hideBackButton;
};

// const buildInfo = window.location.pathname.includes('/language') ?
// (<div class="myAppVersion">Build Version: {appVersion.fullVersion}</div>) : <></>;

// NOTE: This functionality is not included in react-device-detect as of 1/27/2021
// the following snippet should acomplish the intended goal
// https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator
// const isSamsungBrowser = navigator.userAgent.indexOf("SamsungBrowser") > -1;

const isValidBrowser = () => {
return (
isChrome ||
isFirefox ||
isSafari ||
isEdgeChromium ||
isMobileSafari
);
};

const isApptUrl = window.location.pathname.includes(URL.APPT);

// Short circuit app for unsupported browsers
if (!isValidBrowser()) {
return (
<>
<Header />
<div className="App text-center">
<ErrorFallback
error={{
message: (
<>
<p>
The Approved Browser Compatability list is:
</p>
<ul className="d-inline-block">
<li>Edge: 81+</li>
<li>Chrome: 81+</li>
<li>Firefox: 77+</li>
<li>Safari: 13.7+</li>
</ul>
</>
),
}}
header="Browser Not Supported"
/>
</div>
</>
);
}

return (
<>
<Header locationVisibilityPaths={locationVisibilityPaths} />
<main className={`App text-center`}>
<Container fluid>
<Router history={history}>
{ isApptUrl ?
(
<Switch>
<Route
exact
path={URL.LANGUAGE}
component={PageUnavailable}
/>
<Route
exact
path={URL.UNAVAILABLE}
component={PageUnavailable}
/>
<Route
exact
path={URL.APPT}
component={ApptDetails}
/>
<AuthenticatedRoute
exact
path={URL.PRIVACY_POLICY}
component={PrivacyPolicy}
/>
<AuthenticatedRoute
exact
path={URL.CIRCUMSTANCES}
component={Circumstances}
/>
<AuthenticatedRoute
exact
path={URL.DENY}
component={Deny}
/>
<AuthenticatedRoute
exact
path={URL.SYMPTOMS}
component={Symptoms}
/>
<AuthenticatedRoute
exact
path={URL.IMPAIRMENT}
component={Impairment}
/>
<AuthenticatedRoute
exact
path={URL.ERROR}
component={ErrorFallback}
/>
<AuthenticatedRoute
exact
path={URL.CIU_ERROR}
component={Ciu_Error}
/>
<AuthenticatedRoute
exact
path={URL.OFFICECLOSED}
component={OfficeClosed}
/>
<Redirect from="*" to={URL.APPT} />
</Switch>
) : (
<Switch>
<Route
exact
path={URL.LANGUAGE}
component={PageUnavailable}
/>
<Route
exact
path={URL.UNAVAILABLE}
component={PageUnavailable}
/>
{/* <PageRoute
exact
path={URL.CONTACT}
component={Contact}
/> */}
<Route
exact
path={URL.APPT}
component={ApptDetails}
/>
<AuthenticatedRoute
exact
path={URL.PRIVACY_POLICY}
component={PrivacyPolicy}
/>
<AuthenticatedRoute
exact
path={URL.CIRCUMSTANCES}
component={Circumstances}
/>
<AuthenticatedRoute
exact
path={URL.DENY}
component={Deny}
/>
<AuthenticatedRoute
exact
path={URL.IMPAIRMENT}
component={Impairment}
/>
<AuthenticatedRoute
exact
path={URL.SYMPTOMS}
component={Symptoms}
/>
{/* <AuthenticatedRoute
exact
path={URL.LOCATE}
component={Locator}
/> */}
<AuthenticatedRoute
exact
path={URL.TICKET}
component={Ticket}
/>
{/* <AuthenticatedRoute
exact
path={URL.VISIT}
component={PageBuilder}
/> */}
{/* <AuthenticatedRoute
exact
path={URL.VISIT + '/:pageId'}
component={PageBuilder}
/> */}
<AuthenticatedRoute
exact
path={URL.TICKETEXPIRED}
component={TicketExpired}
/>
<AuthenticatedRoute
exact
path={URL.ERROR}
component={ErrorFallback}
/>
<AuthenticatedRoute
exact
path={URL.CIU_ERROR}
component={Ciu_Error}
/>
<AuthenticatedRoute
exact
path={URL.OFFICECLOSED}
component={OfficeClosed}
/>
<Redirect from="*" to={URL.APPT} />
</Switch>
)
}
</Router>
</Container>
</main>
{showFooter()
? <Footer />
: <></>
}
</>
);

}

export default App;
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.