-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(BSR) fix(venueMap): filters modal presentation
- Loading branch information
1 parent
250d322
commit 97946ad
Showing
8 changed files
with
106 additions
and
18 deletions.
There are no files selected for viewing
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
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
32 changes: 32 additions & 0 deletions
32
src/features/navigation/RootNavigator/filtersModalNavOptions.native.test.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { FILTERS_MODAL_NAV_OPTIONS } from './filtersModalNavOptions' | ||
|
||
describe('filtersModalNavOptions', () => { | ||
it('should return screen options', () => { | ||
const { cardStyleInterpolator } = FILTERS_MODAL_NAV_OPTIONS | ||
|
||
expect(FILTERS_MODAL_NAV_OPTIONS).toBeDefined() | ||
expect( | ||
cardStyleInterpolator?.({ | ||
index: 0, | ||
closing: {}, | ||
inverted: 1, | ||
insets: { top: 0, left: 0, bottom: 0, right: 0 }, | ||
swiping: false, | ||
current: { progress: { interpolate: jest.fn().mockImplementation(() => 1) } }, | ||
layouts: { screen: { height: 300, width: 300 } }, | ||
}) | ||
).toMatchObject({ | ||
overlayStyle: { | ||
backgroundColor: 'black', | ||
opacity: 1, | ||
}, | ||
cardStyle: { | ||
transform: [ | ||
{ | ||
translateY: 1, | ||
}, | ||
], | ||
}, | ||
}) | ||
}) | ||
}) |
34 changes: 34 additions & 0 deletions
34
src/features/navigation/RootNavigator/filtersModalNavOptions.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { StackNavigationOptions, TransitionPresets, TransitionSpecs } from '@react-navigation/stack' | ||
|
||
export const FILTERS_MODAL_NAV_OPTIONS: StackNavigationOptions = { | ||
...TransitionPresets.ModalSlideFromBottomIOS, | ||
cardOverlayEnabled: true, | ||
transitionSpec: { | ||
open: { | ||
animation: 'spring', | ||
config: { ...TransitionSpecs.TransitionIOSSpec.config, mass: 2, damping: 83 }, | ||
}, | ||
close: { ...TransitionSpecs.BottomSheetSlideOutSpec }, | ||
}, | ||
cardStyleInterpolator: ({ current, layouts }) => ({ | ||
overlayStyle: { | ||
backgroundColor: 'black', | ||
opacity: current.progress.interpolate({ | ||
inputRange: [0, 1], | ||
outputRange: [0, 0.7], | ||
extrapolate: 'clamp', | ||
}), | ||
}, | ||
cardStyle: { | ||
transform: [ | ||
{ | ||
translateY: current.progress.interpolate({ | ||
inputRange: [0, 1], | ||
outputRange: [layouts.screen.height, 0], | ||
extrapolate: 'clamp', | ||
}), | ||
}, | ||
], | ||
}, | ||
}), | ||
} |
13 changes: 13 additions & 0 deletions
13
...es/navigation/VenueMapFiltersStackNavigator/VenueMapFiltersStackNavigator.native.test.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
|
||
import { render } from 'tests/utils' | ||
|
||
import { VenueMapFiltersStackNavigator } from './VenueMapFiltersStackNavigator' | ||
|
||
describe('VenueMapFiltersStackNavigator', () => { | ||
it('should render correctly', () => { | ||
render(<VenueMapFiltersStackNavigator />) | ||
|
||
expect(true).toBe(true) | ||
}) | ||
}) |
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
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
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