2021-11-25 09:28:45 +00:00
|
|
|
import React, { useMemo, useState } from "react";
|
|
|
|
import { Outlet } from "react-router-dom";
|
2021-11-25 09:44:25 +00:00
|
|
|
import Header from "./Header";
|
2021-11-25 09:28:45 +00:00
|
|
|
import { AppConfig, AppConfigContext } from "./useAppConfig";
|
|
|
|
import { SourcifySource } from "./url";
|
|
|
|
|
|
|
|
const Main: React.FC = () => {
|
|
|
|
const [sourcifySource, setSourcifySource] = useState<SourcifySource>(
|
|
|
|
SourcifySource.IPFS_IPNS
|
|
|
|
);
|
|
|
|
const appConfig = useMemo((): AppConfig => {
|
|
|
|
return {
|
|
|
|
sourcifySource,
|
|
|
|
setSourcifySource,
|
|
|
|
};
|
|
|
|
}, [sourcifySource, setSourcifySource]);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<AppConfigContext.Provider value={appConfig}>
|
2021-11-25 09:44:25 +00:00
|
|
|
<Header />
|
2021-11-25 09:28:45 +00:00
|
|
|
<Outlet />
|
|
|
|
</AppConfigContext.Provider>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Main;
|