forked from prscX/react-native-photo-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RNPhotoEditor.js
53 lines (48 loc) · 978 Bytes
/
RNPhotoEditor.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { NativeModules } from 'react-native'
const { RNPhotoEditor } = NativeModules
const defaultColors = [
'#000000',
'#808080',
'#a9a9a9',
'#FFFFFF',
'#0000ff',
'#00ff00',
'#ff0000',
'#ffff00',
'#ffa500',
'#800080',
'#00ffff',
'#a52a2a',
'#ff00ff'
]
type Props = {
colors?: Array<string>,
hiddenControls?: Array<string>,
onCancel?: any => void,
onDone?: any => void,
path: string,
stickers?: Array<string>
}
export default function PhotoEditor(props: Props) {
const {
colors = defaultColors,
hiddenControls = [],
onCancel = () => {},
onDone = () => {},
path,
stickers = []
} = props
RNPhotoEditor.Edit(
{
colors,
hiddenControls,
onCancel,
onDone,
path,
stickers
},
onDone,
onCancel
)
}
export { PhotoEditor as RNPhotoEditor }