Fix compilation
This commit is contained in:
parent
87dc7d76ca
commit
756050ae8c
4 changed files with 17 additions and 42 deletions
|
@ -1,7 +1,20 @@
|
|||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { Container } from "./components/Container";
|
||||
import { parseAndHandleRequest } from "./services/billing-service";
|
||||
import S from "./utils/strings";
|
||||
|
||||
const App: React.FC = () => {
|
||||
return <h1>Hello</h1>;
|
||||
const [failed, setFailed] = React.useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
parseAndHandleRequest().catch(() => {
|
||||
setFailed(true);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return <Container>{failed ? S.error_generic : <Spinner />}</Container>;
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
const Spinner: React.FC = () => <div className="loading-spinner"></div>;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App.js";
|
||||
import "./index.css";
|
||||
import App from "./App";
|
||||
import "./styles/globals.css";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||
<React.StrictMode>
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
import type { AppProps } from "next/app";
|
||||
import Head from "next/head";
|
||||
import React from "react";
|
||||
import S from "utils/strings";
|
||||
import "../styles/globals.css";
|
||||
|
||||
const MyApp = ({ Component, pageProps }: AppProps): React.JSX.Element => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{S.title}</title>
|
||||
</Head>
|
||||
<Component {...pageProps} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default MyApp;
|
|
@ -1,20 +0,0 @@
|
|||
import { Container } from "components/Container";
|
||||
import React, { useEffect } from "react";
|
||||
import { parseAndHandleRequest } from "services/billing-service";
|
||||
import S from "utils/strings";
|
||||
|
||||
const Page: React.FC = () => {
|
||||
const [failed, setFailed] = React.useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
parseAndHandleRequest().catch(() => {
|
||||
setFailed(true);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return <Container>{failed ? S.error_generic : <Spinner />}</Container>;
|
||||
};
|
||||
|
||||
export default Page;
|
||||
|
||||
const Spinner: React.FC = () => <div className="loading-spinner"></div>;
|
Loading…
Reference in a new issue