diff options
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/globals.css | 3 | ||||
| -rw-r--r-- | src/app/page.tsx | 67 |
2 files changed, 38 insertions, 32 deletions
diff --git a/src/app/globals.css b/src/app/globals.css index e6d1700..c7bbd41 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,4 +1,5 @@ +@import url("https://fonts.googleapis.com/css2?family=Quantico:wght@400;700&display=swap"); + @tailwind base; @tailwind components; @tailwind utilities; -@import url('https://fonts.googleapis.com/css2?family=Quantico:wght@400;700&display=swap'); diff --git a/src/app/page.tsx b/src/app/page.tsx index b5db5b6..9c243db 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,41 +1,46 @@ import SubscriberTable, { - type SubscriberDataTableProp, + 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 + title="Phase Connect Subscriber Count Graph" + src={graphURL} + style={{ position: "absolute", top: 0, left: 0 }} + width="100%" + height="100%" + /> + </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 endpoint = "/api/subscribers"; + const headers = { + "Cache-Control": "no-cache", + }; + const cacheOption = "no-cache"; + + const response = await fetch(`${apiUrl}${endpoint}`, { + headers: headers, + cache: cacheOption, + }); + if (!response.ok) { + console.log(response.statusText); + } + return response.json(); } export default Home; |
