💄 Move offline indicator on desktop and mobile web
This commit is contained in:
@@ -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%',
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user