-
Top 5 Contributors
+
Top 5 Contributors Today
View All ->
@@ -25,30 +24,7 @@ export function LeaderboardTable() {
borderRadius="xl"
className="p-6 shadow-sm"
>
- } spacing="4">
-
- {leaderboardEntries?.map(({ display_name, score }, idx) => (
-
-
- {/*
-
- */}
-
{display_name}
- {/*
-
{item.streakCount}
- */}
-
-
- {score}
-
-
- ))}
-
+
diff --git a/website/src/components/Dashboard/SlimFooter.tsx b/website/src/components/Dashboard/SlimFooter.tsx
new file mode 100644
index 00000000..5a7b093c
--- /dev/null
+++ b/website/src/components/Dashboard/SlimFooter.tsx
@@ -0,0 +1,45 @@
+import { Box, Divider } from "@chakra-ui/react";
+import Image from "next/image";
+import Link from "next/link";
+import { useMemo } from "react";
+
+export function SlimFooter() {
+ return (
+
+ );
+}
+
+const FooterLink = ({ href, label }: { href: string; label: string }) =>
+ useMemo(
+ () => (
+
+ {label}
+
+ ),
+ [href, label]
+ );
diff --git a/website/src/components/FlaggableElement.tsx b/website/src/components/FlaggableElement.tsx
index 4cd55293..b9e41a32 100644
--- a/website/src/components/FlaggableElement.tsx
+++ b/website/src/components/FlaggableElement.tsx
@@ -22,7 +22,7 @@ import {
} from "@chakra-ui/react";
import { QuestionMarkCircleIcon } from "@heroicons/react/20/solid";
import clsx from "clsx";
-import { useReducer } from "react";
+import { useEffect, useReducer } from "react";
import { FiAlertCircle } from "react-icons/fi";
import { get, post } from "src/lib/api";
import { Message } from "src/types/Conversation";
@@ -100,12 +100,14 @@ export const FlaggableElement = (props: FlaggableElementProps) => {
);
const [isEditing, setIsEditing] = useBoolean();
- useSWR("/api/valid_labels", get, {
- onSuccess: (data) => {
- const { valid_labels } = data;
- updateReport({ type: "load_labels", labels: valid_labels });
- },
- });
+ const { data, isLoading } = useSWR("/api/valid_labels", get);
+ useEffect(() => {
+ if (isLoading) {
+ return;
+ }
+ const { valid_labels } = data;
+ updateReport({ type: "load_labels", labels: valid_labels });
+ }, [data, isLoading]);
const { trigger } = useSWRMutation("/api/set_label", post, {
onSuccess: () => {
diff --git a/website/src/components/Footer.tsx b/website/src/components/Footer.tsx
index 9332461d..b22653e9 100644
--- a/website/src/components/Footer.tsx
+++ b/website/src/components/Footer.tsx
@@ -1,40 +1,66 @@
-import { useColorMode } from "@chakra-ui/react";
+import { Box, Divider, Flex, Text, useColorMode } from "@chakra-ui/react";
import Image from "next/image";
import Link from "next/link";
import { useMemo } from "react";
export function Footer() {
const { colorMode } = useColorMode();
- const bgColorClass = colorMode === "light" ? "bg-transparent" : "bg-gray-800";
- const borderClass = colorMode === "light" ? "border-slate-200" : "border-transparent";
+ const backgroundColor = colorMode === "light" ? "white" : "gray.800";
+ const textColor = colorMode === "light" ? "black" : "gray.300";
return (
-
);
}
@@ -42,14 +68,10 @@ export function Footer() {
const FooterLink = ({ href, label }: { href: string; label: string }) =>
useMemo(
() => (
-
- {label}
+
+
+ {label}
+
),
[href, label]
diff --git a/website/src/components/Layout.tsx b/website/src/components/Layout.tsx
index b26b9bf2..70a2ce2c 100644
--- a/website/src/components/Layout.tsx
+++ b/website/src/components/Layout.tsx
@@ -1,9 +1,11 @@
// https://nextjs.org/docs/basic-features/layouts
+import { Box, Grid } from "@chakra-ui/react";
import type { NextPage } from "next";
import { FiBarChart2, FiLayout, FiMessageSquare, FiUsers } from "react-icons/fi";
import { Header } from "src/components/Header";
+import { SlimFooter } from "./Dashboard/SlimFooter";
import { Footer } from "./Footer";
import { SideMenuLayout } from "./SideMenuLayout";
@@ -28,7 +30,7 @@ export const getTransparentHeaderLayout = (page: React.ReactElement) => (
);
export const getDashboardLayout = (page: React.ReactElement) => (
-
+
(
},
]}
>
- {page}
+
+ {page}
+
+
+
+
-
-
+
);
export const getAdminLayout = (page: React.ReactElement) => (
diff --git a/website/src/components/LeaderboardGridCell/LeaderboardGridCell.tsx b/website/src/components/LeaderboardGridCell/LeaderboardGridCell.tsx
index 35d83a75..df18735d 100644
--- a/website/src/components/LeaderboardGridCell/LeaderboardGridCell.tsx
+++ b/website/src/components/LeaderboardGridCell/LeaderboardGridCell.tsx
@@ -8,7 +8,7 @@ import useSWRImmutable from "swr/immutable";
const columns = [
{
Header: "Rank",
- accessor: (item: LeaderboardEntity, rowIndex: number) => "#" + (item.user_rank + 1),
+ accessor: "rank",
style: { width: "90px" },
},
{
diff --git a/website/src/components/Roadmap.tsx b/website/src/components/Roadmap.tsx
index 283a4c8f..a29e1984 100644
--- a/website/src/components/Roadmap.tsx
+++ b/website/src/components/Roadmap.tsx
@@ -51,7 +51,7 @@ const Roadmap = () => {