application-amicale/screens/Tetris/components/Cell.js

41 lines
810 B
JavaScript
Raw Normal View History

2020-03-15 18:44:32 +01:00
// @flow
import * as React from 'react';
import {View} from 'react-native';
import {withTheme} from 'react-native-paper';
2020-03-15 20:18:48 +01:00
type Props = {
color: string,
isEmpty: boolean,
id: string,
}
class Cell extends React.PureComponent<Props> {
colors: Object;
constructor(props) {
super(props);
this.colors = props.theme.colors;
}
render() {
return (
<View
style={{
flex: 1,
backgroundColor: this.props.color,
borderColor: this.props.isEmpty ? this.props.color : "#393939",
borderStyle: 'solid',
borderWidth: 1,
aspectRatio: 1,
}}
/>
);
}
2020-03-15 18:44:32 +01:00
}
export default withTheme(Cell);