Fix problems with `BottomSheet` and the report dialog (#3297)
* use @discord/bottom-sheet * add @types/invariant * some progress on keyboard dialog * rework rework add a comment use discord bottom sheet * remove `@gorhom/bottom-sheet` * remove android specific code * organize importszio/stable
parent
c649ee1afa
commit
ad3dd9f6dc
|
@ -49,6 +49,7 @@
|
||||||
"@atproto/api": "^0.12.2",
|
"@atproto/api": "^0.12.2",
|
||||||
"@bam.tech/react-native-image-resizer": "^3.0.4",
|
"@bam.tech/react-native-image-resizer": "^3.0.4",
|
||||||
"@braintree/sanitize-url": "^6.0.2",
|
"@braintree/sanitize-url": "^6.0.2",
|
||||||
|
"@discord/bottom-sheet": "https://github.com/bluesky-social/react-native-bottom-sheet.git#discord-fork-4.6.1",
|
||||||
"@emoji-mart/react": "^1.1.1",
|
"@emoji-mart/react": "^1.1.1",
|
||||||
"@expo/html-elements": "^0.4.2",
|
"@expo/html-elements": "^0.4.2",
|
||||||
"@expo/webpack-config": "^19.0.0",
|
"@expo/webpack-config": "^19.0.0",
|
||||||
|
@ -56,7 +57,6 @@
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.1.1",
|
"@fortawesome/free-regular-svg-icons": "^6.1.1",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.1.1",
|
"@fortawesome/free-solid-svg-icons": "^6.1.1",
|
||||||
"@fortawesome/react-native-fontawesome": "^0.3.0",
|
"@fortawesome/react-native-fontawesome": "^0.3.0",
|
||||||
"@gorhom/bottom-sheet": "^4.5.1",
|
|
||||||
"@lingui/react": "^4.5.0",
|
"@lingui/react": "^4.5.0",
|
||||||
"@mattermost/react-native-paste-input": "^0.6.4",
|
"@mattermost/react-native-paste-input": "^0.6.4",
|
||||||
"@miblanchard/react-native-slider": "^2.3.1",
|
"@miblanchard/react-native-slider": "^2.3.1",
|
||||||
|
@ -93,6 +93,7 @@
|
||||||
"@tiptap/pm": "^2.0.0-beta.220",
|
"@tiptap/pm": "^2.0.0-beta.220",
|
||||||
"@tiptap/react": "^2.0.0-beta.220",
|
"@tiptap/react": "^2.0.0-beta.220",
|
||||||
"@tiptap/suggestion": "^2.0.0-beta.220",
|
"@tiptap/suggestion": "^2.0.0-beta.220",
|
||||||
|
"@types/invariant": "^2.2.37",
|
||||||
"@types/node": "^18.16.2",
|
"@types/node": "^18.16.2",
|
||||||
"@zxing/text-encoding": "^0.9.0",
|
"@zxing/text-encoding": "^0.9.0",
|
||||||
"array.prototype.findlast": "^1.2.3",
|
"array.prototype.findlast": "^1.2.3",
|
||||||
|
|
|
@ -1,59 +1,58 @@
|
||||||
import 'react-native-url-polyfill/auto'
|
import 'react-native-url-polyfill/auto'
|
||||||
import 'lib/sentry' // must be near top
|
import 'lib/sentry' // must be near top
|
||||||
|
|
||||||
import React, {useState, useEffect} from 'react'
|
|
||||||
import {RootSiblingParent} from 'react-native-root-siblings'
|
|
||||||
import * as SplashScreen from 'expo-splash-screen'
|
|
||||||
import {GestureHandlerRootView} from 'react-native-gesture-handler'
|
|
||||||
import {PersistQueryClientProvider} from '@tanstack/react-query-persist-client'
|
|
||||||
import {
|
|
||||||
SafeAreaProvider,
|
|
||||||
initialWindowMetrics,
|
|
||||||
} from 'react-native-safe-area-context'
|
|
||||||
|
|
||||||
import 'view/icons'
|
import 'view/icons'
|
||||||
|
|
||||||
import {ThemeProvider as Alf} from '#/alf'
|
import React, {useEffect, useState} from 'react'
|
||||||
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
|
import {GestureHandlerRootView} from 'react-native-gesture-handler'
|
||||||
import {init as initPersistedState} from '#/state/persisted'
|
import {RootSiblingParent} from 'react-native-root-siblings'
|
||||||
import {listenSessionDropped} from './state/events'
|
import {
|
||||||
import {ThemeProvider} from 'lib/ThemeContext'
|
initialWindowMetrics,
|
||||||
import {s} from 'lib/styles'
|
SafeAreaProvider,
|
||||||
import {Shell} from 'view/shell'
|
} from 'react-native-safe-area-context'
|
||||||
import * as notifications from 'lib/notifications/notifications'
|
import * as SplashScreen from 'expo-splash-screen'
|
||||||
import * as Toast from 'view/com/util/Toast'
|
import {StatusBar} from 'expo-status-bar'
|
||||||
|
import {msg} from '@lingui/macro'
|
||||||
|
import {useLingui} from '@lingui/react'
|
||||||
|
import {PersistQueryClientProvider} from '@tanstack/react-query-persist-client'
|
||||||
|
|
||||||
|
import {Provider as StatsigProvider} from '#/lib/statsig/statsig'
|
||||||
|
import {init as initPersistedState} from '#/state/persisted'
|
||||||
|
import * as persisted from '#/state/persisted'
|
||||||
|
import {Provider as LabelDefsProvider} from '#/state/preferences/label-defs'
|
||||||
|
import {useIntentHandler} from 'lib/hooks/useIntentHandler'
|
||||||
|
import * as notifications from 'lib/notifications/notifications'
|
||||||
import {
|
import {
|
||||||
queryClient,
|
|
||||||
asyncStoragePersister,
|
asyncStoragePersister,
|
||||||
dehydrateOptions,
|
dehydrateOptions,
|
||||||
|
queryClient,
|
||||||
} from 'lib/react-query'
|
} from 'lib/react-query'
|
||||||
import {TestCtrls} from 'view/com/testing/TestCtrls'
|
import {s} from 'lib/styles'
|
||||||
import {Provider as ShellStateProvider} from 'state/shell'
|
import {ThemeProvider} from 'lib/ThemeContext'
|
||||||
import {Provider as ModalStateProvider} from 'state/modals'
|
import {isAndroid} from 'platform/detection'
|
||||||
import {Provider as DialogStateProvider} from 'state/dialogs'
|
import {Provider as DialogStateProvider} from 'state/dialogs'
|
||||||
import {Provider as LightboxStateProvider} from 'state/lightbox'
|
|
||||||
import {Provider as MutedThreadsProvider} from 'state/muted-threads'
|
|
||||||
import {Provider as InvitesStateProvider} from 'state/invites'
|
import {Provider as InvitesStateProvider} from 'state/invites'
|
||||||
|
import {Provider as LightboxStateProvider} from 'state/lightbox'
|
||||||
|
import {Provider as ModalStateProvider} from 'state/modals'
|
||||||
|
import {Provider as MutedThreadsProvider} from 'state/muted-threads'
|
||||||
import {Provider as PrefsStateProvider} from 'state/preferences'
|
import {Provider as PrefsStateProvider} from 'state/preferences'
|
||||||
import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out'
|
import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread'
|
||||||
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed'
|
|
||||||
import {Provider as LabelDefsProvider} from '#/state/preferences/label-defs'
|
|
||||||
import I18nProvider from './locale/i18nProvider'
|
|
||||||
import {
|
import {
|
||||||
Provider as SessionProvider,
|
Provider as SessionProvider,
|
||||||
useSession,
|
useSession,
|
||||||
useSessionApi,
|
useSessionApi,
|
||||||
} from 'state/session'
|
} from 'state/session'
|
||||||
import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread'
|
import {Provider as ShellStateProvider} from 'state/shell'
|
||||||
import * as persisted from '#/state/persisted'
|
import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out'
|
||||||
import {Splash} from '#/Splash'
|
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed'
|
||||||
|
import {TestCtrls} from 'view/com/testing/TestCtrls'
|
||||||
|
import * as Toast from 'view/com/util/Toast'
|
||||||
|
import {Shell} from 'view/shell'
|
||||||
|
import {ThemeProvider as Alf} from '#/alf'
|
||||||
|
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
|
||||||
import {Provider as PortalProvider} from '#/components/Portal'
|
import {Provider as PortalProvider} from '#/components/Portal'
|
||||||
import {Provider as StatsigProvider} from '#/lib/statsig/statsig'
|
import {Splash} from '#/Splash'
|
||||||
import {msg} from '@lingui/macro'
|
import I18nProvider from './locale/i18nProvider'
|
||||||
import {useLingui} from '@lingui/react'
|
import {listenSessionDropped} from './state/events'
|
||||||
import {useIntentHandler} from 'lib/hooks/useIntentHandler'
|
|
||||||
import {StatusBar} from 'expo-status-bar'
|
|
||||||
import {isAndroid} from 'platform/detection'
|
|
||||||
|
|
||||||
SplashScreen.preventAutoHideAsync()
|
SplashScreen.preventAutoHideAsync()
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
import React, {useImperativeHandle} from 'react'
|
import React, {useImperativeHandle} from 'react'
|
||||||
import {View, Dimensions, Keyboard, Pressable} from 'react-native'
|
import {Dimensions, Pressable, View} from 'react-native'
|
||||||
|
import Animated, {useAnimatedStyle} from 'react-native-reanimated'
|
||||||
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import BottomSheet, {
|
import BottomSheet, {
|
||||||
BottomSheetBackdropProps,
|
BottomSheetBackdropProps,
|
||||||
BottomSheetScrollView,
|
BottomSheetScrollView,
|
||||||
|
BottomSheetScrollViewMethods,
|
||||||
BottomSheetTextInput,
|
BottomSheetTextInput,
|
||||||
BottomSheetView,
|
BottomSheetView,
|
||||||
useBottomSheet,
|
useBottomSheet,
|
||||||
WINDOW_HEIGHT,
|
WINDOW_HEIGHT,
|
||||||
} from '@gorhom/bottom-sheet'
|
} from '@discord/bottom-sheet/src'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
|
||||||
import Animated, {useAnimatedStyle} from 'react-native-reanimated'
|
|
||||||
|
|
||||||
import {useTheme, atoms as a, flatten} from '#/alf'
|
|
||||||
import {Portal} from '#/components/Portal'
|
|
||||||
import {createInput} from '#/components/forms/TextField'
|
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useDialogStateControlContext} from '#/state/dialogs'
|
import {useDialogStateControlContext} from '#/state/dialogs'
|
||||||
|
import {isNative} from 'platform/detection'
|
||||||
|
import {atoms as a, flatten, useTheme} from '#/alf'
|
||||||
|
import {Context} from '#/components/Dialog/context'
|
||||||
import {
|
import {
|
||||||
DialogOuterProps,
|
|
||||||
DialogControlProps,
|
DialogControlProps,
|
||||||
DialogInnerProps,
|
DialogInnerProps,
|
||||||
|
DialogOuterProps,
|
||||||
} from '#/components/Dialog/types'
|
} from '#/components/Dialog/types'
|
||||||
import {Context} from '#/components/Dialog/context'
|
import {createInput} from '#/components/forms/TextField'
|
||||||
import {isNative} from 'platform/detection'
|
import {Portal} from '#/components/Portal'
|
||||||
|
|
||||||
export {useDialogControl, useDialogContext} from '#/components/Dialog/context'
|
export {useDialogContext, useDialogControl} from '#/components/Dialog/context'
|
||||||
export * from '#/components/Dialog/types'
|
export * from '#/components/Dialog/types'
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export const Input = createInput(BottomSheetTextInput)
|
export const Input = createInput(BottomSheetTextInput)
|
||||||
|
@ -122,7 +122,6 @@ export function Outer({
|
||||||
)
|
)
|
||||||
|
|
||||||
const onCloseInner = React.useCallback(() => {
|
const onCloseInner = React.useCallback(() => {
|
||||||
Keyboard.dismiss()
|
|
||||||
try {
|
try {
|
||||||
closeCallback.current?.()
|
closeCallback.current?.()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
@ -206,16 +205,14 @@ export function Inner({children, style}: DialogInnerProps) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ScrollableInner({
|
export const ScrollableInner = React.forwardRef<
|
||||||
children,
|
BottomSheetScrollViewMethods,
|
||||||
keyboardDismissMode,
|
DialogInnerProps
|
||||||
style,
|
>(function ScrollableInner({children, style}, ref) {
|
||||||
}: DialogInnerProps) {
|
|
||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
return (
|
return (
|
||||||
<BottomSheetScrollView
|
<BottomSheetScrollView
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
keyboardDismissMode={keyboardDismissMode || 'on-drag'}
|
|
||||||
style={[
|
style={[
|
||||||
a.flex_1, // main diff is this
|
a.flex_1, // main diff is this
|
||||||
a.p_xl,
|
a.p_xl,
|
||||||
|
@ -227,24 +224,19 @@ export function ScrollableInner({
|
||||||
},
|
},
|
||||||
flatten(style),
|
flatten(style),
|
||||||
]}
|
]}
|
||||||
contentContainerStyle={isNative ? a.pb_4xl : undefined}>
|
contentContainerStyle={isNative ? a.pb_4xl : undefined}
|
||||||
|
ref={ref}>
|
||||||
{children}
|
{children}
|
||||||
<View style={{height: insets.bottom + a.pt_5xl.paddingTop}} />
|
<View style={{height: insets.bottom + a.pt_5xl.paddingTop}} />
|
||||||
</BottomSheetScrollView>
|
</BottomSheetScrollView>
|
||||||
)
|
)
|
||||||
}
|
})
|
||||||
|
|
||||||
export function Handle() {
|
export function Handle() {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|
||||||
const onTouchStart = React.useCallback(() => {
|
|
||||||
Keyboard.dismiss()
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View style={[a.absolute, a.w_full, a.align_center, a.z_10, {height: 40}]}>
|
||||||
style={[a.absolute, a.w_full, a.align_center, a.z_10, {height: 40}]}
|
|
||||||
onTouchStart={onTouchStart}>
|
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.rounded_sm,
|
a.rounded_sm,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import type {
|
||||||
GestureResponderEvent,
|
GestureResponderEvent,
|
||||||
ScrollViewProps,
|
ScrollViewProps,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {BottomSheetProps} from '@gorhom/bottom-sheet'
|
import {BottomSheetProps} from '@discord/bottom-sheet/src'
|
||||||
|
|
||||||
import {ViewStyleProp} from '#/alf'
|
import {ViewStyleProp} from '#/alf'
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,24 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {View, Pressable} from 'react-native'
|
import {Pressable, View} from 'react-native'
|
||||||
import {Trans} from '@lingui/macro'
|
import {Trans} from '@lingui/macro'
|
||||||
|
|
||||||
import {useMyLabelersQuery} from '#/state/queries/preferences'
|
|
||||||
import {ReportOption} from '#/lib/moderation/useReportOptions'
|
import {ReportOption} from '#/lib/moderation/useReportOptions'
|
||||||
|
import {useMyLabelersQuery} from '#/state/queries/preferences'
|
||||||
export {useDialogControl as useReportDialogControl} from '#/components/Dialog'
|
export {useDialogControl as useReportDialogControl} from '#/components/Dialog'
|
||||||
|
|
||||||
import {atoms as a} from '#/alf'
|
import {AppBskyLabelerDefs} from '@atproto/api'
|
||||||
import {Loader} from '#/components/Loader'
|
import {BottomSheetScrollViewMethods} from '@discord/bottom-sheet/src'
|
||||||
import * as Dialog from '#/components/Dialog'
|
|
||||||
import {Text} from '#/components/Typography'
|
|
||||||
|
|
||||||
import {ReportDialogProps} from './types'
|
import {atoms as a} from '#/alf'
|
||||||
|
import * as Dialog from '#/components/Dialog'
|
||||||
|
import {useDelayedLoading} from '#/components/hooks/useDelayedLoading'
|
||||||
|
import {useOnKeyboardDidShow} from '#/components/hooks/useOnKeyboard'
|
||||||
|
import {Loader} from '#/components/Loader'
|
||||||
|
import {Text} from '#/components/Typography'
|
||||||
import {SelectLabelerView} from './SelectLabelerView'
|
import {SelectLabelerView} from './SelectLabelerView'
|
||||||
import {SelectReportOptionView} from './SelectReportOptionView'
|
import {SelectReportOptionView} from './SelectReportOptionView'
|
||||||
import {SubmitView} from './SubmitView'
|
import {SubmitView} from './SubmitView'
|
||||||
import {useDelayedLoading} from '#/components/hooks/useDelayedLoading'
|
import {ReportDialogProps} from './types'
|
||||||
import {AppBskyLabelerDefs} from '@atproto/api'
|
|
||||||
|
|
||||||
export function ReportDialog(props: ReportDialogProps) {
|
export function ReportDialog(props: ReportDialogProps) {
|
||||||
return (
|
return (
|
||||||
|
@ -36,10 +38,13 @@ function ReportDialogInner(props: ReportDialogProps) {
|
||||||
} = useMyLabelersQuery()
|
} = useMyLabelersQuery()
|
||||||
const isLoading = useDelayedLoading(500, isLabelerLoading)
|
const isLoading = useDelayedLoading(500, isLabelerLoading)
|
||||||
|
|
||||||
|
const ref = React.useRef<BottomSheetScrollViewMethods>(null)
|
||||||
|
useOnKeyboardDidShow(() => {
|
||||||
|
ref.current?.scrollToEnd({animated: true})
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner label="Report Dialog" ref={ref}>
|
||||||
label="Report Dialog"
|
|
||||||
keyboardDismissMode="interactive">
|
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<View style={[a.align_center, {height: 100}]}>
|
<View style={[a.align_center, {height: 100}]}>
|
||||||
<Loader size="xl" />
|
<Loader size="xl" />
|
||||||
|
@ -55,8 +60,6 @@ function ReportDialogInner(props: ReportDialogProps) {
|
||||||
) : (
|
) : (
|
||||||
<ReportDialogLoaded labelers={labelers} {...props} />
|
<ReportDialogLoaded labelers={labelers} {...props} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Dialog.Close />
|
|
||||||
</Dialog.ScrollableInner>
|
</Dialog.ScrollableInner>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import React from 'react'
|
||||||
|
import {Keyboard} from 'react-native'
|
||||||
|
|
||||||
|
export function useOnKeyboardDidShow(cb: () => unknown) {
|
||||||
|
React.useEffect(() => {
|
||||||
|
const subscription = Keyboard.addListener('keyboardDidShow', cb)
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
subscription.remove()
|
||||||
|
}
|
||||||
|
}, [cb])
|
||||||
|
}
|
|
@ -1,33 +1,33 @@
|
||||||
import React, {useRef, useEffect} from 'react'
|
import React, {useEffect, useRef} from 'react'
|
||||||
import {StyleSheet} from 'react-native'
|
import {StyleSheet} from 'react-native'
|
||||||
import {SafeAreaView} from 'react-native-safe-area-context'
|
import {SafeAreaView} from 'react-native-safe-area-context'
|
||||||
import BottomSheet from '@gorhom/bottom-sheet'
|
import BottomSheet from '@discord/bottom-sheet/src'
|
||||||
import {createCustomBackdrop} from '../util/BottomSheetCustomBackdrop'
|
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
|
||||||
|
|
||||||
import {useModals, useModalControls} from '#/state/modals'
|
import {useModalControls, useModals} from '#/state/modals'
|
||||||
import * as EditProfileModal from './EditProfile'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
import * as RepostModal from './Repost'
|
import {createCustomBackdrop} from '../util/BottomSheetCustomBackdrop'
|
||||||
import * as SelfLabelModal from './SelfLabel'
|
import * as AddAppPassword from './AddAppPasswords'
|
||||||
import * as ThreadgateModal from './Threadgate'
|
|
||||||
import * as CreateOrEditListModal from './CreateOrEditList'
|
|
||||||
import * as UserAddRemoveListsModal from './UserAddRemoveLists'
|
|
||||||
import * as ListAddUserModal from './ListAddRemoveUsers'
|
|
||||||
import * as AltImageModal from './AltImage'
|
import * as AltImageModal from './AltImage'
|
||||||
import * as EditImageModal from './AltImage'
|
import * as EditImageModal from './AltImage'
|
||||||
import * as DeleteAccountModal from './DeleteAccount'
|
|
||||||
import * as ChangeHandleModal from './ChangeHandle'
|
|
||||||
import * as InviteCodesModal from './InviteCodes'
|
|
||||||
import * as AddAppPassword from './AddAppPasswords'
|
|
||||||
import * as ContentLanguagesSettingsModal from './lang-settings/ContentLanguagesSettings'
|
|
||||||
import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings'
|
|
||||||
import * as VerifyEmailModal from './VerifyEmail'
|
|
||||||
import * as ChangeEmailModal from './ChangeEmail'
|
import * as ChangeEmailModal from './ChangeEmail'
|
||||||
|
import * as ChangeHandleModal from './ChangeHandle'
|
||||||
import * as ChangePasswordModal from './ChangePassword'
|
import * as ChangePasswordModal from './ChangePassword'
|
||||||
import * as SwitchAccountModal from './SwitchAccount'
|
import * as CreateOrEditListModal from './CreateOrEditList'
|
||||||
import * as LinkWarningModal from './LinkWarning'
|
import * as DeleteAccountModal from './DeleteAccount'
|
||||||
|
import * as EditProfileModal from './EditProfile'
|
||||||
import * as EmbedConsentModal from './EmbedConsent'
|
import * as EmbedConsentModal from './EmbedConsent'
|
||||||
import * as InAppBrowserConsentModal from './InAppBrowserConsent'
|
import * as InAppBrowserConsentModal from './InAppBrowserConsent'
|
||||||
|
import * as InviteCodesModal from './InviteCodes'
|
||||||
|
import * as ContentLanguagesSettingsModal from './lang-settings/ContentLanguagesSettings'
|
||||||
|
import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings'
|
||||||
|
import * as LinkWarningModal from './LinkWarning'
|
||||||
|
import * as ListAddUserModal from './ListAddRemoveUsers'
|
||||||
|
import * as RepostModal from './Repost'
|
||||||
|
import * as SelfLabelModal from './SelfLabel'
|
||||||
|
import * as SwitchAccountModal from './SwitchAccount'
|
||||||
|
import * as ThreadgateModal from './Threadgate'
|
||||||
|
import * as UserAddRemoveListsModal from './UserAddRemoveLists'
|
||||||
|
import * as VerifyEmailModal from './VerifyEmail'
|
||||||
|
|
||||||
const DEFAULT_SNAPPOINTS = ['90%']
|
const DEFAULT_SNAPPOINTS = ['90%']
|
||||||
const HANDLE_HEIGHT = 24
|
const HANDLE_HEIGHT = 24
|
||||||
|
|
|
@ -5,22 +5,23 @@ import {
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
View,
|
View,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {Text} from '../util/text/Text'
|
import {BottomSheetScrollView} from '@discord/bottom-sheet/src'
|
||||||
import {s} from 'lib/styles'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {useProfileQuery} from '#/state/queries/profile'
|
||||||
|
import {SessionAccount, useSession, useSessionApi} from '#/state/session'
|
||||||
|
import {useCloseAllActiveElements} from '#/state/util'
|
||||||
import {useAnalytics} from 'lib/analytics/analytics'
|
import {useAnalytics} from 'lib/analytics/analytics'
|
||||||
|
import {Haptics} from 'lib/haptics'
|
||||||
import {useAccountSwitcher} from 'lib/hooks/useAccountSwitcher'
|
import {useAccountSwitcher} from 'lib/hooks/useAccountSwitcher'
|
||||||
import {UserAvatar} from '../util/UserAvatar'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
|
import {makeProfileLink} from 'lib/routes/links'
|
||||||
|
import {s} from 'lib/styles'
|
||||||
import {AccountDropdownBtn} from '../util/AccountDropdownBtn'
|
import {AccountDropdownBtn} from '../util/AccountDropdownBtn'
|
||||||
import {Link} from '../util/Link'
|
import {Link} from '../util/Link'
|
||||||
import {makeProfileLink} from 'lib/routes/links'
|
import {Text} from '../util/text/Text'
|
||||||
import {BottomSheetScrollView} from '@gorhom/bottom-sheet'
|
import {UserAvatar} from '../util/UserAvatar'
|
||||||
import {Haptics} from 'lib/haptics'
|
|
||||||
import {Trans, msg} from '@lingui/macro'
|
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {useSession, useSessionApi, SessionAccount} from '#/state/session'
|
|
||||||
import {useProfileQuery} from '#/state/queries/profile'
|
|
||||||
import {useCloseAllActiveElements} from '#/state/util'
|
|
||||||
|
|
||||||
export const snapPoints = ['40%', '90%']
|
export const snapPoints = ['40%', '90%']
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export {
|
export {
|
||||||
BottomSheetScrollView as ScrollView,
|
BottomSheetScrollView as ScrollView,
|
||||||
BottomSheetTextInput as TextInput,
|
BottomSheetTextInput as TextInput,
|
||||||
} from '@gorhom/bottom-sheet'
|
} from '@discord/bottom-sheet/src'
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import React, {useMemo} from 'react'
|
import React, {useMemo} from 'react'
|
||||||
import {TouchableWithoutFeedback} from 'react-native'
|
import {TouchableWithoutFeedback} from 'react-native'
|
||||||
import {BottomSheetBackdropProps} from '@gorhom/bottom-sheet'
|
|
||||||
import Animated, {
|
import Animated, {
|
||||||
Extrapolate,
|
Extrapolate,
|
||||||
interpolate,
|
interpolate,
|
||||||
useAnimatedStyle,
|
useAnimatedStyle,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
|
import {BottomSheetBackdropProps} from '@discord/bottom-sheet/src'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
|
20
yarn.lock
20
yarn.lock
|
@ -2814,6 +2814,13 @@
|
||||||
pino "^8.11.0"
|
pino "^8.11.0"
|
||||||
pino-http "^8.3.3"
|
pino-http "^8.3.3"
|
||||||
|
|
||||||
|
"@discord/bottom-sheet@https://github.com/bluesky-social/react-native-bottom-sheet.git#discord-fork-4.6.1":
|
||||||
|
version "4.6.1"
|
||||||
|
resolved "https://github.com/bluesky-social/react-native-bottom-sheet.git#54dc2e0e318b0524a2d2d8fb817f6c48101bb0b1"
|
||||||
|
dependencies:
|
||||||
|
"@gorhom/portal" "1.0.14"
|
||||||
|
invariant "^2.2.4"
|
||||||
|
|
||||||
"@discoveryjs/json-ext@^0.5.0":
|
"@discoveryjs/json-ext@^0.5.0":
|
||||||
version "0.5.7"
|
version "0.5.7"
|
||||||
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
|
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
|
||||||
|
@ -3602,14 +3609,6 @@
|
||||||
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
|
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
|
||||||
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
|
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
|
||||||
|
|
||||||
"@gorhom/bottom-sheet@^4.5.1":
|
|
||||||
version "4.5.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-4.5.1.tgz#1ac4b234a80e7dff263f0b7ac207f92e41562849"
|
|
||||||
integrity sha512-4Qy6hzvN32fXu2hDxDXOIS0IBGBT6huST7J7+K1V5bXemZ08KIx5ZffyLgwhCUl+CnyeG2KG6tqk6iYLkIwi7Q==
|
|
||||||
dependencies:
|
|
||||||
"@gorhom/portal" "1.0.14"
|
|
||||||
invariant "^2.2.4"
|
|
||||||
|
|
||||||
"@gorhom/portal@1.0.14":
|
"@gorhom/portal@1.0.14":
|
||||||
version "1.0.14"
|
version "1.0.14"
|
||||||
resolved "https://registry.yarnpkg.com/@gorhom/portal/-/portal-1.0.14.tgz#1953edb76aaba80fb24021dc774550194a18e111"
|
resolved "https://registry.yarnpkg.com/@gorhom/portal/-/portal-1.0.14.tgz#1953edb76aaba80fb24021dc774550194a18e111"
|
||||||
|
@ -7629,6 +7628,11 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/invariant@^2.2.37":
|
||||||
|
version "2.2.37"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.37.tgz#1709741e534364d653c87dff22fc76fa94aa7bc0"
|
||||||
|
integrity sha512-IwpIMieE55oGWiXkQPSBY1nw1nFs6bsKXTFskNY8sdS17K24vyEBRQZEwlRS7ZmXCWnJcQtbxWzly+cODWGs2A==
|
||||||
|
|
||||||
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
|
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
|
||||||
version "2.0.4"
|
version "2.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
|
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
|
||||||
|
|
Loading…
Reference in New Issue