* fix: adjusted the AccountDetail width * feat: added health indicator updates * Update src/components/Account/AccountDetails.tsx Co-authored-by: Yusuf Seyrek <yusufseyrek@users.noreply.github.com> * fix: created a function for the back- and foregroundColors * fix: updated tailwind conf * fix: fixed the useHealthColorAndLabel function --------- Co-authored-by: Yusuf Seyrek <yusufseyrek@users.noreply.github.com> Co-authored-by: Bob van der Helm <34470358+bobthebuidlr@users.noreply.github.com>
16 lines
504 B
TypeScript
16 lines
504 B
TypeScript
export function getHealthIndicatorColors(
|
|
color: string,
|
|
updatedColor: string,
|
|
colorPrefix: 'fill' | 'text',
|
|
isUpdated: boolean,
|
|
isIncrease: boolean,
|
|
): [backgroundColor: string, foregroundColor: string] {
|
|
let backgroundColor = color
|
|
if (isUpdated && isIncrease) backgroundColor = updatedColor
|
|
if (isUpdated && !isIncrease) backgroundColor = `${colorPrefix}-grey`
|
|
|
|
const foreGroundColor = isIncrease ? `${colorPrefix}-grey` : updatedColor
|
|
|
|
return [backgroundColor, foreGroundColor]
|
|
}
|