You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
847 B

/* eslint react/prop-types: 0 */
import React, { createContext, Suspense } from "react";
import { BrowserRouter as Router } from "react-router-dom";
import Loader from "./components/loader";
export const AppContext = createContext();
const AppContextProvider = ({ children }) => {
const defaultState = {
urlServer: process.env.REACT_APP_SERVER_URL,
feedbackForm: process.env.REACT_APP_FEEDBACK_FORM,
routesServer: {
setElection: "election/",
getElection: "election/get/:slug/",
getResultsElection: "election/results/:slug",
voteElection: "election/vote/"
}
};
return (
<Suspense fallback={<Loader />}>
<Router>
<AppContext.Provider value={defaultState}>
{children}
</AppContext.Provider>
</Router>
</Suspense>
);
};
export default AppContextProvider;