Compare commits

...

3 Commits

Author SHA1 Message Date
Eric Bailey 7998ca4a75 Hide FABs 2023-11-22 14:49:03 -06:00
Eric Bailey 03120c28f7 Hide reply prompt 2023-11-22 14:39:24 -06:00
Eric Bailey 4a57b3d138 PostDropdownBtn 2023-11-22 10:39:14 -06:00
6 changed files with 99 additions and 71 deletions
+37 -23
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,24 +123,35 @@ export function FeedPage({
}
onPress={emitSoftReset}
/>
<TextLink
type="title-lg"
href="/settings/home-feed"
style={{fontWeight: 'bold'}}
accessibilityLabel={_(msg`Feed Preferences`)}
accessibilityHint=""
text={
<FontAwesomeIcon
icon="sliders"
style={pal.textLight as FontAwesomeIconStyle}
/>
}
/>
{hasSession && (
<TextLink
type="title-lg"
href="/settings/home-feed"
style={{fontWeight: 'bold'}}
accessibilityLabel={_(msg`Feed Preferences`)}
accessibilityHint=""
text={
<FontAwesomeIcon
icon="sliders"
style={pal.textLight as FontAwesomeIconStyle}
/>
}
/>
)}
</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,14 +177,17 @@ export function FeedPage({
showIndicator={hasNew}
/>
)}
<FAB
testID="composeFAB"
onPress={onPressCompose}
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
{hasSession && (
<FAB
testID="composeFAB"
onPress={onPressCompose}
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</View>
)
}
+4 -1
View File
@@ -38,6 +38,7 @@ import {
UsePreferencesQueryResponse,
usePreferencesQuery,
} from '#/state/queries/preferences'
import {useSession} from '#/state/session'
// const MAINTAIN_VISIBLE_CONTENT_POSITION = {minIndexForVisible: 2} TODO
@@ -130,6 +131,7 @@ function PostThreadLoaded({
onRefresh: () => void
onPressReply: () => void
}) {
const {hasSession} = useSession()
const {_} = useLingui()
const pal = usePalette('default')
const {isTablet, isDesktop} = useWebMediaQueries()
@@ -223,7 +225,7 @@ function PostThreadLoaded({
<ActivityIndicator />
</View>
)
} else if (item === REPLY_PROMPT) {
} else if (item === REPLY_PROMPT && hasSession) {
return (
<View>
{isDesktop && <ComposePrompt onPressCompose={onPressReply} />}
@@ -305,6 +307,7 @@ function PostThreadLoaded({
return null
},
[
hasSession,
isTablet,
isDesktop,
onPressReply,
+21 -20
View File
@@ -35,7 +35,7 @@ export function PostDropdownBtn({
record: AppBskyFeedPost.Record
style?: StyleProp<ViewStyle>
}) {
const {currentAccount} = useSession()
const {hasSession, currentAccount} = useSession()
const theme = useTheme()
const {_} = useLingui()
const defaultCtrlColor = theme.palette.default.postCtrl
@@ -136,10 +136,10 @@ export function PostDropdownBtn({
web: 'share',
},
},
{
hasSession && {
label: 'separator',
},
{
hasSession && {
label: isThreadMuted ? _(msg`Unmute thread`) : _(msg`Mute thread`),
onPress() {
onToggleThreadMute()
@@ -153,27 +153,28 @@ export function PostDropdownBtn({
web: 'comment-slash',
},
},
{
hasSession && {
label: 'separator',
},
!isAuthor && {
label: _(msg`Report post`),
onPress() {
openModal({
name: 'report',
uri: post.uri,
cid: post.cid,
})
},
testID: 'postDropdownReportBtn',
icon: {
ios: {
name: 'exclamationmark.triangle',
!isAuthor &&
hasSession && {
label: _(msg`Report post`),
onPress() {
openModal({
name: 'report',
uri: post.uri,
cid: post.cid,
})
},
testID: 'postDropdownReportBtn',
icon: {
ios: {
name: 'exclamationmark.triangle',
},
android: 'ic_menu_report_image',
web: 'circle-exclamation',
},
android: 'ic_menu_report_image',
web: 'circle-exclamation',
},
},
isAuthor && {
label: 'separator',
},
+10 -8
View File
@@ -504,14 +504,16 @@ export const FeedsScreen = withAuthRequired(
desktopFixedHeight
/>
<FAB
testID="composeFAB"
onPress={onPressCompose}
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
{hasSession && (
<FAB
testID="composeFAB"
onPress={onPressCompose}
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</View>
)
},
+11 -9
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,14 +360,16 @@ function ProfileScreenLoaded({
)
: null}
</PagerWithHeader>
<FAB
testID="composeFAB"
onPress={onPressCompose}
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
{hasSession && (
<FAB
testID="composeFAB"
onPress={onPressCompose}
icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</ScreenHider>
)
}
+16 -10
View File
@@ -423,16 +423,22 @@ export function ProfileFeedScreenInner({
/>
)}
</PagerWithHeader>
<FAB
testID="composeFAB"
onPress={() => openComposer({})}
icon={
<ComposeIcon2 strokeWidth={1.5} size={29} style={{color: 'white'}} />
}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
{hasSession && (
<FAB
testID="composeFAB"
onPress={() => openComposer({})}
icon={
<ComposeIcon2
strokeWidth={1.5}
size={29}
style={{color: 'white'}}
/>
}
accessibilityRole="button"
accessibilityLabel={_(msg`New post`)}
accessibilityHint=""
/>
)}
</View>
)
}