This repository has been archived by the owner on Feb 8, 2020. It is now read-only.
generated from satya164/typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add fallbacks for non-web modules
closes #95, #96
- Loading branch information
Showing
6 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/stack/src/TransitionConfigs/CardStyleInterpolators.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
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,9 @@ | ||
import { Platform } from 'react-native'; | ||
import { getStatusBarHeight as getStatusBarHeightNative } from 'react-native-safe-area-view'; | ||
|
||
const getStatusBarHeight = Platform.select({ | ||
default: getStatusBarHeightNative, | ||
web: () => 0, | ||
}); | ||
|
||
export default getStatusBarHeight; |
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 * as React from 'react'; | ||
import { UIManager } from 'react-native'; | ||
import RNCMaskedView from '@react-native-community/masked-view'; | ||
|
||
type Props = React.ComponentProps<typeof RNCMaskedView> & { | ||
children: React.ReactElement; | ||
}; | ||
|
||
const isMaskedViewAvailable = | ||
// @ts-ignore | ||
UIManager.getViewManagerConfig('RNCMaskedView') != null; | ||
|
||
export default function MaskedView({ children, ...rest }: Props) { | ||
if (isMaskedViewAvailable) { | ||
return <RNCMaskedView {...rest}>{children}</RNCMaskedView>; | ||
} | ||
|
||
return children; | ||
} |
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,7 @@ | ||
type Props = { | ||
children: React.ReactElement; | ||
}; | ||
|
||
export default function MaskedView({ children }: Props) { | ||
return children; | ||
} |