Merge remote-tracking branch 'origin/ui-impr' into issue48

This commit is contained in:
KraXen72
2024-06-27 16:33:16 +02:00
7 changed files with 39 additions and 35 deletions
+2 -1
View File
@@ -25,7 +25,8 @@
], ],
"recognizedJSXAttributes": [ "recognizedJSXAttributes": [
"tx", "tx",
"subTx" "subTx",
"contentTx"
] ]
} }
} }
+10 -12
View File
@@ -216,19 +216,17 @@ export function BottomModal(props: ModalProps) {
} }
const $outerContainerBase: ViewStyle = { const $outerContainerBase: ViewStyle = {
flex: 1, flex: 1,
justifyContent: 'flex-end', justifyContent: 'flex-end',
alignItems: 'center', alignItems: 'center',
width: '100%', width: '100%',
margin: 0, margin: 0
} }
const $innerContainerBase: ViewStyle = { const $innerContainerBase: ViewStyle = {
width: '100%', width: '100%',
alignItems: 'center', alignItems: 'center',
borderTopLeftRadius: spacing.small, borderTopLeftRadius: spacing.small,
borderTopRightRadius: spacing.small, borderTopRightRadius: spacing.small,
padding: spacing.small padding: spacing.small
} }
+20 -15
View File
@@ -1,20 +1,25 @@
import * as React from 'react' import * as React from 'react'
import { StyleSheet, View, ActivityIndicator, ViewProps, TextStyle } from 'react-native' import { StyleSheet, View, ActivityIndicator, ViewProps, TextStyle, ColorValue, ViewStyle } from 'react-native'
import { useThemeColor } from '../theme' import { useThemeColor } from '../theme'
import { Text } from './Text' import { Text } from './Text'
import { spacing } from '../theme'
export function Loading(props: ViewProps & {statusMessage?: string, textStyle?: TextStyle}) { export function Loading(props: ViewProps & { statusMessage?: string, textStyle?: TextStyle, shiftedUp?: boolean }) {
return ( return (
<View style={[{ <View style={[StyleSheet.absoluteFillObject, $loading(useThemeColor('background'), props?.shiftedUp ?? false), props.style]}>
flex: 1, <ActivityIndicator color="#ccc" animating size="large" />
alignItems: 'center', {props.statusMessage && (<Text style={[{opacity: 1}, props.textStyle]} text={props.statusMessage}/>)}
backgroundColor: useThemeColor('background'), </View>
opacity: 0.5, )
justifyContent: 'center',
zIndex: 9999,
}, StyleSheet.absoluteFillObject, props.style]}>
<ActivityIndicator color="#ccc" animating size="large" />
{props.statusMessage && (<Text style={[{opacity: 1}, props.textStyle]} text={props.statusMessage}/>)}
</View>
)
} }
const $loading = (bg: ColorValue, shiftedUp = false) => ({
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: bg,
opacity: 0.5,
zIndex: 9999,
// for cards that go up in the header, the loading should cover them
marginTop: shiftedUp ? -(spacing.extraLarge * 2 + spacing.small) : 0,
} satisfies ViewStyle)
+1 -1
View File
@@ -466,7 +466,7 @@ export const OwnName = observer(function (props: {navigation: any, pubkey: strin
} }
/> />
)} )}
{isLoading && <Loading />} {isLoading && <Loading />}
</View> </View>
<BottomModal <BottomModal
isVisible={isResultModalVisible ? true : false} isVisible={isResultModalVisible ? true : false}
@@ -77,8 +77,8 @@ export const IncomingRequests = observer(function (props: {
style={$card} style={$card}
/> />
)} )}
{isLoading && <Loading />}
</View> </View>
{isLoading && <Loading />}
{error && <ErrorModal error={error} />} {error && <ErrorModal error={error} />}
{info && <InfoModal message={info} />} {info && <InfoModal message={info} />}
</Screen> </Screen>
+1 -1
View File
@@ -133,7 +133,7 @@ const $unselected: ViewStyle = {
const $contentContainer: TextStyle = { const $contentContainer: TextStyle = {
padding: spacing.small, padding: spacing.small,
minHeight: spacing.huge,
} }
const $picturesContainer: TextStyle = { const $picturesContainer: TextStyle = {
+1 -1
View File
@@ -350,7 +350,7 @@ export const TranHistoryScreen: FC<TransactionsStackScreenProps<'TranHistory'>>
} }
style={{maxHeight: spacing.screenHeight * 0.66}} style={{maxHeight: spacing.screenHeight * 0.66}}
/> />
{isLoading && <Loading />} {isLoading && <Loading shiftedUp={true} />}
</View> </View>
<BottomModal <BottomModal
isVisible={isDeleteModalVisible ? true : false} isVisible={isDeleteModalVisible ? true : false}