Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wrap error messages in Layout.Center (#7655)

* Added Portal to ErrorMessage to stack it on top of the view

* Changing Portal solution for Layout.Center according to PR suggestion

authored by

André Fernandes and committed by
GitHub
856c7990 94339759

+37 -31
+37 -31
src/view/com/util/error/ErrorMessage.tsx
··· 14 14 15 15 import {usePalette} from '#/lib/hooks/usePalette' 16 16 import {useTheme} from '#/lib/ThemeContext' 17 + import * as Layout from '#/components/Layout' 17 18 import {Text} from '../text/Text' 18 19 19 20 export function ErrorMessage({ ··· 31 32 const pal = usePalette('error') 32 33 const {_} = useLingui() 33 34 return ( 34 - <View testID="errorMessageView" style={[styles.outer, pal.view, style]}> 35 - <View 36 - style={[styles.errorIcon, {backgroundColor: theme.palette.error.icon}]}> 37 - <FontAwesomeIcon 38 - icon="exclamation" 39 - style={pal.text as FontAwesomeIconStyle} 40 - size={16} 41 - /> 42 - </View> 43 - <Text 44 - type="sm-medium" 45 - style={[styles.message, pal.text]} 46 - numberOfLines={numberOfLines}> 47 - {message} 48 - </Text> 49 - {onPressTryAgain && ( 50 - <TouchableOpacity 51 - testID="errorMessageTryAgainButton" 52 - style={styles.btn} 53 - onPress={onPressTryAgain} 54 - accessibilityRole="button" 55 - accessibilityLabel={_(msg`Retry`)} 56 - accessibilityHint={_( 57 - msg`Retries the last action, which errored out`, 58 - )}> 35 + <Layout.Center> 36 + <View testID="errorMessageView" style={[styles.outer, pal.view, style]}> 37 + <View 38 + style={[ 39 + styles.errorIcon, 40 + {backgroundColor: theme.palette.error.icon}, 41 + ]}> 59 42 <FontAwesomeIcon 60 - icon="arrows-rotate" 61 - style={{color: theme.palette.error.icon}} 62 - size={18} 43 + icon="exclamation" 44 + style={pal.text as FontAwesomeIconStyle} 45 + size={16} 63 46 /> 64 - </TouchableOpacity> 65 - )} 66 - </View> 47 + </View> 48 + <Text 49 + type="sm-medium" 50 + style={[styles.message, pal.text]} 51 + numberOfLines={numberOfLines}> 52 + {message} 53 + </Text> 54 + {onPressTryAgain && ( 55 + <TouchableOpacity 56 + testID="errorMessageTryAgainButton" 57 + style={styles.btn} 58 + onPress={onPressTryAgain} 59 + accessibilityRole="button" 60 + accessibilityLabel={_(msg`Retry`)} 61 + accessibilityHint={_( 62 + msg`Retries the last action, which errored out`, 63 + )}> 64 + <FontAwesomeIcon 65 + icon="arrows-rotate" 66 + style={{color: theme.palette.error.icon}} 67 + size={18} 68 + /> 69 + </TouchableOpacity> 70 + )} 71 + </View> 72 + </Layout.Center> 67 73 ) 68 74 } 69 75