Merge pull request #370 from k-nearest-neighbor/a_few_dashboard_fixes

A few dashboard fixes
This commit is contained in:
Keith Stevens
2023-01-04 20:37:40 +09:00
committed by GitHub
5 changed files with 14 additions and 14 deletions
@@ -1,6 +1,6 @@
import { Badge, Box, Image, Link, Stack, StackDivider, Text, useColorModeValue } from "@chakra-ui/react"; import { Badge, Box, Image, Link, Stack, StackDivider, Text, useColorModeValue } from "@chakra-ui/react";
export function LeaderboardWidget() { export function LeaderboardTable() {
const backgroundColor = useColorModeValue("white", "gray.700"); const backgroundColor = useColorModeValue("white", "gray.700");
const accentColor = useColorModeValue("gray.200", "gray.900"); const accentColor = useColorModeValue("gray.200", "gray.900");
@@ -54,7 +54,7 @@ export function LeaderboardWidget() {
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
<div className="flex items-end justify-between"> <div className="flex items-end justify-between">
<Text className="text-2xl font-bold">Top 5 Contributors</Text> <Text className="text-2xl font-bold">Top 5 Contributors</Text>
<Link key="Leaderboard" href="#" _hover={{ textDecoration: "none" }}> <Link href="#" _hover={{ textDecoration: "none" }}>
<Text color="blue.400" className="text-sm font-bold"> <Text color="blue.400" className="text-sm font-bold">
View All -&gt; View All -&gt;
</Text> </Text>
@@ -74,8 +74,8 @@ export function LeaderboardWidget() {
<p>Score</p> <p>Score</p>
</div> </div>
</div> </div>
{leaderInfo.map((item) => ( {leaderInfo.map((item, itemIndex) => (
<div key="User" className="grid grid-cols-4 items-center"> <div key={itemIndex} className="grid grid-cols-4 items-center">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<Image alt="Profile Picture" src={item.image} boxSize="7" borderRadius="full"></Image> <Image alt="Profile Picture" src={item.image} boxSize="7" borderRadius="full"></Image>
<p>{item.name}</p> <p>{item.name}</p>
@@ -37,15 +37,15 @@ export function SideMenu() {
className="grid grid-cols-4 gap-2 sm:flex sm:flex-col sm:justify-between p-4 h-full" className="grid grid-cols-4 gap-2 sm:flex sm:flex-col sm:justify-between p-4 h-full"
> >
<nav className="grid grid-cols-3 col-span-3 sm:flex sm:flex-col gap-2"> <nav className="grid grid-cols-3 col-span-3 sm:flex sm:flex-col gap-2">
{buttonOptions.map((item) => ( {buttonOptions.map((item, itemIndex) => (
<Tooltip <Tooltip
key="Tooltip" key={itemIndex}
fontFamily="inter" fontFamily="inter"
label={item.label} label={item.label}
placement="right" placement="right"
className="hidden lg:hidden sm:block" className="hidden lg:hidden sm:block"
> >
<Link key="{item.label}" href={item.pathname} style={{ textDecoration: "none" }}> <Link key={`${item.label}-${itemIndex}`} href={item.pathname} style={{ textDecoration: "none" }}>
<Button <Button
justifyContent={["center", "center", "center", "left"]} justifyContent={["center", "center", "center", "left"]}
gap="3" gap="3"
@@ -46,8 +46,8 @@ export const TaskOption = () => {
<div> <div>
<Text className="text-2xl font-bold pb-4">Create</Text> <Text className="text-2xl font-bold pb-4">Create</Text>
<SimpleGrid columns={[1, 2, 2, 3, 4]} gap={4}> <SimpleGrid columns={[1, 2, 2, 3, 4]} gap={4}>
{crTasks.map((item) => ( {crTasks.map((item, itemIndex) => (
<Link key="Create Option" href={item.pathname}> <Link key={itemIndex} href={item.pathname}>
<GridItem <GridItem
bg={backgroundColor} bg={backgroundColor}
borderRadius="xl" borderRadius="xl"
@@ -82,8 +82,8 @@ export const TaskOption = () => {
<div> <div>
<Text className="text-2xl font-bold pb-4">Evaluate</Text> <Text className="text-2xl font-bold pb-4">Evaluate</Text>
<SimpleGrid columns={[1, 2, 2, 3, 4]} gap={4}> <SimpleGrid columns={[1, 2, 2, 3, 4]} gap={4}>
{evTasks.map((item) => ( {evTasks.map((item, itemIndex) => (
<Link key="Evaluate Option" href={item.pathname}> <Link key={itemIndex} href={item.pathname}>
<GridItem <GridItem
bg={backgroundColor} bg={backgroundColor}
borderRadius="xl" borderRadius="xl"
@@ -1,3 +1,3 @@
export { LeaderboardWidget } from "./LeaderboardWidget"; export { LeaderboardTable } from "./LeaderboardTable";
export { SideMenu } from "./SideMenu"; export { SideMenu } from "./SideMenu";
export { TaskOption } from "./TaskOption"; export { TaskOption } from "./TaskOption";
+2 -2
View File
@@ -1,7 +1,7 @@
import { Box, useColorMode } from "@chakra-ui/react"; import { Box, useColorMode } from "@chakra-ui/react";
import Head from "next/head"; import Head from "next/head";
import { Header } from "src/components/Header"; import { Header } from "src/components/Header";
import { LeaderboardWidget, SideMenu, TaskOption } from "src/components/Widgets"; import { LeaderboardTable, SideMenu, TaskOption } from "src/components/Dashboard";
import { colors } from "styles/Theme/colors"; import { colors } from "styles/Theme/colors";
const Dashboard = () => { const Dashboard = () => {
@@ -19,7 +19,7 @@ const Dashboard = () => {
</Box> </Box>
<Box className="flex flex-col overflow-auto p-6 sm:pl-0 gap-14"> <Box className="flex flex-col overflow-auto p-6 sm:pl-0 gap-14">
<TaskOption /> <TaskOption />
<LeaderboardWidget /> <LeaderboardTable />
</Box> </Box>
</Box> </Box>
</Box> </Box>