From 0d05c652fc7caa8bc66f0aaf02a56b6a69af06cf Mon Sep 17 00:00:00 2001 From: qinscode Date: Wed, 21 May 2025 18:39:17 +0800 Subject: [PATCH] style: add cursor property to various components - Add cursor: 'default' to AnalysisHeader, CommitsTab - Improve user experience by setting cursor to default for non-interactive elements --- .../analysis/components/StudentOrderer.tsx | 1 + .../components/layout/AnalysisHeader.tsx | 3 ++ .../components/teamwork/TeamworkTable.tsx | 44 ++++++++++++++++--- .../github/analysis/tabs/CommitsTab.tsx | 12 ++++- .../github/analysis/tabs/TeamworkTab.tsx | 10 +++-- 5 files changed, 57 insertions(+), 13 deletions(-) diff --git a/src/components/github/analysis/components/StudentOrderer.tsx b/src/components/github/analysis/components/StudentOrderer.tsx index 9aefbe1..48e3bf8 100644 --- a/src/components/github/analysis/components/StudentOrderer.tsx +++ b/src/components/github/analysis/components/StudentOrderer.tsx @@ -117,6 +117,7 @@ const StudentOrderer: React.FC = ({ onReorder }) => { fontSize: "1.25rem", color: "#3B82F6", letterSpacing: "0.01em", + cursor: "default", }} > Student Order{" "} diff --git a/src/components/github/analysis/components/layout/AnalysisHeader.tsx b/src/components/github/analysis/components/layout/AnalysisHeader.tsx index 2938360..b7bb80a 100644 --- a/src/components/github/analysis/components/layout/AnalysisHeader.tsx +++ b/src/components/github/analysis/components/layout/AnalysisHeader.tsx @@ -26,6 +26,7 @@ const AnalysisHeader = ({ enterDelay={500} leaveDelay={200} placement="top" + sx={{ cursor: "default" }} title={`${title}${description ? ` - ${description}` : ""}${headerTitle ? ` (${headerTitle})` : ""}`} > {title} @@ -74,6 +76,7 @@ const AnalysisHeader = ({ color: "rgba(107, 114, 128, 0.9)", position: "relative", zIndex: 1, + cursor: "default", }} > {description} diff --git a/src/components/github/analysis/components/teamwork/TeamworkTable.tsx b/src/components/github/analysis/components/teamwork/TeamworkTable.tsx index df1000a..73a67f6 100644 --- a/src/components/github/analysis/components/teamwork/TeamworkTable.tsx +++ b/src/components/github/analysis/components/teamwork/TeamworkTable.tsx @@ -1,5 +1,22 @@ -import { Box, Typography, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Avatar, Chip, Card, Grow, alpha } from "@mui/material"; -import { ChatBubble as CommentIcon, RateReview as ReviewIcon } from "@mui/icons-material"; +import { + Box, + Typography, + TableContainer, + Table, + TableHead, + TableRow, + TableCell, + TableBody, + Avatar, + Chip, + Card, + Grow, + alpha, +} from "@mui/material"; +import { + ChatBubble as CommentIcon, + RateReview as ReviewIcon, +} from "@mui/icons-material"; import { TeamworkColors } from "./TeamworkTheme"; interface TeamworkTableProps { @@ -19,7 +36,9 @@ const TeamworkTable: React.FC = ({ index, }) => { const isIssuesTable = title.includes("Issues"); - const lightColor = isIssuesTable ? TeamworkColors.light : "rgba(139, 92, 246, 0.1)"; + const lightColor = isIssuesTable + ? TeamworkColors.light + : "rgba(139, 92, 246, 0.1)"; const lighterColor = isIssuesTable ? TeamworkColors.lighter : "rgba(139, 92, 246, 0.05)"; @@ -72,18 +91,29 @@ const TeamworkTable: React.FC = ({ > {isIssuesTable ? ( ) : ( )} {title} @@ -221,4 +251,4 @@ const TeamworkTable: React.FC = ({ ); }; -export default TeamworkTable; \ No newline at end of file +export default TeamworkTable; diff --git a/src/components/github/analysis/tabs/CommitsTab.tsx b/src/components/github/analysis/tabs/CommitsTab.tsx index deafaa4..5ef3941 100644 --- a/src/components/github/analysis/tabs/CommitsTab.tsx +++ b/src/components/github/analysis/tabs/CommitsTab.tsx @@ -78,8 +78,12 @@ function UserCommits({ sx={{ color: commitsTheme.main, mr: 1, fontSize: "1.1rem" }} /> Weekly Commit Frequency @@ -182,8 +186,12 @@ function CommitsTab({ data }: CommitsTabProps) { sx={{ color: commitsTheme.main, mr: 1, fontSize: "1.2rem" }} /> Contributor Commit Timeline diff --git a/src/components/github/analysis/tabs/TeamworkTab.tsx b/src/components/github/analysis/tabs/TeamworkTab.tsx index 10b0eed..8af896a 100644 --- a/src/components/github/analysis/tabs/TeamworkTab.tsx +++ b/src/components/github/analysis/tabs/TeamworkTab.tsx @@ -2,9 +2,9 @@ import { useMemo, useContext } from "react"; import { Box, Typography, Fade, alpha, useTheme } from "@mui/material"; import { RepoData } from "@/services/github"; import { RepoContext } from "@/components/github/repo-analysis/RepoResults"; -import { - TeamworkTable, - TeamworkInteractionsTable +import { + TeamworkTable, + TeamworkInteractionsTable, } from "../components/teamwork"; interface TeamworkTabProps { @@ -97,6 +97,7 @@ function TeamworkTab({ data }: TeamworkTabProps) { color: alpha(theme.palette.primary.main, 0.7), mb: 2, fontWeight: 500, + cursor: "default", }} > No teamwork data available for this repository @@ -107,6 +108,7 @@ function TeamworkTab({ data }: TeamworkTabProps) { color: alpha(theme.palette.text.secondary, 0.7), maxWidth: "600px", mx: "auto", + cursor: "default", }} > This repository doesn't have any recorded issue comments or pull @@ -169,4 +171,4 @@ function TeamworkTab({ data }: TeamworkTabProps) { ); } -export default TeamworkTab; \ No newline at end of file +export default TeamworkTab;