* 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>
25 lines
529 B
TypeScript
25 lines
529 B
TypeScript
import type { ReactNode } from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
interface TrafficLightProps {
|
|
value: number;
|
|
q1: number;
|
|
q2: number;
|
|
children: ReactNode;
|
|
}
|
|
|
|
export const TrafficLight = ({
|
|
value,
|
|
q1,
|
|
q2,
|
|
children,
|
|
}: TrafficLightProps) => {
|
|
const slippageClassName = classNames({
|
|
'text-darkerGreen dark:text-lightGreen': value < q1,
|
|
'text-amber': value >= q1 && value < q2,
|
|
'text-vega-pink': value >= q2,
|
|
});
|
|
|
|
return <div className={slippageClassName}>{children || value}</div>;
|
|
};
|