Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/components / structure / CreatePollMenuDropdown / CreatePollMenuDropdown.md
Size: Mime:

The CreatePollMenuDropdown component should only be used if you have a very good reason, like if you are in an environment where the CreateMenuPoll component is not practical (such is the case in the Outlook Add-in where the app has to render in very small resolutions). If you aren't sure if you should be using this component, ask your team's Design Chapter member or PM if you really need this, otherwise, you should favor the use of CreateMenuPoll.

For a Logged-in user The dropdown menu will appear, and you can supply click handlers to each menu item.

const user = {
    data: {
      name: 'Tom Tom',
      email: 'tom@example.com',
      avatarSmallUrl:
        'https://6a5edc300520d4037dd6-0732807511066685711db213ddc1d2df.ssl.cf2.rackcdn.com/snw8ceng29ch3zbs4pvro3t2jxswf8yk',
      accessToken: 'abc123',
      premium: {
        active: {
          domain: 'myCustomDomain',
        },
      },
    },
    loading: false,
    isEligibleForFreeTrial: true,
  };

const createHandlerProps = {
  onClickCreatePoll: (defaultBehaviour) => {
    alert('Create poll clicked');
    defaultBehaviour();
  },
  onClickCreateOneOnOne: (defaultBehaviour) => {
    alert('Create 1:1 clicked');
    defaultBehaviour();
  },
  onClickCreateSurvey: (defaultBehaviour) => {
    alert('Create survey clicked');
    defaultBehaviour();
  },
  onClickCreateBookableCalendar: (defaultBehaviour) => {
    alert('Create BC clicked');
    defaultBehaviour();
  },
};

<div>
<CreatePollMenuDropdown
    baseUrl="https://staging.doodle-test.com"
    user={user}
    {...createHandlerProps}
  />
</div>;

For a Logged-out user The dropdown menu will not appear and the button navigates to /create

<div>
  <CreatePollMenuDropdown user={null} />
</div>;

Important Note: supplying a baseUrl prop with an absolute URL that begins with http will force all of the menu's URL's to open in a new tab via target="_blank". For relative navigation (the default), there is no need to supply a baseUrl.

Important Note: This component has it's own built-in tracking, but if supply your own click handlers the default tracking will be removed, so you will need to supply your own.