Hide FABs

This commit is contained in:
Eric Bailey
2023-11-22 14:49:03 -06:00
parent 03120c28f7
commit 7998ca4a75
4 changed files with 74 additions and 50 deletions
+16 -2
View File
@@ -41,7 +41,7 @@ export function FeedPage({
renderEmptyState: () => JSX.Element
renderEndOfFeed?: () => JSX.Element
}) {
const {isSandbox} = useSession()
const {isSandbox, hasSession} = useSession()
const pal = usePalette('default')
const {_} = useLingui()
const {isDesktop} = useWebMediaQueries()
@@ -123,6 +123,7 @@ export function FeedPage({
}
onPress={emitSoftReset}
/>
{hasSession && (
<TextLink
type="title-lg"
href="/settings/home-feed"
@@ -136,11 +137,21 @@ export function FeedPage({
/>
}
/>
)}
</View>
)
}
return <></>
}, [isDesktop, pal.view, pal.text, pal.textLight, hasNew, _, isSandbox])
}, [
isDesktop,
pal.view,
pal.text,
pal.textLight,
hasNew,
_,
isSandbox,
hasSession,
])
return (
<View testID={testID} style={s.h100pct}>
@@ -166,6 +177,8 @@ export function FeedPage({
showIndicator={hasNew}
/>
)}
{hasSession && (
<FAB
testID="composeFAB"
onPress={onPressCompose}
@@ -174,6 +187,7 @@ export function FeedPage({
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</View>
)
}
+2
View File
@@ -504,6 +504,7 @@ export const FeedsScreen = withAuthRequired(
desktopFixedHeight
/>
{hasSession && (
<FAB
testID="composeFAB"
onPress={onPressCompose}
@@ -512,6 +513,7 @@ export const FeedsScreen = withAuthRequired(
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</View>
)
},
+3 -1
View File
@@ -131,7 +131,7 @@ function ProfileScreenLoaded({
hideBackButton: boolean
}) {
const profile = useProfileShadow(profileUnshadowed)
const {currentAccount} = useSession()
const {hasSession, currentAccount} = useSession()
const setMinimalShellMode = useSetMinimalShellMode()
const {openComposer} = useComposerControls()
const {screen, track} = useAnalytics()
@@ -360,6 +360,7 @@ function ProfileScreenLoaded({
)
: null}
</PagerWithHeader>
{hasSession && (
<FAB
testID="composeFAB"
onPress={onPressCompose}
@@ -368,6 +369,7 @@ function ProfileScreenLoaded({
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</ScreenHider>
)
}
+7 -1
View File
@@ -423,16 +423,22 @@ export function ProfileFeedScreenInner({
/>
)}
</PagerWithHeader>
{hasSession && (
<FAB
testID="composeFAB"
onPress={() => openComposer({})}
icon={
<ComposeIcon2 strokeWidth={1.5} size={29} style={{color: 'white'}} />
<ComposeIcon2
strokeWidth={1.5}
size={29}
style={{color: 'white'}}
/>
}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</View>
)
}