-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/stake-804-build-pooled-staking-empty-st…
…ate-component
- Loading branch information
Showing
30 changed files
with
1,462 additions
and
23 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
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,19 @@ | ||
import React from 'react'; | ||
import { Text, View } from 'react-native'; | ||
|
||
import renderWithProvider from '../../../util/test/renderWithProvider'; | ||
import BottomModal from '.'; | ||
|
||
describe('BottomModal', () => { | ||
it('should match snapshot', async () => { | ||
const container = renderWithProvider( | ||
<BottomModal> | ||
<View> | ||
<Text>DUMMY</Text> | ||
</View> | ||
</BottomModal>, | ||
{ state: {} }, | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
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,42 @@ | ||
import React, { ReactChild } from 'react'; | ||
import Modal from 'react-native-modal'; | ||
import { StyleSheet } from 'react-native'; | ||
|
||
import { useTheme } from '../../../util/theme'; | ||
|
||
interface BottomModalProps { | ||
children: ReactChild; | ||
onClose?: () => void; | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
bottomModal: { | ||
justifyContent: 'flex-end', | ||
margin: 0, | ||
}, | ||
}); | ||
|
||
const BottomModal = ({ children, onClose }: BottomModalProps) => { | ||
const { colors } = useTheme(); | ||
|
||
return ( | ||
<Modal | ||
isVisible | ||
animationIn="slideInUp" | ||
animationOut="slideOutDown" | ||
style={styles.bottomModal} | ||
backdropColor={colors.overlay.default} | ||
backdropOpacity={1} | ||
animationInTiming={600} | ||
animationOutTiming={600} | ||
onBackButtonPress={onClose} | ||
onSwipeComplete={onClose} | ||
swipeDirection={'down'} | ||
propagateSwipe | ||
> | ||
{children} | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default BottomModal; |
124 changes: 124 additions & 0 deletions
124
app/components/UI/BottomModal/__snapshots__/BottomModal.test.tsx.snap
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,124 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BottomModal should match snapshot 1`] = ` | ||
<Modal | ||
animationType="none" | ||
deviceHeight={null} | ||
deviceWidth={null} | ||
hardwareAccelerated={false} | ||
hideModalContentWhileAnimating={false} | ||
onBackdropPress={[Function]} | ||
onModalHide={[Function]} | ||
onModalWillHide={[Function]} | ||
onModalWillShow={[Function]} | ||
onRequestClose={[Function]} | ||
panResponderThreshold={4} | ||
scrollHorizontal={false} | ||
scrollOffset={0} | ||
scrollOffsetMax={0} | ||
scrollTo={null} | ||
statusBarTranslucent={false} | ||
supportedOrientations={ | ||
[ | ||
"portrait", | ||
"landscape", | ||
] | ||
} | ||
swipeDirection="down" | ||
swipeThreshold={100} | ||
transparent={true} | ||
visible={true} | ||
> | ||
<View | ||
accessibilityState={ | ||
{ | ||
"busy": undefined, | ||
"checked": undefined, | ||
"disabled": undefined, | ||
"expanded": undefined, | ||
"selected": undefined, | ||
} | ||
} | ||
accessible={true} | ||
collapsable={false} | ||
focusable={true} | ||
onClick={[Function]} | ||
onResponderGrant={[Function]} | ||
onResponderMove={[Function]} | ||
onResponderRelease={[Function]} | ||
onResponderTerminate={[Function]} | ||
onResponderTerminationRequest={[Function]} | ||
onStartShouldSetResponder={[Function]} | ||
style={ | ||
{ | ||
"backgroundColor": "#00000099", | ||
"bottom": 0, | ||
"height": 1334, | ||
"left": 0, | ||
"opacity": 0, | ||
"position": "absolute", | ||
"right": 0, | ||
"top": 0, | ||
"width": 750, | ||
} | ||
} | ||
/> | ||
<View | ||
collapsable={false} | ||
deviceHeight={null} | ||
deviceWidth={null} | ||
hideModalContentWhileAnimating={false} | ||
onBackdropPress={[Function]} | ||
onModalHide={[Function]} | ||
onModalWillHide={[Function]} | ||
onModalWillShow={[Function]} | ||
onMoveShouldSetResponder={[Function]} | ||
onMoveShouldSetResponderCapture={[Function]} | ||
onResponderEnd={[Function]} | ||
onResponderGrant={[Function]} | ||
onResponderMove={[Function]} | ||
onResponderReject={[Function]} | ||
onResponderRelease={[Function]} | ||
onResponderStart={[Function]} | ||
onResponderTerminate={[Function]} | ||
onResponderTerminationRequest={[Function]} | ||
onStartShouldSetResponder={[Function]} | ||
onStartShouldSetResponderCapture={[Function]} | ||
panResponderThreshold={4} | ||
pointerEvents="box-none" | ||
scrollHorizontal={false} | ||
scrollOffset={0} | ||
scrollOffsetMax={0} | ||
scrollTo={null} | ||
statusBarTranslucent={false} | ||
style={ | ||
{ | ||
"flex": 1, | ||
"justifyContent": "flex-end", | ||
"left": 0, | ||
"margin": 0, | ||
"top": 0, | ||
"transform": [ | ||
{ | ||
"translateY": 1334, | ||
}, | ||
], | ||
} | ||
} | ||
supportedOrientations={ | ||
[ | ||
"portrait", | ||
"landscape", | ||
] | ||
} | ||
swipeDirection="down" | ||
swipeThreshold={100} | ||
> | ||
<View> | ||
<Text> | ||
DUMMY | ||
</Text> | ||
</View> | ||
</View> | ||
</Modal> | ||
`; |
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 @@ | ||
export { default } from './BottomModal'; |
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
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
35 changes: 35 additions & 0 deletions
35
app/components/UI/Stake/components/LearnMoreModal/LearnMoreModal.styles.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,35 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
const createLearnMoreModalStyles = () => | ||
StyleSheet.create({ | ||
container: { | ||
paddingHorizontal: 24, | ||
paddingTop: 24, | ||
}, | ||
imageContainer: { | ||
alignItems: 'center', | ||
paddingBottom: 16, | ||
}, | ||
bannerImage: { | ||
width: '100%', | ||
height: 200, | ||
borderRadius: 12, | ||
}, | ||
textContainer: { | ||
paddingVertical: 8, | ||
}, | ||
buttonContainer: { | ||
flexDirection: 'row', | ||
gap: 16, | ||
paddingHorizontal: 16, | ||
paddingTop: 16, | ||
}, | ||
button: { | ||
flex: 1, | ||
}, | ||
italicText: { | ||
fontStyle: 'italic', | ||
}, | ||
}); | ||
|
||
export default createLearnMoreModalStyles; |
Oops, something went wrong.