mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-15 14:58:35 +03:00
33 lines
762 B
JavaScript
33 lines
762 B
JavaScript
import React from "react";
|
|
import Card from "./Card";
|
|
import Adjust from "./Adjust";
|
|
import Close from "./Close";
|
|
|
|
export default ({ narrative, methods }) => {
|
|
if (!narrative) return null;
|
|
|
|
const { current, steps } = narrative;
|
|
const prevExists = current !== 0;
|
|
const nextExists = current < steps.length - 1;
|
|
|
|
return (
|
|
<>
|
|
<Card narrative={narrative} />
|
|
<Adjust
|
|
isDisabled={!prevExists}
|
|
direction="left"
|
|
onClickHandler={methods.onPrev}
|
|
/>
|
|
<Adjust
|
|
isDisabled={!nextExists}
|
|
direction="right"
|
|
onClickHandler={methods.onNext}
|
|
/>
|
|
<Close
|
|
onClickHandler={() => methods.onSelectNarrative(null)}
|
|
closeMsg="-- exit from narrative --"
|
|
/>
|
|
</>
|
|
);
|
|
};
|