Application Android et IOS pour l'amicale des élèves
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.

CellComponent.js 976B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // @flow
  2. import * as React from 'react';
  3. import {View} from 'react-native';
  4. import {withTheme} from 'react-native-paper';
  5. import type {CustomTheme} from "../../../managers/ThemeManager";
  6. export type Cell = {color: string, isEmpty: boolean, key: string};
  7. type Props = {
  8. cell: Cell,
  9. theme: CustomTheme,
  10. }
  11. class CellComponent extends React.PureComponent<Props> {
  12. render() {
  13. const item = this.props.cell;
  14. return (
  15. <View
  16. style={{
  17. flex: 1,
  18. backgroundColor: item.isEmpty ? 'transparent' : item.color,
  19. borderColor: item.isEmpty ? 'transparent' : this.props.theme.colors.tetrisBorder,
  20. borderStyle: 'solid',
  21. borderRadius: 2,
  22. borderWidth: 1,
  23. aspectRatio: 1,
  24. }}
  25. key={item.key}
  26. />
  27. );
  28. }
  29. }
  30. export default withTheme(CellComponent);