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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* eslint-disable react-native/no-color-literals */
  2. // @flow
  3. import React from 'react';
  4. import { View } from 'react-native';
  5. import { Button } from 'react-native-paper';
  6. import { BUTTON_MODES } from '../../../chat/constants';
  7. import AbstractPollsPane from '../AbstractPollsPane';
  8. import type { AbstractProps } from '../AbstractPollsPane';
  9. import PollCreate from './PollCreate';
  10. import PollsList from './PollsList';
  11. import { chatStyles } from './styles';
  12. const PollsPane = (props: AbstractProps) => {
  13. const { createMode, onCreate, setCreateMode, t } = props;
  14. return (
  15. <View style = { chatStyles.PollPane }>
  16. { createMode
  17. ? <PollCreate setCreateMode = { setCreateMode } />
  18. : <View style = { chatStyles.PollPaneContent }>
  19. {/* <View /> */}
  20. <PollsList />
  21. <Button
  22. color = '#17a0db'
  23. mode = { BUTTON_MODES.CONTAINED }
  24. onPress = { onCreate }
  25. style = { chatStyles.createPollButton } >
  26. {t('polls.create.create')}
  27. </Button>
  28. </View>}
  29. </View>
  30. );
  31. };
  32. /*
  33. * We apply AbstractPollsPane to fill in the AbstractProps common
  34. * to both the web and native implementations.
  35. */
  36. // eslint-disable-next-line new-cap
  37. export default AbstractPollsPane(PollsPane);