integration of next.js

This commit is contained in:
2023-04-04 23:06:47 -03:00
parent 4a2364cb7b
commit e5c37b9449
21 changed files with 68 additions and 396 deletions

7
pages/_app.js Normal file
View File

@@ -0,0 +1,7 @@
/* eslint-disable react/prop-types */
import React from 'react';
import './index.css';
export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}

28
pages/index.css Normal file
View File

@@ -0,0 +1,28 @@
/* stylelint-disable property-no-vendor-prefix */
@import 'normalize.css';
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-synthesis: none;
font-weight: 400;
line-height: 1.5;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
a {
color: #646cff;
font-weight: 500;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
* {
/** wtf vite */
margin: 0;
padding: 0;
}

40
pages/index.tsx Normal file
View File

@@ -0,0 +1,40 @@
import React, { useState } from 'react';
import { Header, SpendScreen } from '@/screens';
import { type Tab } from '@/lib/types';
import { APP_NAME, SPEND_SCREEN_ID, SPEND_SCREEN_NAME } from '@/lib/constants';
import Head from 'next/head';
const HeadIndex = (): JSX.Element => {
return (
<>
<Head>
<title>{APP_NAME}</title>
<meta property="og:title" content={APP_NAME} key="title" />
</Head>
</>
);
};
const appRender = ({ tab }: { tab: Tab }): JSX.Element => {
switch (tab.id) {
case SPEND_SCREEN_ID:
return <SpendScreen />;
default:
return <></>;
}
};
function App(): JSX.Element {
const [tab, setTab] = useState({ id: SPEND_SCREEN_ID, title: SPEND_SCREEN_NAME });
return (
<>
<HeadIndex />
<Header tab={tab} setTab={setTab} />
{appRender({ tab })}
</>
);
}
export default App;