From c9290ffb55aa7079d2503d284551048acd438cd2 Mon Sep 17 00:00:00 2001 From: Luis Rodriguez Date: Fri, 23 Jul 2021 21:25:06 -0600 Subject: [PATCH] Fix issue with images not rendering --- ios/Podfile | 2 ++ ios/Podfile.lock | 2 +- src/contexts/ListingContext.js | 16 ++++++------ src/navigators/NewOrderStack.js | 3 ++- src/screens/CameraRollSelect.js | 44 ++++++++++++++++++++++----------- src/screens/NewOrder.js | 7 +----- 6 files changed, 42 insertions(+), 32 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index b02f787..ff28b98 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -65,6 +65,8 @@ post_install do |_installer| '_initializeModules:(NSArray> *)modules', '_initializeModules:(NSArray *)modules') find_and_replace('../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm', 'RCTBridgeModuleNameForClass(module))', 'RCTBridgeModuleNameForClass(Class(module)))') + find_and_replace('../node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m', + '_currentFrame.CGImage;', '_currentFrame.CGImage ;} else { [super displayLayer:layer];') end def find_and_replace(dir, findstr, replacestr) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 23f3af9..c4f6ad1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -427,6 +427,6 @@ SPEC CHECKSUMS: SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21 Yoga: 02036f6383c0008edb7ef0773a0e6beb6ce82bd1 -PODFILE CHECKSUM: eb37df8267dd7a43f431c689a61309d62782ea09 +PODFILE CHECKSUM: e9c5b4bdcdc84edc44f3a2bd5f1c5d4c1ddd89b4 COCOAPODS: 1.10.1 diff --git a/src/contexts/ListingContext.js b/src/contexts/ListingContext.js index e28db2f..a6aa1df 100644 --- a/src/contexts/ListingContext.js +++ b/src/contexts/ListingContext.js @@ -1,24 +1,22 @@ -import React, { createContext, useReducer } from 'react'; +import React, {createContext, useReducer} from 'react'; export const ListingContext = createContext({}); const initialState = { fetchingListing: true, listing: {}, -} +}; const reducer = (state, action) => { switch (action.type) { case 'GET_LISTING': { return { ...state, - fetchingListing: true + fetchingListing: true, }; } case 'GET_LISTING_SUCCESS': { - const { - listing, - } = action; + const {listing} = action; return { ...state, listing, @@ -28,10 +26,10 @@ const reducer = (state, action) => { case 'GET_LISTING_FAILURE': return { ...state, - fetchingListing: false + fetchingListing: false, }; case 'NO_LISTING': { - return { ...state, listing: {}, fetchingListing: false }; + return {...state, listing: {}, fetchingListing: false}; } default: return state; @@ -45,4 +43,4 @@ export const ListingProvider = props => { {props.children} ); -} \ No newline at end of file +}; diff --git a/src/navigators/NewOrderStack.js b/src/navigators/NewOrderStack.js index bd086a1..8fe3dbb 100644 --- a/src/navigators/NewOrderStack.js +++ b/src/navigators/NewOrderStack.js @@ -2,7 +2,6 @@ import React from 'react'; import {Icon} from 'react-native-ui-kitten'; import {TouchableOpacity} from 'react-native'; import {createStackNavigator} from 'react-navigation-stack'; -import {Header, HeaderBackButton} from 'react-navigation-stack'; import NewOrder from '../screens/NewOrder'; import CameraOrder from '../screens/CameraOrder'; @@ -52,8 +51,10 @@ export default createStackNavigator({ screen: CameraRollSelect, navigationOptions: { headerStyle: { + backgroundColor: '#0079BF', elevation: 0, }, + headerTintColor: '#fff', }, }, }); diff --git a/src/screens/CameraRollSelect.js b/src/screens/CameraRollSelect.js index 21a0a50..9d611e2 100644 --- a/src/screens/CameraRollSelect.js +++ b/src/screens/CameraRollSelect.js @@ -1,8 +1,11 @@ import React, {useState} from 'react'; -import {StyleSheet, Text, View} from 'react-native'; +import {StyleSheet, Text, View, TouchableOpacity} from 'react-native'; import CameraRollPicker from 'react-native-camera-roll-picker'; +import {Icon} from 'react-native-ui-kitten'; -const CameraRollSelect = () => { +const MAX = 3; + +const CameraRollSelect = ({navigation}) => { const [selectedImages, setSelectedImages] = useState([]); const [num, setNum] = useState(0); @@ -19,13 +22,14 @@ const CameraRollSelect = () => { return ( - - {num} images has been selected + + {' '} + {num}/{MAX} selected { ); }; +CameraRollSelect.navigationOptions = ({navigation}) => { + return { + headerRight: () => ( + navigation.navigate('NewOrderScreen')}> + + + ), + }; +}; + export default CameraRollSelect; const styles = StyleSheet.create({ container: { flex: 1, - backgroundColor: '#F6AE2D', + backgroundColor: '#0079BF', }, content: { - marginTop: 15, height: 50, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', - flexWrap: 'wrap', }, - text: { + text: {}, + bold: { + fontWeight: 'bold', fontSize: 16, alignItems: 'center', color: '#fff', }, - bold: { - fontWeight: 'bold', - }, - info: { - fontSize: 12, - }, }); diff --git a/src/screens/NewOrder.js b/src/screens/NewOrder.js index 685369e..34b5f9f 100644 --- a/src/screens/NewOrder.js +++ b/src/screens/NewOrder.js @@ -1,10 +1,5 @@ import React, {useEffect, useContext, useState} from 'react'; -import { - StyleSheet, - ActivityIndicator, - View, - TouchableOpacity, -} from 'react-native'; +import {StyleSheet, ActivityIndicator, TouchableOpacity} from 'react-native'; import {StackActions} from 'react-navigation'; import normalize from 'json-api-normalizer'; import build from 'redux-object';