-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Dynamic programming task
const badgeClasses = cn(styles[`cr-badge`], {
[styles[`${baseClass}--default`]]: !(success || danger || info || important || warning),
[styles[`${baseClass}--success`]]: success,
[styles[`${baseClass}--danger`]]: danger,
[styles[`${baseClass}--info`]]: info,
[styles[`${baseClass}--important`]]: important,
[styles[`${baseClass}--warning`]]: warning,
[styles[`${baseClass}--small`]]: small,
[styles[`${baseClass}--pill`]]: pill,
});When it comes, to variable declaration, you basically face dynamic programming problem. You don't know exactly how to convert badgeClasses, but you know, how to convert other variables.
So, on some step you will face trivial problem, when variable is going to be declared as is.
Like, for badgeClass you will face success variable, which is coming from props.