39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import AbstractPollsPane from '../AbstractPollsPane';
|
|
import type { AbstractProps } from '../AbstractPollsPane';
|
|
|
|
import PollCreate from './PollCreate';
|
|
import PollsList from './PollsList';
|
|
|
|
|
|
const PollsPane = (props: AbstractProps) => {
|
|
const { createMode, onCreate, setCreateMode, t } = props;
|
|
|
|
return createMode
|
|
? <PollCreate setCreateMode = { setCreateMode } />
|
|
: <div className = 'polls-pane-content'>
|
|
<div className = { 'poll-container' } >
|
|
<PollsList />
|
|
</div>
|
|
<div className = 'poll-footer poll-create-footer'>
|
|
<button
|
|
aria-label = { t('polls.create.create') }
|
|
className = 'poll-button poll-button-primary'
|
|
// eslint-disable-next-line react/jsx-no-bind
|
|
onClick = { onCreate } >
|
|
<span>{t('polls.create.create')}</span>
|
|
</button>
|
|
</div>
|
|
</div>;
|
|
};
|
|
|
|
/*
|
|
* We apply AbstractPollsPane to fill in the AbstractProps common
|
|
* to both the web and native implementations.
|
|
*/
|
|
// eslint-disable-next-line new-cap
|
|
export default AbstractPollsPane(PollsPane);
|