mirror of
https://github.com/FranP-code/spend-ia.git
synced 2025-10-13 00:14:09 +00:00
integration of next.js
This commit is contained in:
7
pages/_app.js
Normal file
7
pages/_app.js
Normal 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
28
pages/index.css
Normal 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
40
pages/index.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user