add js and ts lints
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import React, { createContext, Dispatch, FC, SetStateAction, useContext, useState } from 'react'
|
||||
import type { Dispatch, FC, SetStateAction } from "react";
|
||||
import React, { createContext, useContext, useState } from "react";
|
||||
|
||||
export type AppContext = {
|
||||
setSideNavExpanded: Dispatch<SetStateAction<boolean>>
|
||||
sideNavExpanded: boolean
|
||||
}
|
||||
setSideNavExpanded: Dispatch<SetStateAction<boolean>>;
|
||||
sideNavExpanded: boolean;
|
||||
};
|
||||
|
||||
const Context = createContext<AppContext | null>(null)
|
||||
const Context = createContext<AppContext | null>(null);
|
||||
|
||||
export const useAppContext = (): AppContext => {
|
||||
const context = useContext(Context);
|
||||
@@ -18,11 +19,11 @@ export const useAppContext = (): AppContext => {
|
||||
};
|
||||
|
||||
export const AppContext: FC = ({ children }) => {
|
||||
const [sideNavExpanded, setSideNavExpanded] = useState(false)
|
||||
const [sideNavExpanded, setSideNavExpanded] = useState(false);
|
||||
|
||||
return (
|
||||
return (
|
||||
<Context.Provider value={{ sideNavExpanded, setSideNavExpanded }}>
|
||||
{children}
|
||||
</Context.Provider>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import { Auth0Provider } from '@auth0/auth0-react'
|
||||
import React, { FC } from 'react'
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { Auth0Provider } from "@auth0/auth0-react";
|
||||
import type { FC } from "react";
|
||||
import React from "react";
|
||||
|
||||
export const AuthProvider: FC = ({children}) => {
|
||||
export const AuthProvider: FC = ({ children }) => {
|
||||
// @ts-ignore
|
||||
const domain = window.AUTH_DOMAIN
|
||||
const domain = window.AUTH_DOMAIN;
|
||||
// @ts-ignore
|
||||
const clientId = window.AUTH_CLIENT_ID
|
||||
const clientId = window.AUTH_CLIENT_ID;
|
||||
// @ts-ignore
|
||||
const audience = window.AUTH_AUDIENCE
|
||||
const audience = window.AUTH_AUDIENCE;
|
||||
|
||||
return (
|
||||
<Auth0Provider
|
||||
@@ -18,5 +20,5 @@ export const AuthProvider: FC = ({children}) => {
|
||||
>
|
||||
{children}
|
||||
</Auth0Provider>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user