diff --git a/.vscode/settings.json b/.vscode/settings.json index 199f06c..6be35dc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { - "files.autoSave": "afterDelay", - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true -} \ No newline at end of file + "files.autoSave": "afterDelay", + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.hover.delay": 3000 +} diff --git a/README.md b/README.md index 5b30bdc..bf4d306 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,10 @@ Download apk to see it in action, [click to download](https://reactnativeavatarc | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | ![video](https://github.com/vemarav/react-native-avatar-crop/raw/main/screenshots/demo.gif) | ![video](https://github.com/vemarav/react-native-avatar-crop/raw/main/screenshots/demo2.gif) | - ## Installation +> Note: Please migrate to @react-native-masked-view/masked-view if using @react-native-community/masked-view + npm ``` diff --git a/example/yarn.lock b/example/yarn.lock index 0e2693e..c6236de 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -5689,10 +5689,8 @@ react-is@^16.13.0, react-is@^16.7.0, react-is@^16.8.1: resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-native-avatar-crop@^1.3.3: +"react-native-avatar-crop@file:../package": version "1.3.3" - resolved "https://registry.yarnpkg.com/react-native-avatar-crop/-/react-native-avatar-crop-1.3.3.tgz#25a9baf1f7c82e858007f02cd0b39123495ac89f" - integrity sha512-h8ucFsPpbB0SkPWp0K5DyvvrdzGuS9zbptscHKETGLZEjvLZ9+cJMxvwcB5+tB1XccAJm58cXKvyxzOGFmo8uw== react-native-codegen@^0.0.7: version "0.0.7" diff --git a/package/README.md b/package/README.md index 95b536b..bf4d306 100644 --- a/package/README.md +++ b/package/README.md @@ -12,6 +12,8 @@ Download apk to see it in action, [click to download](https://reactnativeavatarc ## Installation +> Note: Please migrate to @react-native-masked-view/masked-view if using @react-native-community/masked-view + npm ``` diff --git a/package/package-lock.json b/package/package-lock.json index 9ac43eb..a97d6cc 100644 --- a/package/package-lock.json +++ b/package/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-avatar-crop", - "version": "1.3.3", + "version": "1.3.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "react-native-avatar-crop", - "version": "1.3.3", + "version": "1.3.4", "license": "MIT", "devDependencies": { "@react-native-community/image-editor": "https://github.com/vemarav/react-native-image-editor", diff --git a/package/package.json b/package/package.json index 4d93da2..e7e3b05 100644 --- a/package/package.json +++ b/package/package.json @@ -1,6 +1,6 @@ { "name": "react-native-avatar-crop", - "version": "1.3.3", + "version": "1.3.4", "description": "Crop component to crop profile images", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/package/src/crop/index.tsx b/package/src/crop/index.tsx index e191132..afdab4d 100644 --- a/package/src/crop/index.tsx +++ b/package/src/crop/index.tsx @@ -8,7 +8,7 @@ import { GestureEvent, } from "react-native-gesture-handler"; -import MaskedView from "./masked"; +import MaskedView from "@react-native-masked-view/masked-view"; import { Size, round, diff --git a/package/src/crop/masked.tsx b/package/src/crop/masked.tsx deleted file mode 100644 index c0d5fd4..0000000 --- a/package/src/crop/masked.tsx +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -// @flow -import {ViewProps} from 'react-native'; -import * as React from 'react'; -import {View, StyleSheet, requireNativeComponent} from 'react-native'; - -interface MaskedViewProps extends ViewProps { - children: React.ReactNode; - maskElement: React.ReactElement; - androidRenderingMode?: 'software' | 'hardware'; -} - -const RNCMaskedView = requireNativeComponent('RNCMaskedView'); - -export default class MaskedView extends React.Component { - _hasWarnedInvalidRenderMask = false; - - render(): React.ReactNode { - const {maskElement, children, ...otherViewProps} = this.props; - - if (!React.isValidElement(maskElement)) { - if (!this._hasWarnedInvalidRenderMask) { - console.warn( - 'MaskedView: Invalid `maskElement` prop was passed to MaskedView. ' + - 'Expected a React Element. No mask will render.', - ); - this._hasWarnedInvalidRenderMask = true; - } - return {children}; - } - - return ( - - - {maskElement} - - {children} - - ); - } -}