Skip to content

Commit

Permalink
Wrap <Slide> w/ <Swipeable>
Browse files Browse the repository at this point in the history
Allow gestures for phone usage.
  • Loading branch information
bchristie authored Feb 7, 2019
1 parent 39d14ab commit 01c8df9
Showing 1 changed file with 7 additions and 1 deletion.
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 01c8df9

Please sign in to comment.