aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/page.tsx
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-05-03 11:53:19 -0700
committerPinapelz <yukais@pinapelz.com>2025-05-03 11:53:19 -0700
commitbeb10f29482261acbdc3e216ea929d9fa12fc149 (patch)
treebf3b2862d915f58d924a1d7e4a310ea4f44541c3 /src/app/page.tsx
parentfc055591ca47def0863cda55d063ab3f0a6cff5c (diff)
add announcement bar
Diffstat (limited to 'src/app/page.tsx')
-rw-r--r--src/app/page.tsx87
1 files changed, 48 insertions, 39 deletions
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 1723043..6d25642 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,50 +1,59 @@
import SubscriberTable, {
- type SubscriberDataTableProp,
+ type SubscriberDataTableProp,
} from "../components/SubscriberTable/SubscriberTable";
import TitleBar from "../components/TitleBar/TitleBar";
+import Announcement from "../components/Announcement";
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
- title="Phase Connect Subscriber Count Graph"
- src={graphURL}
- style={{ position: "absolute", top: 0, left: 0 }}
- width="100%"
- height="100%"
- />
- </div>
- <SubscriberTable {...data} />
- </>
- );
+ const graphURL = process.env.NEXT_PUBLIC_GRAPH_URL;
+ const announcementText = process.env.NEXT_PUBLIC_ANNOUNCEMENT;
+ const data: SubscriberDataTableProp = await getData();
+ return (
+ <>
+ <TitleBar title="PhaseTracker" backgroundColor="black" />
+ {announcementText && (
+ <Announcement
+ message={announcementText}
+ backgroundColor="#e0f7fa"
+ textColor="#006064"
+ />
+ )}
+ <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 endpoint = "/api/subscribers";
- const headers = {
- "Cache-Control": "no-cache",
- };
- const cacheOption = "no-cache";
+ 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();
+ const response = await fetch(`${apiUrl}${endpoint}`, {
+ headers: headers,
+ cache: cacheOption,
+ });
+ if (!response.ok) {
+ console.log(response.statusText);
+ }
+ return response.json();
}
export default Home;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage