From 801336d05bc42f2a6fc569c40f16e381b08ed0d9 Mon Sep 17 00:00:00 2001 From: balzack Date: Wed, 19 Oct 2022 21:17:52 -0700 Subject: [PATCH] setting status bar style --- .../ios/Databag.xcodeproj/project.pbxproj | 4 +-- app/mobile/src/session/Session.jsx | 3 +- .../imageAsset/useImageAsset.hook.js | 30 ++++++++++--------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/mobile/ios/Databag.xcodeproj/project.pbxproj b/app/mobile/ios/Databag.xcodeproj/project.pbxproj index c9a02c6a..f746c6ae 100644 --- a/app/mobile/ios/Databag.xcodeproj/project.pbxproj +++ b/app/mobile/ios/Databag.xcodeproj/project.pbxproj @@ -310,7 +310,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 13; DEVELOPMENT_TEAM = 3P65PQ7SUR; ENABLE_BITCODE = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -348,7 +348,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 13; DEVELOPMENT_TEAM = 3P65PQ7SUR; INFOPLIST_FILE = Databag/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Databag; diff --git a/app/mobile/src/session/Session.jsx b/app/mobile/src/session/Session.jsx index 484cd5de..dd68edcf 100644 --- a/app/mobile/src/session/Session.jsx +++ b/app/mobile/src/session/Session.jsx @@ -1,4 +1,4 @@ -import { View, TouchableOpacity, Text } from 'react-native'; +import { View, StatusBar, TouchableOpacity, Text } from 'react-native'; import { useState, useEffect, useContext } from 'react'; import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; @@ -379,6 +379,7 @@ export function Session() { )} + ); } diff --git a/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js b/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js index 52beb82b..ddf9cfe4 100644 --- a/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js +++ b/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js @@ -9,8 +9,8 @@ export function useImageAsset(topicId, asset) { frameWidth: 1, frameHeight: 1, imageRatio: 1, - imageWidth: 1, - imageHeight: 1, + imageWidth: 128, + imageHeight: 128, url: null, loaded: false, failed: false, @@ -24,18 +24,20 @@ export function useImageAsset(topicId, asset) { } useEffect(() => { - const frameRatio = state.frameWidth / state.frameHeight; - if (frameRatio > state.imageRatio) { - //height constrained - const height = 0.9 * state.frameHeight; - const width = height * state.imageRatio; - updateState({ imageWidth: width, imageHeight: height }); - } - else { - //width constrained - const width = 0.9 * state.frameWidth; - const height = width / state.imageRatio; - updateState({ imageWidth: width, imageHeight: height }); + if (state.loaded) { + const frameRatio = state.frameWidth / state.frameHeight; + if (frameRatio > state.imageRatio) { + //height constrained + const height = 0.9 * state.frameHeight; + const width = height * state.imageRatio; + updateState({ imageWidth: width, imageHeight: height }); + } + else { + //width constrained + const width = 0.9 * state.frameWidth; + const height = width / state.imageRatio; + updateState({ imageWidth: width, imageHeight: height }); + } } }, [state.frameWidth, state.frameHeight, state.imageRatio]);