re-implemented horizontal scroll for the bins list with a new package
This commit is contained in:
parent
8df5b5e602
commit
d4bd6941d4
4 changed files with 119 additions and 17 deletions
|
|
@ -192,11 +192,11 @@ export default function Bins(props: Props) {
|
|||
// const history = useHistory();
|
||||
const navigate = useNavigate()
|
||||
const [cardValDisplay, setCardValDisplay] = useState<"high" | "low" | "average">("average");
|
||||
const [scrollTranslations, setScrollTranslations] = useState({
|
||||
bins: 0,
|
||||
empty: 0,
|
||||
fertilizer: 0
|
||||
});
|
||||
// const [scrollTranslations, setScrollTranslations] = useState({
|
||||
// bins: 0,
|
||||
// empty: 0,
|
||||
// fertilizer: 0
|
||||
// });
|
||||
|
||||
// const StyledToggleButtonGroup = withStyles(theme => ({
|
||||
// grouped: {
|
||||
|
|
@ -621,11 +621,10 @@ export default function Bins(props: Props) {
|
|||
bins={grainBins}
|
||||
duplicateBin={duplicateBin}
|
||||
title={"Grain Bins"}
|
||||
startingTranslate={scrollTranslations.bins}
|
||||
loadMore={newTranslation => {
|
||||
//startingTranslate={scrollTranslations.bins}
|
||||
loadMore={() => {
|
||||
if (paginatedBins.bins.length < paginatedBins.binsTotal) {
|
||||
loadMoreBins(contentFilter, paginatedBins.binsOffset);
|
||||
setScrollTranslations({ ...scrollTranslations, bins: newTranslation });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue