瀏覽代碼

Code Review Fixes

Francesco Baccetti 4 年之前
父節點
當前提交
87c50fd815

+ 41 - 0
packages/app/src/api/queries/__generated__/GetChannel.ts

@@ -7,6 +7,46 @@
 // GraphQL query operation: GetChannel
 // ====================================================
 
+export interface GetChannel_channel_videos_media_location_HTTPVideoMediaLocation {
+  __typename: "HTTPVideoMediaLocation";
+  host: string;
+  port: number | null;
+}
+
+export interface GetChannel_channel_videos_media_location_JoystreamVideoMediaLocation {
+  __typename: "JoystreamVideoMediaLocation";
+  dataObjectID: string;
+}
+
+export type GetChannel_channel_videos_media_location = GetChannel_channel_videos_media_location_HTTPVideoMediaLocation | GetChannel_channel_videos_media_location_JoystreamVideoMediaLocation;
+
+export interface GetChannel_channel_videos_media {
+  __typename: "VideoMedia";
+  pixelHeight: number;
+  pixelWidth: number;
+  location: GetChannel_channel_videos_media_location;
+}
+
+export interface GetChannel_channel_videos_channel {
+  __typename: "Channel";
+  id: string;
+  avatarPhotoURL: string;
+  handle: string;
+}
+
+export interface GetChannel_channel_videos {
+  __typename: "Video";
+  id: string;
+  title: string;
+  description: string;
+  views: number;
+  duration: number;
+  thumbnailURL: string;
+  publishedOnJoystreamAt: GQLDate;
+  media: GetChannel_channel_videos_media;
+  channel: GetChannel_channel_videos_channel;
+}
+
 export interface GetChannel_channel {
   __typename: "Channel";
   id: string;
@@ -14,6 +54,7 @@ export interface GetChannel_channel {
   avatarPhotoURL: string;
   coverPhotoURL: string;
   totalViews: number;
+  videos: GetChannel_channel_videos[] | null;
 }
 
 export interface GetChannel {

+ 0 - 66
packages/app/src/api/queries/__generated__/GetFullChannel.ts

@@ -1,66 +0,0 @@
-/* tslint:disable */
-/* eslint-disable */
-// @generated
-// This file was automatically generated and should not be edited.
-
-// ====================================================
-// GraphQL query operation: GetFullChannel
-// ====================================================
-
-export interface GetFullChannel_channel_videos_media_location_HTTPVideoMediaLocation {
-  __typename: "HTTPVideoMediaLocation";
-  host: string;
-  port: number | null;
-}
-
-export interface GetFullChannel_channel_videos_media_location_JoystreamVideoMediaLocation {
-  __typename: "JoystreamVideoMediaLocation";
-  dataObjectID: string;
-}
-
-export type GetFullChannel_channel_videos_media_location = GetFullChannel_channel_videos_media_location_HTTPVideoMediaLocation | GetFullChannel_channel_videos_media_location_JoystreamVideoMediaLocation;
-
-export interface GetFullChannel_channel_videos_media {
-  __typename: "VideoMedia";
-  pixelHeight: number;
-  pixelWidth: number;
-  location: GetFullChannel_channel_videos_media_location;
-}
-
-export interface GetFullChannel_channel_videos_channel {
-  __typename: "Channel";
-  id: string;
-  avatarPhotoURL: string;
-  handle: string;
-}
-
-export interface GetFullChannel_channel_videos {
-  __typename: "Video";
-  id: string;
-  title: string;
-  description: string;
-  views: number;
-  duration: number;
-  thumbnailURL: string;
-  publishedOnJoystreamAt: GQLDate;
-  media: GetFullChannel_channel_videos_media;
-  channel: GetFullChannel_channel_videos_channel;
-}
-
-export interface GetFullChannel_channel {
-  __typename: "Channel";
-  id: string;
-  handle: string;
-  avatarPhotoURL: string;
-  coverPhotoURL: string;
-  totalViews: number;
-  videos: GetFullChannel_channel_videos[] | null;
-}
-
-export interface GetFullChannel {
-  channel: GetFullChannel_channel | null;
-}
-
-export interface GetFullChannelVariables {
-  id: string;
-}

+ 0 - 8
packages/app/src/api/queries/channels.ts

@@ -23,14 +23,6 @@ export const GET_NEWEST_CHANNELS = gql`
 
 export const GET_CHANNEL = gql`
   query GetChannel($id: ID!) {
-    channel(id: $id) {
-      ...ChannelFields
-    }
-  }
-  ${channelFieldsFragment}
-`
-export const GET_FULL_CHANNEL = gql`
-  query GetFullChannel($id: ID!) {
     channel(id: $id) {
       ...ChannelFields
       videos {

+ 1 - 1
packages/app/src/views/ChannelView/ChannelView.style.tsx

@@ -20,7 +20,7 @@ export const TitleSection = styled.div`
   padding-top: ${theme.sizes.b10}px;
 `
 export const Title = styled.h1`
-  font-size: ${theme.typography.sizes.h2}px;
+  font-size: ${theme.typography.sizes.h2};
   font-weight: bold;
   max-width: 320px;
   display: inline-block;

+ 3 - 3
packages/app/src/views/ChannelView/ChannelView.tsx

@@ -3,8 +3,8 @@ import { RouteComponentProps, useParams, navigate } from '@reach/router'
 import { useQuery } from '@apollo/client'
 
 import routes from '@/config/routes'
-import { GET_FULL_CHANNEL } from '@/api/queries/channels'
-import { GetFullChannel, GetFullChannelVariables } from '@/api/queries/__generated__/GetFullChannel'
+import { GET_CHANNEL } from '@/api/queries/channels'
+import { GetChannel, GetChannelVariables } from '@/api/queries/__generated__/GetChannel'
 import { VideoPreview } from '@/shared/components'
 
 import {
@@ -19,7 +19,7 @@ import {
 
 const ChannelView: React.FC<RouteComponentProps> = () => {
   const { id } = useParams()
-  const { loading, data } = useQuery<GetFullChannel, GetFullChannelVariables>(GET_FULL_CHANNEL, {
+  const { loading, data } = useQuery<GetChannel, GetChannelVariables>(GET_CHANNEL, {
     variables: { id },
   })