Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 44 additions & 43 deletions README.md

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions example/index.web.ts

This file was deleted.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-image-picker",
"version": "8.2.1",
"name": "@exodus/react-native-image-picker",
"version": "8.2.1-exodus-1",
"description": "A React Native module that allows you to use native UI to select media from the device library or directly from the camera",
"react-native": "src/index.ts",
"main": "src/index.ts",
Expand All @@ -14,7 +14,7 @@
"/lib"
],
"author": "Johan du Toit (Johan-dutoit)",
"homepage": "https://github.com/react-native-image-picker/react-native-image-picker",
"homepage": "https://github.com/ExodusMovement/react-native-image-picker",
"license": "MIT",
"scripts": {
"start": "react-native start",
Expand All @@ -36,7 +36,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/react-native-image-picker/react-native-image-picker.git"
"url": "https://github.com/ExodusMovement/react-native-image-picker.git"
},
"devDependencies": {
"@react-native-community/bob": "0.17.1",
Expand Down
35 changes: 24 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
import {Platform} from 'react-native';

import {CameraOptions, ImageLibraryOptions, Callback} from './types';
import {
CameraOptions,
ImageLibraryOptions,
Callback,
ImagePickerResponse,
} from './types';
import {
imageLibrary as nativeImageLibrary,
camera as nativeCamera,
} from './platforms/native';
import {
imageLibrary as webImageLibrary,
camera as webCamera,
} from './platforms/web';

export * from './types';

export function launchCamera(options: CameraOptions, callback?: Callback) {
return Platform.OS === 'web'
? webCamera(options, callback)
: nativeCamera(options, callback);
if (Platform.OS === 'web') {
const result: ImagePickerResponse = {
errorCode: 'others',
errorMessage: 'Web platform is not supported',
};
if (callback) callback(result);
return Promise.resolve(result);
}
return nativeCamera(options, callback);
}

export function launchImageLibrary(
options: ImageLibraryOptions,
callback?: Callback,
) {
return Platform.OS === 'web'
? webImageLibrary(options, callback)
: nativeImageLibrary(options, callback);
if (Platform.OS === 'web') {
const result: ImagePickerResponse = {
errorCode: 'others',
errorMessage: 'Web platform is not supported',
};
if (callback) callback(result);
return Promise.resolve(result);
}
return nativeImageLibrary(options, callback);
}
5 changes: 0 additions & 5 deletions src/platforms/NativeImagePicker.web.ts

This file was deleted.

Loading