({point, align, axis}: SnapPointProps)
| 602 | } |
| 603 | |
| 604 | function SnapPoint({point, align, axis}: SnapPointProps) { |
| 605 | let mainUnit = axis === 'y' ? 'dvh' : 'dvw'; |
| 606 | let offset = toLength(point); |
| 607 | return ( |
| 608 | <div |
| 609 | style={{ |
| 610 | position: 'absolute', |
| 611 | top: axis === 'y' ? offset : 0, |
| 612 | left: axis === 'x' ? offset : 0, |
| 613 | scrollSnapAlign: align, |
| 614 | // A full viewport along the swipe axis so its start/end edge lands at the snap position. |
| 615 | width: axis === 'x' ? `100${mainUnit}` : 1, |
| 616 | height: axis === 'y' ? `100${mainUnit}` : 1 |
| 617 | }} |
| 618 | /> |
| 619 | ); |
| 620 | } |
| 621 | |
| 622 | interface DetentPointProps { |
| 623 | point: number | string; |
nothing calls this directly
no test coverage detected