This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Grid, Divider as MuiDivider } from "@material-ui/core"; | |
const Divider = ({ children, ...props }) => ( | |
<Grid container alignItems="center" spacing={3} {...props}> | |
<Grid item xs> | |
<MuiDivider /> | |
</Grid> | |
<Grid item>{children}</Grid> | |
<Grid item xs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from 'react'; | |
import { inRange } from 'lodash'; | |
function getSliceStartIndex(activeIndex, total, perSlice) { | |
const sliceStartIndex = activeIndex - Math.floor(perSlice / 2); | |
if (sliceStartIndex < 0) { | |
return 0; | |
} | |
if (sliceStartIndex > total - perSlice) { |