Add pull to refresh to video details page

Fixes #169
Fixes #363
This commit is contained in:
Ivan Malison 2024-04-09 20:52:37 +00:00
parent a1581379fd
commit 7d252d3cc8
2 changed files with 164 additions and 0 deletions

View File

@ -705,6 +705,41 @@ export type DeleteVideoMutation = {
deleteVideo: boolean; deleteVideo: boolean;
}; };
export type GetVideoDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type GetVideoDetailsQuery = {
__typename?: "Query";
getVideo: {
__typename?: "VideoGQL";
id: number;
name?: string | null;
averageTimeBetweenShots?: number | null;
elapsedTime?: number | null;
endTime?: any | null;
makePercentage: number;
medianRun?: number | null;
startTime?: any | null;
totalShots: number;
totalShotsMade: number;
createdAt?: any | null;
updatedAt?: any | null;
owner?: {
__typename?: "UserGQL";
id: number;
firebaseUid: string;
username: string;
profileImageUri?: string | null;
} | null;
tags: Array<{
__typename?: "VideoTag";
name: string;
tagClasses: Array<{ __typename?: "VideoTagClass"; name: string }>;
}>;
};
};
export type CreateUploadStreamMutationVariables = Exact<{ export type CreateUploadStreamMutationVariables = Exact<{
videoMetadataInput: VideoMetadataInput; videoMetadataInput: VideoMetadataInput;
}>; }>;
@ -1689,6 +1724,104 @@ export type DeleteVideoMutationOptions = Apollo.BaseMutationOptions<
DeleteVideoMutation, DeleteVideoMutation,
DeleteVideoMutationVariables DeleteVideoMutationVariables
>; >;
export const GetVideoDetailsDocument = gql`
query GetVideoDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
averageTimeBetweenShots
elapsedTime
endTime
makePercentage
makePercentage
medianRun
startTime
totalShots
totalShots
totalShotsMade
createdAt
updatedAt
owner {
id
firebaseUid
username
profileImageUri
}
tags {
tagClasses {
name
}
name
}
}
}
`;
/**
* __useGetVideoDetailsQuery__
*
* To run a query within a React component, call `useGetVideoDetailsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetVideoDetailsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetVideoDetailsQuery({
* variables: {
* videoId: // value for 'videoId'
* },
* });
*/
export function useGetVideoDetailsQuery(
baseOptions: Apollo.QueryHookOptions<
GetVideoDetailsQuery,
GetVideoDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetVideoDetailsQuery, GetVideoDetailsQueryVariables>(
GetVideoDetailsDocument,
options,
);
}
export function useGetVideoDetailsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetVideoDetailsQuery,
GetVideoDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetVideoDetailsQuery,
GetVideoDetailsQueryVariables
>(GetVideoDetailsDocument, options);
}
export function useGetVideoDetailsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetVideoDetailsQuery,
GetVideoDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetVideoDetailsQuery,
GetVideoDetailsQueryVariables
>(GetVideoDetailsDocument, options);
}
export type GetVideoDetailsQueryHookResult = ReturnType<
typeof useGetVideoDetailsQuery
>;
export type GetVideoDetailsLazyQueryHookResult = ReturnType<
typeof useGetVideoDetailsLazyQuery
>;
export type GetVideoDetailsSuspenseQueryHookResult = ReturnType<
typeof useGetVideoDetailsSuspenseQuery
>;
export type GetVideoDetailsQueryResult = Apollo.QueryResult<
GetVideoDetailsQuery,
GetVideoDetailsQueryVariables
>;
export const CreateUploadStreamDocument = gql` export const CreateUploadStreamDocument = gql`
mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) { mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) {
createUploadStream(videoMetadata: $videoMetadataInput) { createUploadStream(videoMetadata: $videoMetadataInput) {

View File

@ -71,3 +71,34 @@ query GetVideoUpdatePageDetails($videoId: Int!) {
mutation DeleteVideo($videoId: Int!) { mutation DeleteVideo($videoId: Int!) {
deleteVideo(videoId: $videoId) deleteVideo(videoId: $videoId)
} }
query GetVideoDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
averageTimeBetweenShots
elapsedTime
endTime
makePercentage
makePercentage
medianRun
startTime
totalShots
totalShots
totalShotsMade
createdAt
updatedAt
owner {
id
firebaseUid
username
profileImageUri
}
tags {
tagClasses {
name
}
name
}
}
}