* feat(#2465): change red to vega pink * feat(#2465): change red to vega pink part 2 * fix: update vega.red to vega.pink * feat: color the charts * feat: color the charts * feat: color the charts * fix: use dark pink and green * fix: use dark pink and green * feat(#2467): color long/short toggle and place order button * fix: colors wick showing within candle * fix: remove opacity from chart * fix: use vega dark pink and green for vol cell * fix: toggle and button colors * feat(#2465): toggle peer checked text white * fix: add liquidity supplied gap-2 in tooltip data grid * fix: add indicator temporarily * chore: update colors * chore: update from x-dark to vega-x * fix: rename symbols * chore: update sell candles to only use stroke as they are solidly filled * fix: remove use state * fix: remove network account types Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
26 lines
802 B
TypeScript
26 lines
802 B
TypeScript
export const positiveClassNames = 'text-vega-green dark:text-vega-green';
|
|
export const negativeClassNames = 'text-vega-pink dark:text-vega-pink';
|
|
|
|
const isPositive = ({ value }: { value: string | bigint | number }) =>
|
|
!!value &&
|
|
((typeof value === 'string' && !value.startsWith('-')) || value > 0);
|
|
|
|
const isNegative = ({ value }: { value: string | bigint | number }) =>
|
|
!!value &&
|
|
((typeof value === 'string' && value.startsWith('-')) || value < 0);
|
|
|
|
export const signedNumberCssClass = (value: string | bigint | number) => {
|
|
if (isPositive({ value })) {
|
|
return positiveClassNames;
|
|
}
|
|
if (isNegative({ value })) {
|
|
return negativeClassNames;
|
|
}
|
|
return '';
|
|
};
|
|
|
|
export const signedNumberCssClassRules = {
|
|
[positiveClassNames]: isPositive,
|
|
[negativeClassNames]: isNegative,
|
|
};
|