Przeglądaj źródła

Content pages minor fixes (#1192)

* minor adjustments

* fix env
Bartosz Dryl 3 lat temu
rodzic
commit
060ccbd173

+ 3 - 3
.env

@@ -8,7 +8,7 @@ REACT_APP_DEVELOPMENT_QUERY_NODE_SUBSCRIPTION_URL=wss://sumer-dev-2.joystream.ap
 REACT_APP_DEVELOPMENT_ORION_URL=https://sumer-dev-2.joystream.app/orion/graphql
 REACT_APP_DEVELOPMENT_NODE_URL=wss://sumer-dev-2.joystream.app/rpc
 REACT_APP_DEVELOPMENT_FAUCET_URL=https://sumer-dev-2.joystream.app/members/register
-REACT_APP_DEVELOPMENT_OFFICIAL_JOYSTREAM_CHANNEL=12
+REACT_APP_DEVELOPMENT_OFFICIAL_JOYSTREAM_CHANNEL_ID=12
 
 REACT_APP_PRODUCTION_QUERY_NODE_URL=https://hydra.joystream.org/graphql
 REACT_APP_PRODUCTION_QUERY_NODE_SUBSCRIPTION_URL=wss://hydra.joystream.org/graphql
@@ -16,11 +16,11 @@ REACT_APP_PRODUCTION_ORION_URL=https://orion.joystream.org/graphql
 REACT_APP_PRODUCTION_ASSET_LOGS_URL=https://orion.joystream.org/logs
 REACT_APP_PRODUCTION_NODE_URL=wss://rome-rpc-endpoint.joystream.org:9944/
 REACT_APP_PRODUCTION_FAUCET_URL=https://member-faucet.joystream.org/register
-REACT_APP_PRODUCTION_OFFICIAL_JOYSTREAM_CHANNEL=3
+REACT_APP_PRODUCTION_OFFICIAL_JOYSTREAM_CHANNEL_ID=3
 
 REACT_APP_MOCKING_QUERY_NODE_URL=/mocked-query-node
 REACT_APP_MOCKING_QUERY_NODE_SUBSCRIPTION_URL=ws://127.0.0.1:9955
 REACT_APP_MOCKING_ORION_URL=/mocked-orion
 REACT_APP_MOCKING_NODE_URL=ws://127.0.0.1:9944
 REACT_APP_MOCKING_FAUCET_URL=/mocked-faucet
-REACT_APP_MOCKING_OFFICIAL_JOYSTREAM_CHANNEL=1
+REACT_APP_MOCKING_OFFICIAL_JOYSTREAM_CHANNEL_ID=1

+ 1 - 7
src/api/hooks/video.ts

@@ -1,5 +1,4 @@
 import { MutationHookOptions, QueryHookOptions } from '@apollo/client'
-import { useMemo } from 'react'
 
 import {
   AddVideoViewMutation,
@@ -84,12 +83,7 @@ export const useMostViewedVideosIds = (variables?: GetMostViewedVideosQueryVaria
 export const useMostViewedVideos = (variables?: GetMostViewedVideosQueryVariables, opts?: MostViewedVideosOpts) => {
   const { mostViewedVideos } = useMostViewedVideosIds(variables, opts)
 
-  const mostViewedVideosIds = useMemo(() => {
-    if (mostViewedVideos) {
-      return mostViewedVideos.map((item) => item.id)
-    }
-    return null
-  }, [mostViewedVideos])
+  const mostViewedVideosIds = mostViewedVideos?.map((item) => item.id)
 
   const { videos, ...rest } = useVideos(
     {

+ 1 - 1
src/components/OfficialJoystreamUpdate.tsx

@@ -4,7 +4,7 @@ import { useVideos } from '@/api/hooks'
 import { VideoGallery } from '@/components'
 import { readEnv } from '@/config/envs'
 
-const channelId = readEnv('OFFICIAL_JOYSTREAM_CHANNEL')
+const channelId = readEnv('OFFICIAL_JOYSTREAM_CHANNEL_ID')
 const MAX_VIDEOS = 10
 
 export const OfficialJoystreamUpdate = () => {

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

@@ -7,7 +7,7 @@ import { CallToActionButton, CallToActionWrapper, Text } from '@/shared/componen
 import { SvgNavHome, SvgNavNew, SvgNavPopular } from '@/shared/icons'
 import { sizes } from '@/shared/theme'
 
-export const ChannelsView = () => {
+export const ChannelsView: React.FC = () => {
   return (
     <StyledViewWrapper>
       <Header variant="h2">Browse channels</Header>