rusackas commented on a change in pull request #11102:
URL:
https://github.com/apache/incubator-superset/pull/11102#discussion_r497974869
##########
File path: superset-frontend/src/components/Menu/SubMenu.tsx
##########
@@ -69,15 +68,24 @@ type MenuChild = {
usesRouter?: boolean;
};
+export enum ButtonStyleTypes {
+ Primary = 'primary',
+ Secondary = 'secondary',
+ Dashed = 'dashed',
+ Danger = 'danger',
+ Link = 'link',
+ Warning = 'warning',
+ Success = 'success',
+}
+
+interface ButtonProps {
+ name: any;
+ onClick: OnClickHandler;
+ style: ButtonStyleTypes;
Review comment:
Curious what you think about skipping the enum/export and just doing:
```suggestion
style: 'primary' | 'secondary' | 'tertiary' | 'dashed' | 'danger' | 'link'
| 'warning' | 'success';
```
It seems a little simpler/cleaner, since:
* You don't have to export anything here
* You won't have to import ButtonStyleTypes when you adda button, you can
use the string directly (e.g. `style: 'primary',`) as Typescript will know the
valid values anyway
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]