Skip to content

Commit

Permalink
Fixed x-axis scroll ( Scroll Container)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav-Krishna-Gaali committed Aug 16, 2021
1 parent f7075c6 commit 84500aa
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"movie-trailer": "^2.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-indiana-drag-scroll": "^2.0.1",
"react-scripts": "4.0.3",
"react-youtube": "^7.13.1",
"web-vitals": "^1.1.2"
Expand Down
5 changes: 3 additions & 2 deletions src/Row.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from "react";
import axios from "./axios";
import "./Row.css";
import ScrollContainer from "react-indiana-drag-scroll";
import YouTube from "react-youtube";
import movieTrailer from "movie-trailer";
const base_url = "https://image.tmdb.org/t/p/original/";
Expand Down Expand Up @@ -46,7 +47,7 @@ function Row({ title, fetchUrl, isLargeRow }) {
return (
<div className="row">
<h2>{title}</h2>
<div className="row__posters">
<ScrollContainer className="row__posters">
{movies.map((movie) => (
<img
key={movie.id}
Expand All @@ -58,7 +59,7 @@ function Row({ title, fetchUrl, isLargeRow }) {
alt={movie.name}
/>
))}
</div>
</ScrollContainer>
{trailerUrl && <YouTube videoId={trailerUrl} opts={opts} />}
</div>
);
Expand Down

0 comments on commit 84500aa

Please sign in to comment.