-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8610a4
commit 6d23c65
Showing
6 changed files
with
50 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
import * as React from 'react'; | ||
|
||
import { View } from 'react-native'; | ||
import DropShadow from '../..'; | ||
import { View, StyleSheet } from 'react-native'; | ||
import DropShadow from 'react-native-drop-shadow'; | ||
|
||
export default function App() { | ||
return ( | ||
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> | ||
<DropShadow | ||
style={{ | ||
shadowColor: '#000', | ||
shadowOffset: { | ||
width: 0, | ||
height: 0, | ||
}, | ||
shadowOpacity: 1, | ||
shadowRadius: 5, | ||
}} | ||
> | ||
<View style={{ height: 50, width: 50, backgroundColor: 'red' }} /> | ||
<View style={styles.container}> | ||
<DropShadow style={styles.shadow}> | ||
<View style={styles.box} /> | ||
</DropShadow> | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
box: { height: 50, width: 50, backgroundColor: 'red' }, | ||
shadow: { | ||
shadowColor: '#000', | ||
shadowOffset: { | ||
width: 0, | ||
height: 0, | ||
}, | ||
shadowOpacity: 1, | ||
shadowRadius: 5, | ||
}, | ||
container: { flex: 1, alignItems: 'center', justifyContent: 'center' }, | ||
}); |
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 |
---|---|---|
@@ -1,9 +1,26 @@ | ||
import React from 'react'; | ||
import { type ViewProps } from 'react-native'; | ||
import { NativeShadow } from './NativeShadow'; | ||
import { type ViewProps, requireNativeComponent, Platform } from 'react-native'; | ||
|
||
const NativeShadow = requireNativeComponent<ViewProps>('DropShadow'); | ||
|
||
const LINKING_ERROR = | ||
`The package 'react-native-drop-shadow' doesn't seem to be linked. Make sure: \n\n` + | ||
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + | ||
'- You rebuilt the app after installing the package\n' + | ||
'- You are not using Expo Go\n'; | ||
|
||
export class DropShadow extends React.Component<ViewProps> { | ||
render(): React.ReactNode { | ||
if (NativeShadow == null) { | ||
return new Proxy( | ||
{}, | ||
{ | ||
get() { | ||
throw new Error(LINKING_ERROR); | ||
}, | ||
} | ||
); | ||
} | ||
return <NativeShadow {...this.props} />; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.