Render fetched shots

This commit is contained in:
2024-01-08 22:14:21 -07:00
parent 376d695416
commit 5192212e0e
6 changed files with 53 additions and 14 deletions

View File

@@ -0,0 +1,14 @@
import { Text, View } from "react-native";
function DisplayShots({ data }) {
const renderShots = (shots) => {
return shots.map((shot) => (
<View key={shot.id}>
<Text>{shot.id}</Text>
</View>
));
};
return renderShots(data);
}
export default DisplayShots;

16
component/shot.tsx Normal file
View File

@@ -0,0 +1,16 @@
import DisplayShots from "./display-shot";
import withQueryHandling from "./with-query-handling";
import { GET_SHOTS } from "../graphql/query";
const ShotsContainer = withQueryHandling({
WrappedComponent: DisplayShots,
query: GET_SHOTS,
dataKey: "getShots",
queryOptions: {
variables: {
includeCueObjectAngle: true,
},
},
});
export default ShotsContainer;