Parcourir la source

remove new & noteworthy page (#4100)

Bartosz Dryl il y a 1 an
Parent
commit
09a0d79022

+ 0 - 21
packages/atlas/src/api/hooks/channel.ts

@@ -14,8 +14,6 @@ import {
   GetExtendedFullChannelsQueryVariables,
   GetPopularChannelsQuery,
   GetPopularChannelsQueryVariables,
-  GetPromisingChannelsQuery,
-  GetPromisingChannelsQueryVariables,
   GetTop10ChannelsQuery,
   GetTop10ChannelsQueryVariables,
   UnfollowChannelMutation,
@@ -25,7 +23,6 @@ import {
   useGetExtendedBasicChannelsQuery,
   useGetExtendedFullChannelsQuery,
   useGetPopularChannelsQuery,
-  useGetPromisingChannelsQuery,
   useGetTop10ChannelsQuery,
   useUnfollowChannelMutation,
 } from '@/api/queries/__generated__/channels.generated'
@@ -193,24 +190,6 @@ export const useDiscoverChannels = (
   }
 }
 
-export const usePromisingChannels = (
-  variables?: GetPromisingChannelsQueryVariables,
-  opts?: QueryHookOptions<GetPromisingChannelsQuery, GetPromisingChannelsQueryVariables>
-) => {
-  const { data, ...rest } = useGetPromisingChannelsQuery({
-    ...opts,
-    variables,
-  })
-
-  const shuffledChannels = useShuffleResults<GetDiscoverChannelsQuery['mostRecentChannels'][number]>(
-    data?.mostRecentChannels
-  )
-  return {
-    extendedChannels: shuffledChannels,
-    ...rest,
-  }
-}
-
 export const usePopularChannels = (
   variables?: GetPopularChannelsQueryVariables,
   opts?: QueryHookOptions<GetPopularChannelsQuery, GetPopularChannelsQueryVariables>

+ 0 - 91
packages/atlas/src/api/queries/__generated__/channels.generated.tsx

@@ -359,46 +359,6 @@ export type GetTop10ChannelsQuery = {
   }>
 }
 
-export type GetPromisingChannelsQueryVariables = Types.Exact<{
-  where?: Types.InputMaybe<Types.ExtendedChannelWhereInput>
-}>
-
-export type GetPromisingChannelsQuery = {
-  __typename?: 'Query'
-  mostRecentChannels: Array<{
-    __typename?: 'ExtendedChannel'
-    channel: {
-      __typename?: 'Channel'
-      id: string
-      title?: string | null
-      description?: string | null
-      createdAt: Date
-      followsNum: number
-      rewardAccount: string
-      channelStateBloatBond: string
-      avatarPhoto?: {
-        __typename?: 'StorageDataObject'
-        id: string
-        resolvedUrls: Array<string>
-        resolvedUrl?: string | null
-        createdAt: Date
-        size: string
-        isAccepted: boolean
-        ipfsHash: string
-        storageBag: { __typename?: 'StorageBag'; id: string }
-        type?:
-          | { __typename: 'DataObjectTypeChannelAvatar' }
-          | { __typename: 'DataObjectTypeChannelCoverPhoto' }
-          | { __typename: 'DataObjectTypeChannelPayoutsPayload' }
-          | { __typename: 'DataObjectTypeVideoMedia' }
-          | { __typename: 'DataObjectTypeVideoSubtitle' }
-          | { __typename: 'DataObjectTypeVideoThumbnail' }
-          | null
-      } | null
-    }
-  }>
-}
-
 export type GetDiscoverChannelsQueryVariables = Types.Exact<{
   where?: Types.InputMaybe<Types.ExtendedChannelWhereInput>
 }>
@@ -1045,57 +1005,6 @@ export function useGetTop10ChannelsLazyQuery(
 export type GetTop10ChannelsQueryHookResult = ReturnType<typeof useGetTop10ChannelsQuery>
 export type GetTop10ChannelsLazyQueryHookResult = ReturnType<typeof useGetTop10ChannelsLazyQuery>
 export type GetTop10ChannelsQueryResult = Apollo.QueryResult<GetTop10ChannelsQuery, GetTop10ChannelsQueryVariables>
-export const GetPromisingChannelsDocument = gql`
-  query GetPromisingChannels($where: ExtendedChannelWhereInput) {
-    mostRecentChannels(where: $where, orderBy: videoViewsNum_DESC, mostRecentLimit: 100, resultsLimit: 15) {
-      channel {
-        ...BasicChannelFields
-      }
-    }
-  }
-  ${BasicChannelFieldsFragmentDoc}
-`
-
-/**
- * __useGetPromisingChannelsQuery__
- *
- * To run a query within a React component, call `useGetPromisingChannelsQuery` and pass it any options that fit your needs.
- * When your component renders, `useGetPromisingChannelsQuery` 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 } = useGetPromisingChannelsQuery({
- *   variables: {
- *      where: // value for 'where'
- *   },
- * });
- */
-export function useGetPromisingChannelsQuery(
-  baseOptions?: Apollo.QueryHookOptions<GetPromisingChannelsQuery, GetPromisingChannelsQueryVariables>
-) {
-  const options = { ...defaultOptions, ...baseOptions }
-  return Apollo.useQuery<GetPromisingChannelsQuery, GetPromisingChannelsQueryVariables>(
-    GetPromisingChannelsDocument,
-    options
-  )
-}
-export function useGetPromisingChannelsLazyQuery(
-  baseOptions?: Apollo.LazyQueryHookOptions<GetPromisingChannelsQuery, GetPromisingChannelsQueryVariables>
-) {
-  const options = { ...defaultOptions, ...baseOptions }
-  return Apollo.useLazyQuery<GetPromisingChannelsQuery, GetPromisingChannelsQueryVariables>(
-    GetPromisingChannelsDocument,
-    options
-  )
-}
-export type GetPromisingChannelsQueryHookResult = ReturnType<typeof useGetPromisingChannelsQuery>
-export type GetPromisingChannelsLazyQueryHookResult = ReturnType<typeof useGetPromisingChannelsLazyQuery>
-export type GetPromisingChannelsQueryResult = Apollo.QueryResult<
-  GetPromisingChannelsQuery,
-  GetPromisingChannelsQueryVariables
->
 export const GetDiscoverChannelsDocument = gql`
   query GetDiscoverChannels($where: ExtendedChannelWhereInput) {
     mostRecentChannels(where: $where, orderBy: followsNum_DESC, mostRecentLimit: 100, resultsLimit: 15) {

+ 0 - 9
packages/atlas/src/api/queries/channels.graphql

@@ -81,15 +81,6 @@ query GetTop10Channels($where: ExtendedChannelWhereInput) {
   }
 }
 
-query GetPromisingChannels($where: ExtendedChannelWhereInput) {
-  # CHANGE: Replacement for overly-specific `promisingChannels` query
-  mostRecentChannels(where: $where, orderBy: videoViewsNum_DESC, mostRecentLimit: 100, resultsLimit: 15) {
-    channel {
-      ...BasicChannelFields
-    }
-  }
-}
-
 query GetDiscoverChannels($where: ExtendedChannelWhereInput) {
   # CHANGE: Replacement for overly-specific `discoverChannels` query
   mostRecentChannels(where: $where, orderBy: followsNum_DESC, mostRecentLimit: 100, resultsLimit: 15) {

+ 0 - 7
packages/atlas/src/components/_buttons/CallToActionButton/CallToActionButton.tsx

@@ -6,7 +6,6 @@ import {
   SvgActionNewTab,
   SvgSidebarExplore,
   SvgSidebarHome,
-  SvgSidebarNew,
   SvgSidebarPopular,
 } from '@/assets/icons'
 import { atlasConfig } from '@/config'
@@ -57,12 +56,6 @@ export const CTA_MAP: Record<string, CallToActionButtonProps> = {
     colorVariant: 'yellow',
     icon: <SvgSidebarHome />,
   },
-  new: {
-    label: 'New & Noteworthy',
-    to: absoluteRoutes.viewer.new(),
-    colorVariant: 'green',
-    icon: <SvgSidebarNew />,
-  },
   popular: {
     label: `Popular on ${atlasConfig.general.appName}`,
     to: absoluteRoutes.viewer.popular(),

+ 2 - 16
packages/atlas/src/components/_channel/ExpandableChannelsList/ExpandableChannelsList.tsx

@@ -1,7 +1,7 @@
 import { QueryHookOptions } from '@apollo/client'
 import { FC, Fragment, useState } from 'react'
 
-import { useBasicChannels, useDiscoverChannels, usePopularChannels, usePromisingChannels } from '@/api/hooks/channel'
+import { useBasicChannels, useDiscoverChannels, usePopularChannels } from '@/api/hooks/channel'
 import { ChannelOrderByInput } from '@/api/queries/__generated__/baseTypes.generated'
 import { SvgActionChevronR } from '@/assets/icons'
 import { EmptyFallback } from '@/components/EmptyFallback'
@@ -22,7 +22,7 @@ import {
   Separator,
 } from './ExpandableChannelsList.styles'
 
-type ChannelsQueryType = 'discover' | 'promising' | 'popular' | 'regular'
+type ChannelsQueryType = 'discover' | 'popular' | 'regular'
 
 type ExpandableChannelsListProps = {
   queryType: ChannelsQueryType
@@ -166,18 +166,6 @@ const useChannelsListData = (queryType: ChannelsQueryType, selectedLanguage: str
     { ...commonOpts, skip: queryType !== 'popular' }
   )
 
-  const promising = usePromisingChannels(
-    {
-      where: {
-        activeVideosCount_gt: activeVideosCountGt,
-        channel: {
-          ...publicChannelFilter,
-          videoViewsNum_gt: 0,
-        },
-      },
-    },
-    { ...commonOpts, skip: queryType !== 'promising' }
-  )
   // regular channels query needs explicit limit and sorting as it's not defined by Orion
   const regular = useBasicChannels(
     {
@@ -198,8 +186,6 @@ const useChannelsListData = (queryType: ChannelsQueryType, selectedLanguage: str
     return discover
   } else if (queryType === 'popular') {
     return popular
-  } else if (queryType === 'promising') {
-    return promising
   } else {
     return regular
   }

+ 0 - 8
packages/atlas/src/components/_navigation/SidenavViewer/SidenavViewer.tsx

@@ -6,7 +6,6 @@ import {
   SvgSidebarExplore,
   SvgSidebarHome,
   SvgSidebarMarketplace,
-  SvgSidebarNew,
   SvgSidebarPopular,
   SvgSidebarYpp,
 } from '@/assets/icons'
@@ -43,13 +42,6 @@ export const viewerNavItems = [
     to: absoluteRoutes.viewer.nfts(),
     bottomNav: true,
   },
-  {
-    icon: <SvgSidebarNew />,
-    expandedName: 'New & Noteworthy',
-    name: 'New',
-    to: absoluteRoutes.viewer.new(),
-    bottomNav: true,
-  },
   {
     icon: <SvgSidebarExplore />,
     name: 'Discover',

+ 0 - 1
packages/atlas/src/config/routes.ts

@@ -22,7 +22,6 @@ export const relativeRoutes = {
   },
   viewer: {
     index: () => '',
-    new: () => 'new',
     discover: () => 'discover',
     popular: () => 'popular',
     category: (id = ':id') => `category/${id}`,

+ 1 - 1
packages/atlas/src/types/cta.ts

@@ -1 +1 @@
-export type CtaData = 'home' | 'new' | 'channels' | 'popular'
+export type CtaData = 'home' | 'channels' | 'popular'

+ 1 - 1
packages/atlas/src/views/viewer/CategoryView/CategoryView.tsx

@@ -49,7 +49,7 @@ export const CategoryView = () => {
   const videoHeroVideos = useVideoHeroVideos(categoriesFeaturedVideos)
 
   return (
-    <VideoContentTemplate cta={['popular', 'new', 'home']}>
+    <VideoContentTemplate>
       {headTags}
       <VideoCategoryHero
         loading={categoriesFeaturedVideosLoading}

+ 1 - 1
packages/atlas/src/views/viewer/ChannelsView/ChannelsView.tsx

@@ -19,7 +19,7 @@ export const ChannelsView: FC = () => {
   return (
     <>
       {headTags}
-      <VideoContentTemplate title="Browse channels" cta={['popular', 'new', 'home']}>
+      <VideoContentTemplate title="Browse channels">
         {!error ? <ChannelGallery hasRanking channels={channels} loading={loading} title="Top 10 channels" /> : null}
         <DiscoverChannels />
         <ExpandableChannelsList queryType="regular" title="Channels in your language" languageSelector />

+ 1 - 1
packages/atlas/src/views/viewer/HomeView.tsx

@@ -53,7 +53,7 @@ export const HomeView: FC = () => {
   }
 
   return (
-    <VideoContentTemplate cta={['popular', 'new']}>
+    <VideoContentTemplate>
       {headTags}
       <VideoHero videoHeroData={videoHero} withMuteButton loading={loading} />
       <Container className={transitions.names.slide}>

+ 0 - 23
packages/atlas/src/views/viewer/NewView/NewView.tsx

@@ -1,23 +0,0 @@
-import { FC } from 'react'
-
-import { InfiniteVideoGrid } from '@/components/InfiniteGrids'
-import { ExpandableChannelsList } from '@/components/_channel/ExpandableChannelsList'
-import { VideoContentTemplate } from '@/components/_templates/VideoContentTemplate'
-import { absoluteRoutes } from '@/config/routes'
-import { useHeadTags } from '@/hooks/useHeadTags'
-
-export const NewView: FC = () => {
-  const headTags = useHeadTags('New & Noteworthy')
-
-  return (
-    <VideoContentTemplate title="New & Noteworthy" cta={['home', 'popular']}>
-      {headTags}
-      <InfiniteVideoGrid title="Recently uploaded" onDemand />
-      <ExpandableChannelsList
-        title="Promising new channels"
-        queryType="promising"
-        additionalLink={{ name: 'Browse channels', url: absoluteRoutes.viewer.channels() }}
-      />
-    </VideoContentTemplate>
-  )
-}

+ 0 - 1
packages/atlas/src/views/viewer/NewView/index.ts

@@ -1 +0,0 @@
-export * from './NewView'

+ 1 - 3
packages/atlas/src/views/viewer/PopularView/PopularView.tsx

@@ -8,16 +8,14 @@ import { VideoContentTemplate } from '@/components/_templates/VideoContentTempla
 import { atlasConfig } from '@/config'
 import { absoluteRoutes } from '@/config/routes'
 import { useHeadTags } from '@/hooks/useHeadTags'
-import { CtaData } from '@/types/cta'
 
-const CTA: CtaData[] = ['new', 'home']
 const ADDITIONAL_LINK = { name: 'Browse channels', url: absoluteRoutes.viewer.channels() }
 
 export const PopularView: FC = () => {
   const headTags = useHeadTags('Popular')
 
   return (
-    <VideoContentTemplate title={`Popular on ${atlasConfig.general.appName}`} cta={CTA}>
+    <VideoContentTemplate title={`Popular on ${atlasConfig.general.appName}`}>
       {headTags}
       <TopTenVideos period="month" />
       <InfiniteVideoGrid title="Popular videos" query={GetMostViewedVideosConnectionDocument} limit={50} onDemand />

+ 2 - 2
packages/atlas/src/views/viewer/VideoView/VideoView.tsx

@@ -434,8 +434,8 @@ export const VideoView: FC = () => {
             {sideItems}
           </LayoutGrid>
         )}
-        <StyledCallToActionWrapper itemsCount={3}>
-          {['popular', 'new', 'discover'].map((item, idx) => (
+        <StyledCallToActionWrapper itemsCount={2}>
+          {['popular', 'discover'].map((item, idx) => (
             <CallToActionButton key={`cta-${idx}`} {...CTA_MAP[item]} />
           ))}
         </StyledCallToActionWrapper>

+ 0 - 2
packages/atlas/src/views/viewer/ViewerLayout.tsx

@@ -26,7 +26,6 @@ import { DiscoverView } from './DiscoverView'
 import { EditMembershipView } from './EditMembershipView'
 import { HomeView } from './HomeView'
 import { MemberView } from './MemberView'
-import { NewView } from './NewView'
 import { NftsView } from './NftsView'
 import { NotFoundView } from './NotFoundView'
 import { PopularView } from './PopularView'
@@ -37,7 +36,6 @@ const viewerRoutes = [
   { path: relativeRoutes.viewer.search(), element: <SearchView /> },
   { path: relativeRoutes.viewer.index(), element: <HomeView /> },
   { path: relativeRoutes.viewer.popular(), element: <PopularView /> },
-  { path: relativeRoutes.viewer.new(), element: <NewView /> },
   { path: relativeRoutes.viewer.discover(), element: <DiscoverView /> },
   { path: relativeRoutes.viewer.video(), element: <VideoView /> },
   { path: relativeRoutes.viewer.channels(), element: <ChannelsView /> },