diff --git a/src/BottomSheet.tsx b/src/BottomSheet.tsx index 6fe2f9b..53f0dd9 100644 --- a/src/BottomSheet.tsx +++ b/src/BottomSheet.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useRef } from 'react'; -import { a, useSpring, config, interpolate } from 'react-spring'; +import { a, useSpring, config } from 'react-spring'; import { useDrag } from 'react-use-gesture'; import useMeasure from 'react-use-measure'; import { ResizeObserver } from '@juggle/resize-observer'; @@ -68,7 +68,7 @@ export const BottomSheet: React.FC = props => { right: 0, top: 0, zIndex: 1198, - backgroundColor: 'rgba(0,0,0,0.2)', + backgroundColor: 'rgba(0,0,0,0.3)', }, background: { position: 'fixed' as React.CSSProperties['position'], @@ -78,7 +78,7 @@ export const BottomSheet: React.FC = props => { width: '100%', }, root: { - background: '#eee', + background: '#fff', boxShadow: '0 -10px 20px rgba(0,0,0,0.3)', width: '100%', minHeight: defaultHeight, @@ -208,11 +208,7 @@ export const BottomSheet: React.FC = props => { .find(n => n !== defaultPosition && n < defaultPosition); const backdropStyle = { /** backdrop should only begin to fade in after first stop */ - opacity: y.to( - [backdropActiveAt as number, defaultPosition], - [1, 0], - 'clamp' - ), + opacity: y.to([backdropActiveAt as number, defaultPosition], [1, 0]), /** Set display none when backdrop isn't show so you can interact with the page */ display: y.to(py => (py < defaultPosition && backdrop ? 'block' : 'none')), }; @@ -226,7 +222,7 @@ export const BottomSheet: React.FC = props => { y: y.to( [...stops].reverse(), stops.map((_stop, i, arr) => - i === arr.length - 1 || i === arr.length - 2 ? defaultPosition : 0 + i === arr.length - 1 || i === arr.length - 2 ? window.innerHeight : 0 ), 'clamp' ), diff --git a/stories/BottomSheet.stories.tsx b/stories/BottomSheet.stories.tsx index 9b29035..c6a75a3 100644 --- a/stories/BottomSheet.stories.tsx +++ b/stories/BottomSheet.stories.tsx @@ -11,18 +11,20 @@ export default { export const Default = ( props?: Partial> ) => ( - <> - can interact +
+ Map will go here - background +
+ Location image sliders can go here
} peekHeights={[250, 400]} {...props} > -
+
+ Waypoint information carousel here +
- +
); diff --git a/test/BottomSheet.test.tsx b/test/BottomSheet.test.tsx index 358d4d0..73af785 100644 --- a/test/BottomSheet.test.tsx +++ b/test/BottomSheet.test.tsx @@ -1,14 +1,14 @@ import React from 'react'; import { render, fireEvent } from '@testing-library/react'; -import { Default as BottomSheet } from '../stories/ABottomSheet.stories'; -import { defaultOptions } from '../src/BottomSheet2'; +import { Default as BottomSheet } from '../stories/BottomSheet.stories'; +import { defaultOptions } from '../src/BottomSheet'; describe('', () => { // setup, put here so we re-use the element. - const { getByText, debug, rerender } = render(el); - const el = getByText('el'); + const { getByText, debug } = render(el); + const el = getByText(/waypoint/i); - test('should render', () => { + test.only('should render', () => { expect(el).toBeInTheDocument(); });