From 1c06c6f39af400184b74a1713217e3081d01a3f6 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 9 Jan 2024 16:26:51 -0800 Subject: add styled divider to stats pages --- src/components/Divider/Divider.tsx | 12 ++++++++++++ src/pages/stats/[slug].tsx | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 src/components/Divider/Divider.tsx (limited to 'src') diff --git a/src/components/Divider/Divider.tsx b/src/components/Divider/Divider.tsx new file mode 100644 index 0000000..55e6844 --- /dev/null +++ b/src/components/Divider/Divider.tsx @@ -0,0 +1,12 @@ +interface DividerProps { + text: string; +} + +const Divider = (props: DividerProps) => { + return ( +
+
{props.text}
+
+ ) +} +export default Divider; \ No newline at end of file diff --git a/src/pages/stats/[slug].tsx b/src/pages/stats/[slug].tsx index c6d8703..87e85ab 100644 --- a/src/pages/stats/[slug].tsx +++ b/src/pages/stats/[slug].tsx @@ -5,7 +5,7 @@ import { ChannelCard } from "@/components/channel-card"; import DataChart from "@/components/DataChart/DataChart"; import Footer from "@/components/Footer/Footer"; import Head from 'next/head' -import { channel } from "diagnostics_channel"; +import Divider from "@/components/Divider/Divider"; interface ChannelDataProp { channel_id: string; @@ -69,6 +69,7 @@ function Page({ chartData, channelData, sevenDayGraphData, slug }: { chartData: /> +
@@ -84,7 +85,7 @@ function Page({ chartData, channelData, sevenDayGraphData, slug }: { chartData: async function getGraphData(slug: string){ const encodedSlug = encodeURIComponent(slug as string); - const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING + const apiUrl = process.env.NEXT_PUBLIC_API_URL const response = await fetch(apiUrl+`/api/subscribers/${encodedSlug}`, { headers: { 'Cache-Control': 'no-cache' @@ -99,7 +100,7 @@ async function getGraphData(slug: string){ async function getChannelData(slug: string){ const encodedSlug = encodeURIComponent(slug as string); - const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING + const apiUrl = process.env.NEXT_PUBLIC_API_URL const response = await fetch(apiUrl+`/api/channel/${encodedSlug}`, { headers: { 'Cache-Control': 'no-cache' @@ -114,7 +115,7 @@ async function getChannelData(slug: string){ async function get7DGraphData(slug: string){ const encodedSlug = encodeURIComponent(slug as string); - const apiUrl = process.env.NEXT_PUBLIC_API_URL_TESTING + const apiUrl = process.env.NEXT_PUBLIC_API_URL const response = await fetch(apiUrl+`/api/subscribers/${encodedSlug}/7d`, { headers: { 'Cache-Control': 'no-cache' -- cgit v1.2.3