💄 Move offline indicator on desktop and mobile web

This commit is contained in:
Chowdhury Foysal Ahamed
2023-08-18 11:37:41 +02:00
parent 60088038ab
commit ecc4b13c8f
3 changed files with 19 additions and 10 deletions
+10 -8
View File
@@ -9,8 +9,7 @@ import {
import {usePalette} from 'lib/hooks/usePalette'
import {Text} from 'view/com/util/text/Text'
import {s} from 'lib/styles'
import {isNative} from 'platform/detection'
import {CenteredView} from './Views.web'
import {isDesktopWeb, isNative} from 'platform/detection'
const Indicator = () => {
const pal = usePalette('error')
@@ -19,12 +18,9 @@ const Indicator = () => {
styles.container,
s.flexRow,
s.alignCenter,
pal.view,
]
if (!isNative) {
containerStyles.push(pal.view)
}
return (
<View style={containerStyles}>
<FontAwesomeIcon icon="wifi" style={s.white as FontAwesomeIconStyle} />
@@ -50,9 +46,9 @@ export const OfflineIndicator = () => {
}
return (
<CenteredView>
<View style={isDesktopWeb ? undefined : styles.mobileWrapper}>
<Indicator />
</CenteredView>
</View>
)
}
@@ -62,4 +58,10 @@ const styles = StyleSheet.create({
justifyContent: 'center',
height: 20,
},
mobileWrapper: {
position: 'absolute',
left: 0,
bottom: 0,
width: '100%',
},
})
+2
View File
@@ -37,6 +37,7 @@ import {getCurrentRoute, isTab, isStateAtTabRoot} from 'lib/routes/helpers'
import {NavigationProp, CommonNavigatorParams} from 'lib/routes/types'
import {router} from '../../../routes'
import {makeProfileLink} from 'lib/routes/links'
import {OfflineIndicator} from 'view/com/util/OfflineIndicator'
const ProfileCard = observer(() => {
const store = useStores()
@@ -179,6 +180,7 @@ export const DesktopLeftNav = observer(function DesktopLeftNav() {
return (
<View style={[styles.leftNav, pal.view]}>
<OfflineIndicator />
{store.session.hasSession && <ProfileCard />}
<BackBtn />
<NavItem
+7 -2
View File
@@ -33,13 +33,13 @@ const ShellInner = observer(() => {
return (
<>
<View style={s.hContentRegion}>
<OfflineIndicator />
<ErrorBoundary>
<FlatNavigator />
</ErrorBoundary>
</View>
{isDesktop && store.session.hasSession && (
<>
<OfflineIndicator />
<DesktopLeftNav />
<DesktopRightNav />
</>
@@ -52,7 +52,12 @@ const ShellInner = observer(() => {
quote={store.shell.composerOpts?.quote}
onPost={store.shell.composerOpts?.onPost}
/>
{!isDesktop && <BottomBarWeb />}
{!isDesktop && (
<>
<BottomBarWeb />
<OfflineIndicator />
</>
)}
<ModalsContainer />
<Lightbox />
{!isDesktop && store.shell.isDrawerOpen && (