Skip to content

Commit e5867cf

Browse files
committed
feat: includeBase64 prop is added
1 parent c255396 commit e5867cf

3 files changed

Lines changed: 21209 additions & 799 deletions

File tree

lib/ImagePickerModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ type CustomStyleProp = StyleProp<ViewStyle> | Array<StyleProp<ViewStyle>>;
1414
const PHOTO = "photo";
1515
const LIBRARY = "library";
1616

17-
const Hello = "hello";
18-
1917
interface IImagePickerModalProps extends IPickerModalProps {
2018
style?: CustomStyleProp;
2119
isVisible: boolean;
2220
data: string[];
21+
includeBase64?: boolean;
2322
onPress: (item: any) => void;
2423
}
2524

2625
const ImagePickerModal: React.FC<IImagePickerModalProps> = ({
2726
isVisible,
2827
data,
2928
onPress,
29+
includeBase64 = false,
3030
...rest
3131
}) => {
3232
const handleSelection = async (selectedItem: string) => {
3333
if (selectedItem === data[0]) {
3434
const options = {
3535
saveToPhotos: true,
3636
mediaType: PHOTO as MediaType,
37-
includeBase64: false,
37+
includeBase64: includeBase64,
3838
includeExtra: true,
3939
};
4040
const result = await launchCamera(options);
@@ -43,7 +43,7 @@ const ImagePickerModal: React.FC<IImagePickerModalProps> = ({
4343
const options = {
4444
selectionLimit: 0,
4545
mediaType: LIBRARY as MediaType,
46-
includeBase64: false,
46+
includeBase64: includeBase64,
4747
includeExtra: true,
4848
};
4949
const result = await launchImageLibrary(options);

0 commit comments

Comments
 (0)