This repository has been archived by the owner on Mar 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Extracted `Modal` component from `Margarita`, because it is used even by some `universal-components` like `DatePicker` or `Picker`. Implementation was updated to make `Modal` more flexible. Native version was mostly replaced by implementation from `mobile` repo: https://github.com/kiwicom/mobile/blob/master/packages/shared/src/Modal.js .
- Loading branch information
Showing
19 changed files
with
457 additions
and
104 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,29 @@ | ||
// @flow | ||
|
||
import * as React from 'react'; | ||
import ReactModal from 'react-native-modal'; | ||
|
||
import type { Props } from './ModalTypes'; | ||
|
||
/** | ||
* NOTE: This is just a `react-native-modal` wrapper with default settings | ||
* so it's going to be easy to replace in the future (if necessary). | ||
*/ | ||
function Modal(props: Props) { | ||
return ( | ||
<ReactModal | ||
supportedOrientations={['portrait', 'landscape']} // iOS only | ||
animationInTiming={150} | ||
animationOutTiming={150} | ||
useNativeDriver | ||
hideModalContentWhileAnimating // this is workaround for `useNativeDriver` property (see: https://github.com/react-native-community/react-native-modal#the-modal-flashes-in-a-weird-way-when-animating) | ||
{...props} | ||
/> | ||
); | ||
} | ||
|
||
Modal.defaultProps = { | ||
backdropOpacity: 0.5, | ||
}; | ||
|
||
export default Modal; |
Oops, something went wrong.