Fix compilation

This commit is contained in:
Manav Rathi 2024-04-04 13:00:02 +05:30
parent 87dc7d76ca
commit 756050ae8c
No known key found for this signature in database
4 changed files with 17 additions and 42 deletions

View file

@ -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>;

View file

@ -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>

View file

@ -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;

View file

@ -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>;