浏览代码

hide channel info of video preview in channel context

Klaudiusz Dembler 4 年之前
父节点
当前提交
08ff469f8a
共有 3 个文件被更改,包括 5 次插入3 次删除
  1. 3 1
      src/components/VideoGrid.tsx
  2. 1 1
      src/views/ChannelView/ChannelView.tsx
  3. 1 1
      src/views/VideoView/VideoView.tsx

+ 3 - 1
src/components/VideoGrid.tsx

@@ -11,8 +11,9 @@ const StyledVideoPreview = styled(VideoPreview)`
 
 type VideoGridProps = {
   videos: VideoFields[]
+  showChannel?: boolean
 }
-const VideoGrid: React.FC<VideoGridProps> = ({ videos }) => {
+const VideoGrid: React.FC<VideoGridProps> = ({ videos, showChannel = true }) => {
   return (
     <Grid>
       {videos.map((v, idx) => (
@@ -27,6 +28,7 @@ const VideoGrid: React.FC<VideoGridProps> = ({ videos }) => {
           duration={v.duration}
           views={v.views}
           posterURL={v.thumbnailURL}
+          showChannel={showChannel}
         />
       ))}
     </Grid>

+ 1 - 1
src/views/ChannelView/ChannelView.tsx

@@ -29,7 +29,7 @@ const ChannelView: React.FC<RouteComponentProps> = () => {
       </Header>
       {videos.length > 0 && (
         <VideoSection>
-          <VideoGrid videos={videos} />
+          <VideoGrid videos={videos} showChannel={false} />
         </VideoSection>
       )}
     </div>

+ 1 - 1
src/views/VideoView/VideoView.tsx

@@ -86,7 +86,7 @@ const VideoView: React.FC<RouteComponentProps> = () => {
         </DescriptionContainer>
         <MoreVideosContainer>
           <MoreVideosHeader>More from {channel.handle}</MoreVideosHeader>
-          <VideoGrid videos={channel.videos} />
+          <VideoGrid videos={channel.videos} showChannel={false} />
         </MoreVideosContainer>
       </InfoContainer>
     </Container>