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.

BaseIndicator.js 950B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { View } from 'react-native';
  4. import { Icon } from '../../../base/font-icons';
  5. import styles from './styles';
  6. type Props = {
  7. /**
  8. * True if a highlighted background has to be applied.
  9. */
  10. highlight: boolean,
  11. /**
  12. * The name of the icon to be used as the indicator.
  13. */
  14. icon: string
  15. };
  16. /**
  17. * Implements a base indicator to be reused across all native indicators on
  18. * the filmstrip.
  19. */
  20. export default class BaseIndicator extends Component<Props> {
  21. /**
  22. * Implements React's {@link Component#render()}.
  23. *
  24. * @inheritdoc
  25. */
  26. render() {
  27. const { highlight, icon } = this.props;
  28. return (
  29. <View style = { highlight ? styles.highlightedIndicator : null }>
  30. <Icon
  31. name = { icon }
  32. style = { styles.indicator } />
  33. </View>
  34. );
  35. }
  36. }