Skip to content

Commit

Permalink
fix: react native 0.68
Browse files Browse the repository at this point in the history
  • Loading branch information
BANG88 committed Apr 24, 2022

Verified

This commit was signed with the committer’s verified signature.
joyeecheung Joyee Cheung
1 parent f99435d commit ead5d3c
Showing 3 changed files with 17 additions and 24 deletions.
33 changes: 15 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as React from "react";
import { requireNativeComponent, processColor, Platform, View } from "react-native";
import { requireNativeComponent, processColor, View } from "react-native";
import * as PropTypes from "prop-types";
import resolveAssetSource from "react-native/Libraries/Image/resolveAssetSource";
import ImageSourcePropType from "react-native/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType";
class MerryPhotoView extends React.Component {
constructor() {
super(...arguments);
@@ -56,22 +55,20 @@ class MerryPhotoView extends React.Component {
}
MerryPhotoView.propTypes = {
data: PropTypes.arrayOf(PropTypes.shape({
source: Platform.OS === "ios"
? ImageSourcePropType
: PropTypes.oneOfType([
PropTypes.shape({
uri: PropTypes.string,
headers: PropTypes.objectOf(PropTypes.string)
}),
// Opaque type returned by require('./image.jpg')
PropTypes.number,
// Multiple sources
PropTypes.arrayOf(PropTypes.shape({
uri: PropTypes.string,
width: PropTypes.number,
height: PropTypes.number
}))
]),
source: PropTypes.oneOfType([
PropTypes.shape({
uri: PropTypes.string,
headers: PropTypes.objectOf(PropTypes.string)
}),
// Opaque type returned by require('./image.jpg')
PropTypes.number,
// Multiple sources
PropTypes.arrayOf(PropTypes.shape({
uri: PropTypes.string,
width: PropTypes.number,
height: PropTypes.number
}))
]),
title: PropTypes.string,
summary: PropTypes.string,
titleColor: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
6 changes: 1 addition & 5 deletions index.tsx
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ import {
} from "react-native";
import * as PropTypes from "prop-types";
import resolveAssetSource from "react-native/Libraries/Image/resolveAssetSource";
import ImageSourcePropType from "react-native/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType";

/**
* Photo data
@@ -68,10 +67,7 @@ class MerryPhotoView extends React.Component<MerryPhotoViewPorps, any> {
static propTypes = {
data: PropTypes.arrayOf(
PropTypes.shape({
source:
Platform.OS === "ios"
? ImageSourcePropType
: PropTypes.oneOfType([
source: PropTypes.oneOfType([
PropTypes.shape({
uri: PropTypes.string,
headers: PropTypes.objectOf(PropTypes.string)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@merryjs/photo-viewer",
"version": "3.2.3",
"version": "3.2.4",
"description": "A photo viewer for react native",
"main": "index.js",
"scripts": {

0 comments on commit ead5d3c

Please sign in to comment.