From 8b54bae6afe07c8f6f959003a27151535ed732ef Mon Sep 17 00:00:00 2001 From: WRadoslaw Date: Fri, 19 Jan 2024 12:26:00 +0100 Subject: [PATCH 01/15] Initial homepage implementation --- .../__generated__/baseTypes.generated.ts | 50 +++- .../__generated__/videos.generated.tsx | 242 +++++++++++++++++- packages/atlas/src/api/queries/videos.graphql | 20 ++ packages/atlas/src/api/schemas/orion.json | 2 +- .../atlas/src/hooks/useInfiniteVideoGrid.ts | 33 ++- .../atlas/src/utils/InteractionsService.ts | 72 ++++++ packages/atlas/src/views/viewer/HomeView.tsx | 42 ++- 7 files changed, 437 insertions(+), 24 deletions(-) create mode 100644 packages/atlas/src/utils/InteractionsService.ts diff --git a/packages/atlas/src/api/queries/__generated__/baseTypes.generated.ts b/packages/atlas/src/api/queries/__generated__/baseTypes.generated.ts index 9286d1f1c3..9417c80838 100644 --- a/packages/atlas/src/api/queries/__generated__/baseTypes.generated.ts +++ b/packages/atlas/src/api/queries/__generated__/baseTypes.generated.ts @@ -5094,7 +5094,7 @@ export type Mutation = { setMaxAttemptsOnMailDelivery: Scalars['Int'] setNewAppRootDomain: AppRootDomain setNewNotificationAssetRoot: SetNewNotificationAssetRootResult - setNewNotificationCenterPath: AppRootDomain + setNewNotificationCenterPath: Scalars['Int'] setSupportedCategories: SetSupportedCategoriesResult setVideoHero: SetVideoHeroResult setVideoViewPerUserTimeLimit: VideoViewPerUserTimeLimit @@ -5102,6 +5102,7 @@ export type Mutation = { signAppActionCommitment: GeneratedSignature suspendChannels: Array unfollowChannel: ChannelUnfollowResult + updateViewPercentage: AddVideoViewResult verifyChannel: VerifyChannelResult } @@ -5250,6 +5251,11 @@ export type MutationUnfollowChannelArgs = { channelId: Scalars['String'] } +export type MutationUpdateViewPercentageArgs = { + percentage: Scalars['Int'] + viewId: Scalars['String'] +} + export type MutationVerifyChannelArgs = { channelIds: Array } @@ -6770,6 +6776,7 @@ export type Query = { gatewayConfigs: Array gatewayConfigsConnection: GatewayConfigsConnection getKillSwitch: KillSwitch + homepageVideos: RecommendedVideosQuery licenseById?: Maybe /** @deprecated Use licenseById */ licenseByUniqueInput?: Maybe @@ -6832,6 +6839,7 @@ export type Query = { sessionEncryptionArtifactsConnection: SessionEncryptionArtifactsConnection sessions: Array sessionsConnection: SessionsConnection + similiarVideos: RecommendedVideosQuery squidStatus?: Maybe storageBagById?: Maybe /** @deprecated Use storageBagById */ @@ -7485,6 +7493,13 @@ export type QueryGatewayConfigsConnectionArgs = { where?: InputMaybe } +export type QueryHomepageVideosArgs = { + limit?: InputMaybe + orderBy?: InputMaybe> + recommId?: InputMaybe + where?: InputMaybe +} + export type QueryLicenseByIdArgs = { id: Scalars['String'] } @@ -7765,6 +7780,14 @@ export type QuerySessionsConnectionArgs = { where?: InputMaybe } +export type QuerySimiliarVideosArgs = { + limit?: InputMaybe + orderBy?: InputMaybe> + recommId?: InputMaybe + videoId?: InputMaybe + where?: InputMaybe +} + export type QueryStorageBagByIdArgs = { id: Scalars['String'] } @@ -8209,6 +8232,13 @@ export type RecipientTypeWhereInput = { membership_isNull?: InputMaybe } +export type RecommendedVideosQuery = { + __typename?: 'RecommendedVideosQuery' + numberNextRecommsCalls?: Maybe + recommId: Scalars['String'] + video: Array