Update styling and heading levels.
This commit is contained in:
@@ -13,7 +13,7 @@ const CommandResponsesChart = ({
|
|||||||
return (
|
return (
|
||||||
<VStack gap={4} w="100%">
|
<VStack gap={4} w="100%">
|
||||||
<Heading
|
<Heading
|
||||||
as="h2"
|
as="h4"
|
||||||
fontSize="2xl"
|
fontSize="2xl"
|
||||||
>{`Commands Responded To (Past 30 Days)`}</Heading>
|
>{`Commands Responded To (Past 30 Days)`}</Heading>
|
||||||
<LineChartComponent data={lineChartData} label="Command Responses" />
|
<LineChartComponent data={lineChartData} label="Command Responses" />
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const LinksDeletedChart = ({
|
|||||||
}: LinksDeletedChartProps): JSX.Element => {
|
}: LinksDeletedChartProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<VStack gap={4} w="100%">
|
<VStack gap={4} w="100%">
|
||||||
<Heading as="h2" fontSize="2xl">{`Links Deleted (Past 30 Days)`}</Heading>
|
<Heading as="h4" fontSize="2xl">{`Links Deleted (Past 30 Days)`}</Heading>
|
||||||
<LineChartComponent data={lineChartData} label="Links Deleted" />
|
<LineChartComponent data={lineChartData} label="Links Deleted" />
|
||||||
</VStack>
|
</VStack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Fragment, JSX } from "react";
|
import { JSX } from "react";
|
||||||
import { Heading, Flex } from "@chakra-ui/react";
|
import { Heading, Flex, VStack } from "@chakra-ui/react";
|
||||||
import { CombinedError } from "urql";
|
import { CombinedError } from "urql";
|
||||||
import SingleStatComponent from "@/components/stats/SingleStat";
|
import SingleStatComponent from "@/components/stats/SingleStat";
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ const StatsList = ({
|
|||||||
triggers
|
triggers
|
||||||
}: StatsListProps): JSX.Element => {
|
}: StatsListProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<VStack gap={6} w="100%">
|
||||||
<Heading as="h1" fontSize="3xl">
|
<Heading as="h3" fontSize="3xl">
|
||||||
{title}
|
{title}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Flex w="80%" flexDirection={{ base: "column", md: "row" }} gap={4}>
|
<Flex w="80%" flexDirection={{ base: "column", md: "row" }} gap={4}>
|
||||||
@@ -55,7 +55,7 @@ const StatsList = ({
|
|||||||
stat={triggers}
|
stat={triggers}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Fragment>
|
</VStack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const TimedTriggeredChart = ({
|
|||||||
return (
|
return (
|
||||||
<VStack gap={4} w="100%">
|
<VStack gap={4} w="100%">
|
||||||
<Heading
|
<Heading
|
||||||
as="h2"
|
as="h4"
|
||||||
fontSize="2xl"
|
fontSize="2xl"
|
||||||
>{`Times Bot Was Triggered (Past 30 Days)`}</Heading>
|
>{`Times Bot Was Triggered (Past 30 Days)`}</Heading>
|
||||||
<LineChartComponent data={lineChartData} label="Times Triggered" />
|
<LineChartComponent data={lineChartData} label="Times Triggered" />
|
||||||
|
|||||||
157
src/app/page.tsx
157
src/app/page.tsx
@@ -1,8 +1,17 @@
|
|||||||
/* eslint-disable react-hooks/set-state-in-effect */
|
/* eslint-disable react-hooks/set-state-in-effect */
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { Fragment, useEffect, useState } from "react";
|
||||||
import { Heading, Skeleton, VStack } from "@chakra-ui/react";
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Heading,
|
||||||
|
Icon,
|
||||||
|
Link,
|
||||||
|
Skeleton,
|
||||||
|
Text,
|
||||||
|
VStack
|
||||||
|
} from "@chakra-ui/react";
|
||||||
import { useQuery } from "@urql/next";
|
import { useQuery } from "@urql/next";
|
||||||
import lineChartArr from "@/lib/lineChartArray";
|
import lineChartArr from "@/lib/lineChartArray";
|
||||||
import LinksDeletedChart from "./LinksDeletedChart";
|
import LinksDeletedChart from "./LinksDeletedChart";
|
||||||
@@ -14,6 +23,7 @@ import StatsList from "./StatsList";
|
|||||||
import GetTotalGroupsQuery from "@/graphql/queries/getTotalGroups";
|
import GetTotalGroupsQuery from "@/graphql/queries/getTotalGroups";
|
||||||
import GetTotalStatsQuery from "@/graphql/queries/getTotalStats";
|
import GetTotalStatsQuery from "@/graphql/queries/getTotalStats";
|
||||||
import GetTodaysStatsQuery from "@/graphql/queries/getTodaysStats";
|
import GetTodaysStatsQuery from "@/graphql/queries/getTodaysStats";
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
// * Total Groups * //
|
// * Total Groups * //
|
||||||
@@ -85,36 +95,119 @@ export default function Home() {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VStack w="100%" gap={6}>
|
<Fragment>
|
||||||
<StatsList
|
<VStack
|
||||||
title="Total Stats"
|
bg="cyan.950"
|
||||||
loading={totalStatsFetching || totalGroupsFetching}
|
w="100vw"
|
||||||
error={totalStatsError || totalGroupsError}
|
minH="100vh"
|
||||||
groups={totalGroups.getTotalGroups}
|
h="100%"
|
||||||
links={totalStats.getTotalStats.linksDeleted}
|
py="5vh"
|
||||||
commands={totalStats.getTotalStats.commandResponses}
|
minW="fit-content"
|
||||||
triggers={totalStats.getTotalStats.timesTriggered}
|
>
|
||||||
/>
|
<VStack w={{ base: "100%", md: "90%" }} gap={6} minW="fit-content">
|
||||||
<StatsList
|
<VStack w="80%" gap={10}>
|
||||||
title="Today's Stats"
|
<Icon h="7.5rem" color="whiteAlpha">
|
||||||
loading={todaysStatsFetching}
|
<svg
|
||||||
error={todaysStatsError}
|
id="svg2"
|
||||||
links={todayStats.getTodayStats.linksDeleted}
|
version="1.1"
|
||||||
commands={todayStats.getTodayStats.commandResponses}
|
width="409.96661"
|
||||||
triggers={todayStats.getTodayStats.timesTriggered}
|
height="409.98404"
|
||||||
/>
|
viewBox="0 0 409.96661 409.98404"
|
||||||
<VStack w="80vw" gap={6}>
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<Heading as="h1" fontSize="3xl">{`30 Day Stats`}</Heading>
|
>
|
||||||
<Skeleton w="100%" h="auto" loading={thirtyDayStatsFetching}>
|
<g fill="currentColor">
|
||||||
<LinksDeletedChart lineChartData={lineChartArrState} />
|
<path
|
||||||
</Skeleton>
|
d="m 198.43447,409.88349 c -16.87402,-0.52429 -33.96148,-3.20112 -50.15064,-7.85635 -16.89988,-4.85959 -33.4194,-12.04085 -48.45,-21.06187 C 89.057412,374.49751 79.188152,367.3017 69.836023,359.09346 63.443873,353.48316 56.486693,346.52267 50.841584,340.09001 23.882655,309.37001 6.733496,271.34323 1.6401223,230.99002 -3.0267695,194.01569 2.3071672,156.75191 17.114155,122.88582 c 2.83776,-6.49044 6.63732,-14.00102 10.21694,-20.1958 C 42.991144,75.589277 64.616853,52.405411 90.533832,34.933461 108.33243,22.934523 127.85299,13.821763 148.38383,7.9274153 c 26.15516,-7.50907673 53.79077,-9.7183097 81.05,-6.4792629 50.21751,5.9670387 96.51852,30.4672236 130.00448,68.7918786 26.75943,30.626139 43.81786,68.571209 48.88922,108.749989 4.86563,38.54882 -1.15232,77.44493 -17.37657,112.31081 -8.98481,19.30835 -20.76424,36.8569 -35.46819,52.83918 -2.44277,2.65514 -8.7281,8.94409 -11.35114,11.35768 -14.70283,13.5288 -30.43046,24.37645 -48.03196,33.12859 -4.05332,2.01546 -5.5776,2.72668 -9.56585,4.46335 -27.56473,12.00295 -57.65906,17.73965 -88.09935,16.79386 z m 13.44936,-34.9928 c 25.01212,-1.07439 48.36413,-7.17806 70.34385,-18.38623 19.2632,-9.82294 36.50092,-23.26822 50.87783,-39.6843 7.86352,-8.97886 15.0508,-19.24676 20.93747,-29.91169 1.47754,-2.67687 4.04205,-7.75113 5.39976,-10.6842 8.41325,-18.17525 13.5806,-38.08598 15.08733,-58.13425 0.35814,-4.76539 0.40375,-6.24526 0.40375,-13.1 0,-7.80507 -0.13553,-10.87819 -0.75413,-17.1 -3.3773,-33.96857 -16.9036,-65.97946 -39.00164,-92.299992 -4.83753,-5.76189 -10.83367,-11.955826 -16.62603,-17.174494 -16.89903,-15.22529 -37.39974,-27.226947 -58.91819,-34.492262 -15.49468,-5.231496 -31.10132,-8.118781 -47.75,-8.833924 -2.89874,-0.124515 -10.90126,-0.124515 -13.8,0 -16.64507,0.714988 -32.25869,3.603565 -47.75,8.833924 -22.42114,7.57009 -43.37752,20.065402 -60.949998,36.341643 -2.01749,1.868667 -6.68465,6.525563 -8.64412,8.625113 -18.522729,19.846862 -31.943938,43.538062 -39.299728,69.372092 -3.13635,11.01509 -5.12484,22.15786 -6.00108,33.6279 -0.35666,4.6688 -0.40507,6.2343 -0.40507,13.1 0,6.8657 0.04841,8.4312 0.40507,13.1 1.22839,16.0797 4.67357,31.67931 10.32477,46.75 5.59407,14.91838 13.591089,29.46979 23.231919,42.27293 12.532319,16.64308 28.020458,30.89004 45.549847,41.8996 16.73723,10.51204 34.82788,17.91208 54.08839,22.12504 9.16278,2.00422 19.45487,3.32848 29.1,3.74422 2.65778,0.11456 11.5597,0.12015 14.15,0.009 z m -37.2,-46.83768 v -30.8126 l 9.28842,9.28802 9.28842,9.28802 76.72486,-76.72488 76.72486,-76.72488 12.28672,12.28673 12.28673,12.28673 -76.64997,76.64993 c -42.15747,42.15746 -76.64998,76.71734 -76.65,76.79973 -2e-5,0.0824 4.12343,4.27345 9.16323,9.31347 l 9.16327,9.16368 -30.81327,-0.001 -30.81327,-10e-4 v -30.81259 z m -61.7,-31.04633 c -0.0664,-0.0221 -0.1,-10.37788 -0.1,-30.79993 v -30.7666 l 9.2544,9.2544 9.2544,9.2544 76.72511,-76.72511 76.7251,-76.72511 12.29318,12.29349 12.29318,12.29349 -76.64567,76.64613 c -42.15513,42.15537 -76.66344,76.6994 -76.68514,76.7645 -0.0217,0.0651 4.0948,4.25282 9.14779,9.30603 5.05298,5.0532 9.16483,9.1914 9.13745,9.19599 -0.1628,0.0273 -61.31804,0.0356 -61.3998,0.008 z M 51.026084,235.09894 c -0.02324,-0.0232 -0.04225,-13.88347 -0.04225,-30.80052 v -30.75827 l 9.266339,9.26634 9.26633,9.26634 76.638487,-76.63848 c 42.15116,-42.151155 76.68658,-76.668199 76.74537,-76.704532 0.06,-0.03707 5.49452,5.321436 12.38275,12.209497 l 12.27587,12.275559 -76.68758,76.687446 c -42.17816,42.1781 -76.687569,76.72116 -76.687569,76.76237 0,0.0412 4.140059,4.21517 9.200129,9.27546 l 9.20013,9.20054 H 81.826212 c -16.916829,0 -30.776888,-0.0188 -30.800128,-0.042 z"
|
||||||
<Skeleton w="100%" h="auto" loading={thirtyDayStatsFetching}>
|
id="path3338"
|
||||||
<CommandResponsesChart lineChartData={lineChartArrState} />
|
/>
|
||||||
</Skeleton>
|
</g>
|
||||||
<Skeleton w="100%" h="auto" loading={thirtyDayStatsFetching}>
|
</svg>
|
||||||
<TimedTriggeredChart lineChartData={lineChartArrState} />
|
</Icon>
|
||||||
</Skeleton>
|
<VStack gap={4} maxW="30rem">
|
||||||
|
<Heading as="h1" fontSize="5xl">
|
||||||
|
{"Nazi Site Patrol Stats"}
|
||||||
|
</Heading>
|
||||||
|
<Heading
|
||||||
|
as="h2"
|
||||||
|
fontSize="xl"
|
||||||
|
color="whiteAlpha.800"
|
||||||
|
textAlign="center"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
"A telegram bot that removes links and embeds to sites that align with the Fascist Right political agenda."
|
||||||
|
}
|
||||||
|
</Heading>
|
||||||
|
</VStack>
|
||||||
|
<VStack gap={0} w="min-content">
|
||||||
|
<Link target="_blank" href={`https://t.me/NoTwitter_Bot`}>
|
||||||
|
<Button variant="solid" bgColor={"teal.solid"} fontSize="xl">
|
||||||
|
{"Add the bot to your telegram group"}
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
<Text textAlign="center" fontSize="md" color="whiteAlpha.800">
|
||||||
|
{
|
||||||
|
"The bot requires no configuration. All it needs is admin privileges to delete messages in your group."
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</VStack>
|
||||||
|
</VStack>
|
||||||
|
<VStack gap={10} w="100%">
|
||||||
|
<StatsList
|
||||||
|
title="Total Stats"
|
||||||
|
loading={totalStatsFetching || totalGroupsFetching}
|
||||||
|
error={totalStatsError || totalGroupsError}
|
||||||
|
groups={totalGroups.getTotalGroups}
|
||||||
|
links={totalStats.getTotalStats.linksDeleted}
|
||||||
|
commands={totalStats.getTotalStats.commandResponses}
|
||||||
|
triggers={totalStats.getTotalStats.timesTriggered}
|
||||||
|
/>
|
||||||
|
<StatsList
|
||||||
|
title="Today's Stats"
|
||||||
|
loading={todaysStatsFetching}
|
||||||
|
error={todaysStatsError}
|
||||||
|
links={todayStats.getTodayStats.linksDeleted}
|
||||||
|
commands={todayStats.getTodayStats.commandResponses}
|
||||||
|
triggers={todayStats.getTodayStats.timesTriggered}
|
||||||
|
/>
|
||||||
|
</VStack>
|
||||||
|
<VStack w="95%" gap="5vh">
|
||||||
|
<Heading as="h1" fontSize="3xl">{`30 Day Stats`}</Heading>
|
||||||
|
<Skeleton w="100%" h="auto" loading={thirtyDayStatsFetching}>
|
||||||
|
<LinksDeletedChart lineChartData={lineChartArrState} />
|
||||||
|
</Skeleton>
|
||||||
|
<Skeleton w="100%" h="auto" loading={thirtyDayStatsFetching}>
|
||||||
|
<CommandResponsesChart lineChartData={lineChartArrState} />
|
||||||
|
</Skeleton>
|
||||||
|
<Skeleton w="100%" h="auto" loading={thirtyDayStatsFetching}>
|
||||||
|
<TimedTriggeredChart lineChartData={lineChartArrState} />
|
||||||
|
</Skeleton>
|
||||||
|
</VStack>
|
||||||
|
</VStack>
|
||||||
</VStack>
|
</VStack>
|
||||||
</VStack>
|
<VStack
|
||||||
|
w="100vw"
|
||||||
|
py="5vh"
|
||||||
|
textAlign="center"
|
||||||
|
color="white"
|
||||||
|
textShadow="0px 0px 5px black;"
|
||||||
|
gap={6}
|
||||||
|
>
|
||||||
|
<Text fontSize="3xl" w="auto" bg="blackAlpha.400" maxW="62vw">
|
||||||
|
{"Down with fascism! Fuck MAGA! Fuck Trump! Fuck Nazis!"}
|
||||||
|
</Text>
|
||||||
|
<Text fontSize="3xl" w="auto" bg="blackAlpha.400" maxW="62vw">
|
||||||
|
{
|
||||||
|
"Trans rights are human rights! Trans women are women! Trans men are men! Never let them take away your happiness!"
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</VStack>
|
||||||
|
<Box w="100vw" h="100vh" position="fixed" bottom="-510px" zIndex={-1}>
|
||||||
|
<Image
|
||||||
|
fill
|
||||||
|
alt="intersex inclusive pride flag"
|
||||||
|
src="https://upload.wikimedia.org/wikipedia/commons/6/60/Intersex-inclusive_pride_flag.svg"
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,25 +21,26 @@ const LineChartComponent = ({
|
|||||||
}: LineChartComponentProps): JSX.Element => {
|
}: LineChartComponentProps): JSX.Element => {
|
||||||
const chart = useChart({
|
const chart = useChart({
|
||||||
data: [...data],
|
data: [...data],
|
||||||
series: [{ name: label, color: "blue.700" }]
|
series: [{ name: label, color: "teal.500" }]
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Chart.Root maxH="xs" chart={chart} maxW="100%">
|
<Chart.Root maxH="xs" chart={chart} maxW="100vw">
|
||||||
<LineChart data={chart.data}>
|
<LineChart data={chart.data}>
|
||||||
<CartesianGrid stroke={chart.color("border")} vertical={false} />
|
<CartesianGrid stroke={chart.color("border")} vertical={false} />
|
||||||
<XAxis
|
<XAxis
|
||||||
// axisLine={false}
|
axisLine={false}
|
||||||
dataKey={chart.key("day")}
|
dataKey={chart.key("day")}
|
||||||
stroke={chart.color("border")}
|
stroke={chart.color("border")}
|
||||||
// label={{ value: "Day", position: "bottom" }}
|
// label={{ value: "Day", position: "bottom" }}
|
||||||
/>
|
/>
|
||||||
<YAxis
|
<YAxis
|
||||||
// axisLine={false}
|
width="auto"
|
||||||
|
axisLine={false}
|
||||||
tickLine={false}
|
tickLine={false}
|
||||||
tickMargin={10}
|
tickMargin={10}
|
||||||
stroke={chart.color("border")}
|
stroke={chart.color("border")}
|
||||||
// label={{ value: label, position: "left", angle: -90 }}
|
// label={{ value: label, position: "left", angle: -90 }}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
animationDuration={100}
|
animationDuration={100}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const SingleStatComponent = ({
|
|||||||
}: SingleStatComponentProps): JSX.Element => {
|
}: SingleStatComponentProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<Stat.Root alignItems="center">
|
<Stat.Root alignItems="center">
|
||||||
<Stat.Label>{title}</Stat.Label>
|
<Stat.Label textAlign="center">{title}</Stat.Label>
|
||||||
<Stat.ValueText>
|
<Stat.ValueText>
|
||||||
<Skeleton loading={loading} w="auto" minW="2.5rem" textAlign="center">
|
<Skeleton loading={loading} w="auto" minW="2.5rem" textAlign="center">
|
||||||
{(error || stat === undefined) && !loading ? (
|
{(error || stat === undefined) && !loading ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user