You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/01 04:18:34 UTC

[GitHub] [incubator-superset] rusackas commented on a change in pull request #11102: chore: refactor submenu's right nav to accept list of buttons

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org