Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions #17

Merged

Conversation

clintandrewhall
Copy link

Thoughts?

@clintandrewhall clintandrewhall force-pushed the pres-util/panel-toolbar branch from 5bcc732 to dd9a118 Compare March 15, 2021 21:28
@cqliu1
Copy link
Owner

cqliu1 commented Mar 18, 2021

I like this pattern a lot better than how I had it. Essentially consuming the component should look something like this right? Does that mean if you want to use SolutionToolbar, you also have to import the pre-styled children components, i.e. PrimaryActionButton, QuickButtonGroup, etc?

const quickButtons = [
    {
      iconType: 'visText',
      createType: i18n.translate('dashboard.panelToolbar.markdownQuickButtonLabel', {
        defaultMessage: 'Markdown',
      }),
      onClick: createNewVisType('markdown'),
    },
    {
      iconType: 'controlsHorizontal',
      createType: i18n.translate('dashboard.panelToolbar.markdownQuickButtonLabel', {
        defaultMessage: 'Input control',
      }),
      onClick: createNewVisType('input_control_vis'),
    },
  ];

return ( 
  <SolutionToolbar>
    {{
      primaryActionButton: (
        <PrimaryActionButton
          label={i18n.translate('dashboard.panelToolbar.addPanelButtonLabel', {
            defaultMessage: 'Create panel',
          })}
          onClick={createNew}
          iconType="plusInCircleFilled"
          data-test-subj="addVisualizationButton"
        />
      ),
      quickButtonGroup: <QuickButtonGroup buttons={quickButtons} />,
      addFromLibraryButton: <AddFromLibraryButton onClick={addFromLibrary} />,
    }}
  </SolutionToolbar>
);

@cqliu1 cqliu1 merged this pull request into cqliu1:pres-util/panel-toolbar Mar 22, 2021
@clintandrewhall clintandrewhall deleted the pres-util/panel-toolbar branch May 28, 2021 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants