diff options
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/layout.tsx | 44 | ||||
| -rw-r--r-- | src/app/page.tsx | 60 |
2 files changed, 58 insertions, 46 deletions
diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 65445e8..ef1eb9d 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,28 +1,30 @@ -import Head from 'next/head' -import type { Metadata } from 'next' -import { Inter } from 'next/font/google' -import Footer from '../components/Footer/Footer' -import { Analytics } from "@vercel/analytics/react" -import './globals.css' +import { Analytics } from "@vercel/analytics/react"; +import type { Metadata } from "next"; +import { Inter } from "next/font/google"; +import Head from "next/head"; +import Footer from "../components/Footer/Footer"; +import "./globals.css"; -const inter = Inter({ subsets: ['latin'] }) +const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: 'PhaseTracker - Phase Connect Subscriber Tracker', - description: 'PhaseTracker, historical subscriber data for members of Phase Connect', -} + title: "PhaseTracker - Phase Connect Subscriber Tracker", + description: + "PhaseTracker, historical subscriber data for members of Phase Connect", +}; export default function RootLayout({ - children, + children, }: { - children: React.ReactNode + children: React.ReactNode; }) { - return ( - <html lang="en"> - <body className={inter.className}>{children} - <Footer /> - <Analytics/> - </body> - </html> - ) -}
\ No newline at end of file + return ( + <html lang="en"> + <body className={inter.className}> + {children} + <Footer /> + <Analytics /> + </body> + </html> + ); +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 4749635..b5db5b6 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,31 +1,41 @@ -import SubscriberTable, { SubscriberDataTableProp } from '../components/SubscriberTable/SubscriberTable'; -import TitleBar from '../components/TitleBar/TitleBar'; +import SubscriberTable, { + type SubscriberDataTableProp, +} from "../components/SubscriberTable/SubscriberTable"; +import TitleBar from "../components/TitleBar/TitleBar"; async function Home() { - const graphURL = process.env.NEXT_PUBLIC_GRAPH_URL - const data: SubscriberDataTableProp = await getData(); - return ( - <> - <TitleBar title="PhaseTracker" backgroundColor='black' /> - <div className="sm:block hidden mt-4" style={{ overflow: 'hidden', height: '105vh', position: 'relative' }}> - <iframe src={graphURL} style={{ position: 'absolute', top: 0, left: 0 }} width="100%" height="100%"></iframe> - </div> - <SubscriberTable {...data} /> - </> - ); + const graphURL = process.env.NEXT_PUBLIC_GRAPH_URL; + const data: SubscriberDataTableProp = await getData(); + return ( + <> + <TitleBar title="PhaseTracker" backgroundColor="black" /> + <div + className="sm:block hidden mt-4" + style={{ overflow: "hidden", height: "105vh", position: "relative" }} + > + <iframe + src={graphURL} + style={{ position: "absolute", top: 0, left: 0 }} + width="100%" + height="100%" + ></iframe> + </div> + <SubscriberTable {...data} /> + </> + ); } async function getData() { - const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING - const response = await fetch(apiUrl + '/api/subscribers', { - headers: { - 'Cache-Control': 'no-cache' - }, - cache: 'no-cache' - }); - if (!response.ok) { - console.log(response.statusText); - } - return response.json(); + const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING; + const response = await fetch(apiUrl + "/api/subscribers", { + headers: { + "Cache-Control": "no-cache", + }, + cache: "no-cache", + }); + if (!response.ok) { + console.log(response.statusText); + } + return response.json(); } -export default Home;
\ No newline at end of file +export default Home; |
