Skip to content

Commit

Permalink
Merge pull request pomber#50 from bchristie/master
Browse files Browse the repository at this point in the history
Enable mobile gesture support
  • Loading branch information
pomber authored Feb 7, 2019
2 parents 2dd038f + 01c8df9 commit 47e29bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-scripts": "2.1.3",
"react-swipeable": "^4.3.2",
"react-use": "^5.2.2"
},
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion src/history.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from "react";
import { getSlides } from "./differ";
import useSpring from "react-use/lib/useSpring";
import Swipeable from "react-swipeable"
import Slide from "./slide";
import "./comment-box.css";

Expand Down Expand Up @@ -109,7 +110,12 @@ export default function History({ commits, language }) {
currentIndex={current}
selectCommit={index => setTarget(index)}
/>
<Slide time={current - index} lines={slideLines[index]} />
<Swipeable
onSwipedLeft={nextSlide}
onSwipedRight={prevSlide}
>
<Slide time={current - index} lines={slideLines[index]} />
</Swipeable>
</React.Fragment>
);
}
Expand Down

0 comments on commit 47e29bd

Please sign in to comment.