This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/src/pages/index.js

27 lines
585 B
JavaScript
Raw Normal View History

2020-02-28 12:52:32 +00:00
import React, { useMemo } from "react";
2020-02-28 11:30:27 +00:00
import PropTypes from "prop-types";
import SEO from "../components/seo";
import { App } from "../components";
import "../global.scss";
2020-02-28 12:52:32 +00:00
import AppContext from "../AppContext";
2020-02-28 11:30:27 +00:00
export default function IndexPage({ location }) {
2020-02-28 12:52:32 +00:00
const context = useMemo(
() => ({
apiUrl: process.env.GATSBY_API_URL ?? location.origin
}),
[location.origin]
);
2020-02-28 11:30:27 +00:00
return (
2020-02-28 12:52:32 +00:00
<AppContext.Provider value={context}>
2020-02-28 11:30:27 +00:00
<SEO />
<App />
2020-02-28 12:52:32 +00:00
</AppContext.Provider>
2020-02-28 11:30:27 +00:00
);
}
2020-02-28 11:30:27 +00:00
IndexPage.propTypes = {
location: PropTypes.object.isRequired
};