Francesco Baccetti пре 4 година
родитељ
комит
703d8807d8

+ 0 - 4
src/components/VideoGrid.tsx

@@ -1,8 +1,6 @@
 import React from 'react'
 import styled from '@emotion/styled'
-import { navigate } from '@reach/router'
 
-import routes from '@/config/routes'
 import { VideoFields } from '@/api/queries/__generated__/VideoFields'
 import { Grid } from '@/shared/components'
 import VideoPreview from './VideoPreviewWithNavigation'
@@ -25,12 +23,10 @@ const VideoGrid: React.FC<VideoGridProps> = ({ videos }) => {
           title={v.title}
           channelName={v.channel.handle}
           channelAvatarURL={v.channel.avatarPhotoURL}
-          onChannelClick={() => navigate(routes.channel(v.channel.id))}
           createdAt={v.publishedOnJoystreamAt}
           duration={v.duration}
           views={v.views}
           posterURL={v.thumbnailURL}
-          onClick={() => navigate(routes.video(v.id))}
         />
       ))}
     </Grid>

+ 1 - 5
src/shared/components/InfiniteVideoGrid/InfiniteVideoGrid.tsx

@@ -17,7 +17,6 @@ type InfiniteVideoGridProps = {
   ready?: boolean
   className?: string
 }
-console.log(Grid)
 
 const INITIAL_ROWS = 4
 const INITIAL_VIDEOS_PER_ROW = 4
@@ -142,7 +141,7 @@ const InfiniteVideoGrid: React.FC<InfiniteVideoGridProps> = ({
   return (
     <section className={className}>
       {title && <Title>{title}</Title>}
-      <StyledGrid onResize={(sizes) => setVideosPerRow(sizes.length)}>{gridContent}</StyledGrid>
+      <Grid onResize={(sizes) => setVideosPerRow(sizes.length)}>{gridContent}</Grid>
     </section>
   )
 }
@@ -161,8 +160,5 @@ const StyledVideoPreviewBase = styled(VideoPreviewBase)`
   margin: 0 auto;
   width: 100%;
 `
-const StyledGrid = styled(Grid)`
-  padding-top: ${sizes.b2}px;
-`
 
 export default InfiniteVideoGrid

+ 4 - 2
src/views/BrowseView.tsx

@@ -28,7 +28,7 @@ const BrowseView: React.FC<RouteComponentProps> = () => {
         selectedCategoryId={selectedCategoryId}
         onChange={handleCategoryChange}
       />
-      <InfiniteVideoGrid categoryId={selectedCategoryId || undefined} ready={!!selectedCategoryId} />
+      <StyledInfiniteVideoGrid categoryId={selectedCategoryId || undefined} ready={!!selectedCategoryId} />
     </div>
   )
 }
@@ -45,5 +45,7 @@ const StyledCategoryPicker = styled(CategoryPicker)`
   padding-bottom: ${sizes.b2}px;
   background-color: ${colors.black};
 `
-
+const StyledInfiniteVideoGrid = styled(InfiniteVideoGrid)`
+  padding-top: ${sizes.b2}px;
+`
 export default BrowseView