Skip to content

Commit

Permalink
fix: text color
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Sep 30, 2023
1 parent 7cee983 commit 6f84233
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ function ActiveDeputies({ initialDeputies }: Props) {
features={{ isWithinCardOrModal: true }}
containerProps={{ className: "mb-3 px-4" }}
data={activeDeputies.map((deputy) => {
const backgroundColor = deputy.status?.color;
const textColor = deputy.status?.textColor;
const color = backgroundColor
? textColor || generateContrastColor(backgroundColor)
: textColor;

const useDot = user?.statusViewMode === StatusViewMode.DOT_COLOR;
const nameAndCallsign = `${generateCallsign(deputy)} ${makeUnitName(deputy)}`;

const backgroundColor = deputy.status?.color;
const textColor = deputy.status?.textColor;
const color =
backgroundColor && !useDot
? textColor || generateContrastColor(backgroundColor)
: textColor;

return {
id: deputy.id,
rowProps: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,16 @@ function ActiveOfficers({ initialOfficers }: Props) {
containerProps={{ className: "mb-3 px-4" }}
tableState={tableState}
data={activeOfficers.map((officer) => {
const backgroundColor = officer.status?.color;
const textColor = officer.status?.textColor;
const color = backgroundColor
? textColor || generateContrastColor(backgroundColor)
: textColor;

const useDot = user?.statusViewMode === StatusViewMode.DOT_COLOR;
const nameAndCallsign = `${generateCallsign(officer)} ${makeUnitName(officer)}`;

const backgroundColor = officer.status?.color;
const textColor = officer.status?.textColor;
const color =
backgroundColor && !useDot
? textColor || generateContrastColor(backgroundColor)
: textColor;

return {
id: officer.id,
rowProps: {
Expand Down

0 comments on commit 6f84233

Please sign in to comment.