mancala/mobile/src/components/board/PitView.tsx

38 lines
1.1 KiB
TypeScript
Raw Normal View History

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";
const PitView: FunctionComponent<{
pitViewModel: PitViewModel;
onClick: () => void;
2024-03-31 16:39:39 +03:00
style: ViewStyle,
children: React.ReactNode
}> = ({ pitViewModel, onClick, style, children }) => {
return (
2024-03-31 16:39:39 +03:00
<View style={[style, {
backgroundColor: pitViewModel.pitColor,
2024-03-31 21:38:28 +03:00
borderRadius: 100,
2024-03-31 16:39:39 +03:00
//justifyItems: 'center',
}]}>
<Pressable onPress={onClick} style={{
width: "100%",
height: "100%",
padding: 5,
display: 'flex',
alignItems: 'center',
alignContent: 'center',
justifyContent: 'center',
2024-03-31 16:39:39 +03:00
flexDirection: "row",
flexWrap: "wrap"
}}>
2024-03-31 16:39:39 +03:00
{children}
</Pressable>
</View>
);
};
export default PitView;