2024-03-27 21:48:48 +03:00
|
|
|
import * as React from "react";
|
|
|
|
|
import { FunctionComponent } from "react";
|
|
|
|
|
import Util from "../../util/Util";
|
|
|
|
|
import PitViewModel from "../../viewmodel/PitViewModel";
|
|
|
|
|
import StoneView from "./StoneView";
|
2024-03-31 16:39:39 +03:00
|
|
|
import { Pressable, View, ViewStyle } from "react-native";
|
2024-03-27 21:48:48 +03:00
|
|
|
|
|
|
|
|
const PitView: FunctionComponent<{
|
|
|
|
|
pitViewModel: PitViewModel;
|
|
|
|
|
onClick: () => void;
|
2024-03-31 16:39:39 +03:00
|
|
|
style: ViewStyle,
|
|
|
|
|
children: React.ReactNode
|
|
|
|
|
}> = ({ pitViewModel, onClick, style, children }) => {
|
2024-03-27 21:48:48 +03:00
|
|
|
return (
|
2024-03-31 16:39:39 +03:00
|
|
|
<View style={[style, {
|
|
|
|
|
backgroundColor: pitViewModel.pitColor,
|
|
|
|
|
borderRadius: 50,
|
|
|
|
|
//justifyItems: 'center',
|
|
|
|
|
}]}>
|
|
|
|
|
<Pressable onPress={onClick} style={{
|
|
|
|
|
width: "100%",
|
|
|
|
|
height: "100%",
|
2024-03-27 21:48:48 +03:00
|
|
|
padding: 5,
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
alignContent: 'center',
|
|
|
|
|
justifyContent: 'center',
|
2024-03-31 16:39:39 +03:00
|
|
|
flexDirection: "row",
|
|
|
|
|
flexWrap: "wrap"
|
2024-03-27 21:48:48 +03:00
|
|
|
}}>
|
2024-03-31 16:39:39 +03:00
|
|
|
{children}
|
|
|
|
|
</Pressable>
|
|
|
|
|
</View>
|
|
|
|
|
|
2024-03-27 21:48:48 +03:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default PitView;
|