georgejkaye / delay-repay

Tool to calculate Delay Repay refunds
1 stars 1 forks source link

Change colour to also depend on the repay bracket #15

Closed FrozenDude101 closed 2 months ago

FrozenDude101 commented 2 months ago

Closes #9

All the elements which depend on getDelayStyle have both a delay, and a repayBracket prop. The repayBracket prop is undefined when there is no compenstation, so we can add that to the green case.

I will say, nested ternaries is cursed, but is actually readable and I think the best use case here

FrozenDude101 commented 2 months ago

If for some reason the arguments to this function expand more, and some elements don't have both a delay and repayBracket prop, switching to the kwarg object style arguments may be warranted.

georgejkaye commented 2 months ago

lgtm :+1: