Skip to content

Commit

Permalink
feat: support mock data, add some avatar color manage methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Auroraphile committed Oct 5, 2024
1 parent 6542ef7 commit 5845b4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/dashboard/components/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ const Avatar: React.FC<AvatarProps> = ({ userId, userName, totalUsers }) => {
const candidateList = useStore((state) => state.candidateList);

useEffect(() => {
assignColorsToCandidates(); // 分配颜色给所有候选人
assignColorsToCandidates();
console.log(candidateList);
}, [assignColorsToCandidates, candidateList]);
}, [assignColorsToCandidates]);

const candidate = candidateList.find((candidate) => candidate.id === userId);
const backgroundColor = candidate ? candidate.color : "#CCCCCC";
Expand All @@ -71,7 +71,7 @@ const Avatar: React.FC<AvatarProps> = ({ userId, userName, totalUsers }) => {
justifyContent: "center",
color: "#FFFFFF",
fontWeight: "bold",
backgroundColor: backgroundColor, // 使用 Zustand 中的颜色
backgroundColor: backgroundColor,
fontSize: 14,
textTransform: "uppercase",
};
Expand Down

0 comments on commit 5845b4b

Please sign in to comment.