Merge branch 'main' into web-layout

This commit is contained in:
Dan Abramov
2023-12-21 02:38:54 +00:00
11 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"prepare": "is-ci || husky install", "prepare": "is-ci || husky install",
"postinstall": "patch-package", "postinstall": "patch-package && yarn intl:compile",
"prebuild": "expo prebuild --clean", "prebuild": "expo prebuild --clean",
"android": "expo run:android", "android": "expo run:android",
"ios": "expo run:ios", "ios": "expo run:ios",
+2 -1
View File
@@ -11,6 +11,7 @@ import {
getModerationOpts, getModerationOpts,
useModerationOpts, useModerationOpts,
} from './preferences' } from './preferences'
import {isInvalidHandle} from '#/lib/strings/handles'
const DEFAULT_MOD_OPTS = getModerationOpts({ const DEFAULT_MOD_OPTS = getModerationOpts({
userDid: '', userDid: '',
@@ -119,7 +120,7 @@ function prefixMatch(
prefix: string, prefix: string,
info: AppBskyActorDefs.ProfileViewBasic, info: AppBskyActorDefs.ProfileViewBasic,
): boolean { ): boolean {
if (info.handle.includes(prefix)) { if (!isInvalidHandle(info.handle) && info.handle.includes(prefix)) {
return true return true
} }
if (info.displayName?.toLocaleLowerCase().includes(prefix)) { if (info.displayName?.toLocaleLowerCase().includes(prefix)) {
+1 -1
View File
@@ -144,7 +144,7 @@ export async function submit({
} }
export function is13(state: CreateAccountState) { export function is13(state: CreateAccountState) {
return getAge(state.birthDate) >= 18 return getAge(state.birthDate) >= 13
} }
export function is18(state: CreateAccountState) { export function is18(state: CreateAccountState) {
+1 -1
View File
@@ -452,7 +452,7 @@ export const ComposePost = observer(function ComposePost({
<OpenCameraBtn gallery={gallery} /> <OpenCameraBtn gallery={gallery} />
</> </>
) : null} ) : null}
{isDesktop ? <EmojiPickerButton /> : null} {!isMobile ? <EmojiPickerButton /> : null}
<View style={s.flex1} /> <View style={s.flex1} />
<SelectLangBtn /> <SelectLangBtn />
<CharProgress count={graphemeLength} /> <CharProgress count={graphemeLength} />
@@ -134,7 +134,7 @@ const MentionList = forwardRef<MentionListRef, SuggestionProps>(
return true return true
} }
if (event.key === 'Enter') { if (event.key === 'Enter' || event.key === 'Tab') {
enterHandler() enterHandler()
return true return true
} }
@@ -76,7 +76,7 @@ export function EmojiPicker({close}: {close: () => void}) {
return (await import('./EmojiPickerData.json')).default return (await import('./EmojiPickerData.json')).default
}} }}
onEmojiSelect={onInsert} onEmojiSelect={onInsert}
autoFocus={false} autoFocus={true}
/> />
</View> </View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
+1
View File
@@ -80,6 +80,7 @@ export function Component({image}: Props) {
source={{ source={{
uri: image.cropped?.path ?? image.path, uri: image.cropped?.path ?? image.path,
}} }}
contentFit="contain"
accessible={true} accessible={true}
accessibilityIgnoresInvertColors accessibilityIgnoresInvertColors
/> />
+1
View File
@@ -88,6 +88,7 @@ function ListImpl<ItemT>(
{...props} {...props}
contentOffset={contentOffset} contentOffset={contentOffset}
refreshControl={refreshControl} refreshControl={refreshControl}
scrollIndicatorInsets={{right: 1}}
onScroll={scrollHandler} onScroll={scrollHandler}
scrollEventThrottle={1} scrollEventThrottle={1}
style={style} style={style}
+1
View File
@@ -493,6 +493,7 @@ export function FeedsScreen(_props: Props) {
onEndReached={onEndReached} onEndReached={onEndReached}
// @ts-ignore our .web version only -prf // @ts-ignore our .web version only -prf
desktopFixedHeight desktopFixedHeight
scrollIndicatorInsets={{right: 1}}
/> />
{hasSession && ( {hasSession && (
+2 -1
View File
@@ -39,6 +39,7 @@ import {truncateAndInvalidate} from '#/state/queries/util'
import {Text} from '#/view/com/util/text/Text' import {Text} from '#/view/com/util/text/Text'
import {usePalette} from 'lib/hooks/usePalette' import {usePalette} from 'lib/hooks/usePalette'
import {isNative} from '#/platform/detection' import {isNative} from '#/platform/detection'
import {isInvalidHandle} from '#/lib/strings/handles'
interface SectionRef { interface SectionRef {
scrollToTop: () => void scrollToTop: () => void
@@ -231,7 +232,7 @@ function ProfileScreenLoaded({
track('ProfileScreen:PressCompose') track('ProfileScreen:PressCompose')
const mention = const mention =
profile.handle === currentAccount?.handle || profile.handle === currentAccount?.handle ||
profile.handle === 'handle.invalid' isInvalidHandle(profile.handle)
? undefined ? undefined
: profile.handle : profile.handle
openComposer({mention}) openComposer({mention})
+2 -1
View File
@@ -46,6 +46,7 @@ import {useComposerControls} from '#/state/shell/composer'
import {useFetchHandle} from '#/state/queries/handle' import {useFetchHandle} from '#/state/queries/handle'
import {emitSoftReset} from '#/state/events' import {emitSoftReset} from '#/state/events'
import {NavSignupCard} from '#/view/shell/NavSignupCard' import {NavSignupCard} from '#/view/shell/NavSignupCard'
import {isInvalidHandle} from '#/lib/strings/handles'
function ProfileCard() { function ProfileCard() {
const {currentAccount} = useSession() const {currentAccount} = useSession()
@@ -221,7 +222,7 @@ function ComposeBtn() {
if ( if (
!handle || !handle ||
handle === currentAccount?.handle || handle === currentAccount?.handle ||
handle === 'handle.invalid' isInvalidHandle(handle)
) )
return undefined return undefined