You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PollsPane.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. import React from 'react';
  3. import AbstractPollsPane from '../AbstractPollsPane';
  4. import type { AbstractProps } from '../AbstractPollsPane';
  5. import PollsList from './PollsList';
  6. import { PollCreate } from '.';
  7. const PollsPane = (props: AbstractProps) => {
  8. const { createMode, onCreate, setCreateMode, t } = props;
  9. return createMode
  10. ? <PollCreate setCreateMode = { setCreateMode } />
  11. : <div className = 'polls-pane-content'>
  12. <div className = { 'poll-container' } >
  13. <PollsList />
  14. </div>
  15. <div className = { 'poll-footer' }>
  16. <button
  17. aria-label = { t('polls.create.create') }
  18. className = { 'poll-primary-button' }
  19. // eslint-disable-next-line react/jsx-no-bind
  20. onClick = { onCreate } >
  21. <span>{t('polls.create.create')}</span>
  22. </button>
  23. </div>
  24. </div>;
  25. };
  26. /*
  27. * We apply AbstractPollsPane to fill in the AbstractProps common
  28. * to both the web and native implementations.
  29. */
  30. // eslint-disable-next-line new-cap
  31. export default AbstractPollsPane(PollsPane);