Skip to content

Commit

Permalink
Fix StarRating colors
Browse files Browse the repository at this point in the history
  • Loading branch information
HeidiTao committed Nov 2, 2024
1 parent 4ba8831 commit 2c6edde
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/frontend/src/components/StarRating.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useAppSelector } from "~/app/hooks";
import React from "react";
import StarRatings from "react-star-ratings";
import resolveConfig from "tailwindcss/resolveConfig";
import tailwindConfig from "../../tailwind.config.ts";
const fullConfig: any = resolveConfig(tailwindConfig);

export const StarRating = ({ rating }: { rating: number }) => {
const darkMode = useAppSelector((state) => state.ui.darkMode);
Expand All @@ -13,13 +16,13 @@ export const StarRating = ({ rating }: { rating: number }) => {
starSpacing="1px"
starRatedColor={
darkMode
? 'zinc-300'
: 'gray-500'
? fullConfig.theme.colors.zinc[50]
: fullConfig.theme.colors.gray[500]
}
starEmptyColor={
darkMode
? 'zinc-300'
: 'gray-500'
? fullConfig.theme.colors.zinc[500]
: fullConfig.theme.colors.gray[200]
}
/>
);
Expand Down

0 comments on commit 2c6edde

Please sign in to comment.