From d0a437f8fb9939e220595b0d4ad2478f294fe8d2 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 14 Dec 2022 16:03:10 -0600 Subject: Improve handling of connection loss --- src/view/com/util/ViewHeader.tsx | 136 +++++++++++++++------------------------ 1 file changed, 53 insertions(+), 83 deletions(-) (limited to 'src/view/com/util/ViewHeader.tsx') diff --git a/src/view/com/util/ViewHeader.tsx b/src/view/com/util/ViewHeader.tsx index 76fac8b9d..27f424573 100644 --- a/src/view/com/util/ViewHeader.tsx +++ b/src/view/com/util/ViewHeader.tsx @@ -48,89 +48,71 @@ export const ViewHeader = observer(function ViewHeader({ } canGoBack ??= store.nav.tab.canGoBack return ( - <> - - - {canGoBack ? ( - - ) : ( - - )} - - - {title} - {subtitle ? ( - - {subtitle} - - ) : undefined} - - - - - - + + {canGoBack ? ( + + ) : ( + - + )} + + + {title} + {subtitle ? ( + + {subtitle} + + ) : undefined} + + + + + + {!store.session.online ? ( - + {store.session.attemptingConnect ? ( - <> - - - Connecting... - - + ) : ( <> - + - - Unable to connect - - - Try again - )} ) : undefined} - + ) }) @@ -180,24 +162,12 @@ const styles = StyleSheet.create({ }, offline: { - flexDirection: 'row', - alignItems: 'center', - backgroundColor: colors.gray6, - paddingLeft: 15, - paddingRight: 10, - paddingVertical: 8, - borderRadius: 8, - marginHorizontal: 4, - marginTop: 4, + backgroundColor: colors.white, }, offlineBtn: { - backgroundColor: colors.gray5, + backgroundColor: colors.white, borderRadius: 5, paddingVertical: 5, paddingHorizontal: 10, }, - offlineBtnText: { - color: colors.white, - fontWeight: 'bold', - }, }) -- cgit 1.4.1