[Sheets] [Pt. 2] Remove a bunch of now-unnecessary things (#5560)
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
+48
-150
@@ -1,24 +1,13 @@
|
|||||||
import React, {useImperativeHandle} from 'react'
|
import React, {useImperativeHandle} from 'react'
|
||||||
import {
|
import {Dimensions, Keyboard, StyleProp, View, ViewStyle} from 'react-native'
|
||||||
Dimensions,
|
|
||||||
Keyboard,
|
|
||||||
Pressable,
|
|
||||||
StyleProp,
|
|
||||||
View,
|
|
||||||
ViewStyle,
|
|
||||||
} from 'react-native'
|
|
||||||
import Animated, {useAnimatedStyle} from 'react-native-reanimated'
|
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import BottomSheet, {
|
import BottomSheet, {
|
||||||
BottomSheetBackdropProps,
|
|
||||||
BottomSheetFlatList,
|
BottomSheetFlatList,
|
||||||
BottomSheetFlatListMethods,
|
BottomSheetFlatListMethods,
|
||||||
BottomSheetScrollView,
|
BottomSheetScrollView,
|
||||||
BottomSheetScrollViewMethods,
|
BottomSheetScrollViewMethods,
|
||||||
BottomSheetTextInput,
|
BottomSheetTextInput,
|
||||||
BottomSheetView,
|
BottomSheetView,
|
||||||
useBottomSheet,
|
|
||||||
WINDOW_HEIGHT,
|
|
||||||
} from '@discord/bottom-sheet/src'
|
} from '@discord/bottom-sheet/src'
|
||||||
import {BottomSheetFlatListProps} from '@discord/bottom-sheet/src/components/bottomSheetScrollable/types'
|
import {BottomSheetFlatListProps} from '@discord/bottom-sheet/src/components/bottomSheetScrollable/types'
|
||||||
|
|
||||||
@@ -32,7 +21,6 @@ import {
|
|||||||
DialogOuterProps,
|
DialogOuterProps,
|
||||||
} from '#/components/Dialog/types'
|
} from '#/components/Dialog/types'
|
||||||
import {createInput} from '#/components/forms/TextField'
|
import {createInput} from '#/components/forms/TextField'
|
||||||
import {FullWindowOverlay} from '#/components/FullWindowOverlay'
|
|
||||||
import {Portal} from '#/components/Portal'
|
import {Portal} from '#/components/Portal'
|
||||||
|
|
||||||
export {useDialogContext, useDialogControl} from '#/components/Dialog/context'
|
export {useDialogContext, useDialogControl} from '#/components/Dialog/context'
|
||||||
@@ -41,71 +29,20 @@ export * from '#/components/Dialog/utils'
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export const Input = createInput(BottomSheetTextInput)
|
export const Input = createInput(BottomSheetTextInput)
|
||||||
|
|
||||||
function Backdrop(props: BottomSheetBackdropProps) {
|
|
||||||
const t = useTheme()
|
|
||||||
const bottomSheet = useBottomSheet()
|
|
||||||
|
|
||||||
const animatedStyle = useAnimatedStyle(() => {
|
|
||||||
const opacity =
|
|
||||||
(Math.abs(WINDOW_HEIGHT - props.animatedPosition.value) - 50) / 1000
|
|
||||||
|
|
||||||
return {
|
|
||||||
opacity: Math.min(Math.max(opacity, 0), 0.55),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const onPress = React.useCallback(() => {
|
|
||||||
bottomSheet.close()
|
|
||||||
}, [bottomSheet])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Animated.View
|
|
||||||
style={[
|
|
||||||
t.atoms.bg_contrast_300,
|
|
||||||
{
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
},
|
|
||||||
animatedStyle,
|
|
||||||
]}>
|
|
||||||
<Pressable
|
|
||||||
accessibilityRole="button"
|
|
||||||
accessibilityLabel="Dialog backdrop"
|
|
||||||
accessibilityHint="Press the backdrop to close the dialog"
|
|
||||||
style={{flex: 1}}
|
|
||||||
onPress={onPress}
|
|
||||||
/>
|
|
||||||
</Animated.View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Outer({
|
export function Outer({
|
||||||
children,
|
children,
|
||||||
control,
|
control,
|
||||||
onClose,
|
onClose,
|
||||||
nativeOptions,
|
nativeOptions: _nativeOptions, // @TODO DIALOG REFACTOR
|
||||||
testID,
|
testID,
|
||||||
}: React.PropsWithChildren<DialogOuterProps>) {
|
}: React.PropsWithChildren<DialogOuterProps>) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const sheet = React.useRef<BottomSheet>(null)
|
const sheet = React.useRef<BottomSheet>(null)
|
||||||
const sheetOptions = nativeOptions?.sheet || {}
|
|
||||||
const hasSnapPoints = !!sheetOptions.snapPoints
|
|
||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
const closeCallbacks = React.useRef<(() => void)[]>([])
|
const closeCallbacks = React.useRef<(() => void)[]>([])
|
||||||
const {setDialogIsOpen} = useDialogStateControlContext()
|
const {setDialogIsOpen} = useDialogStateControlContext()
|
||||||
|
// @TODO DIALOG REFACTOR - can i get rid of this? seems pointless tbh
|
||||||
/*
|
const [isOpen, setIsOpen] = React.useState(false)
|
||||||
* Used to manage open/closed, but index is otherwise handled internally by `BottomSheet`
|
|
||||||
*/
|
|
||||||
const [openIndex, setOpenIndex] = React.useState(-1)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* `openIndex` is the index of the snap point to open the bottom sheet to. If >0, the bottom sheet is open.
|
|
||||||
*/
|
|
||||||
const isOpen = openIndex > -1
|
|
||||||
|
|
||||||
const callQueuedCallbacks = React.useCallback(() => {
|
const callQueuedCallbacks = React.useCallback(() => {
|
||||||
for (const cb of closeCallbacks.current) {
|
for (const cb of closeCallbacks.current) {
|
||||||
@@ -119,25 +56,21 @@ export function Outer({
|
|||||||
closeCallbacks.current = []
|
closeCallbacks.current = []
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const open = React.useCallback<DialogControlProps['open']>(
|
const open = React.useCallback<DialogControlProps['open']>(() => {
|
||||||
({index} = {}) => {
|
// Run any leftover callbacks that might have been queued up before calling `.open()`
|
||||||
// Run any leftover callbacks that might have been queued up before calling `.open()`
|
callQueuedCallbacks()
|
||||||
callQueuedCallbacks()
|
setIsOpen(true)
|
||||||
|
setDialogIsOpen(control.id, true)
|
||||||
setDialogIsOpen(control.id, true)
|
// sheet.current?.open() // @TODO DIALOG REFACTOR
|
||||||
// can be set to any index of `snapPoints`, but `0` is the first i.e. "open"
|
}, [setDialogIsOpen, control.id, callQueuedCallbacks])
|
||||||
setOpenIndex(index || 0)
|
|
||||||
sheet.current?.snapToIndex(index || 0)
|
|
||||||
},
|
|
||||||
[setDialogIsOpen, control.id, callQueuedCallbacks],
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is the function that we call when we want to dismiss the dialog.
|
// This is the function that we call when we want to dismiss the dialog.
|
||||||
const close = React.useCallback<DialogControlProps['close']>(cb => {
|
const close = React.useCallback<DialogControlProps['close']>(cb => {
|
||||||
|
setIsOpen(false)
|
||||||
if (typeof cb === 'function') {
|
if (typeof cb === 'function') {
|
||||||
closeCallbacks.current.push(cb)
|
closeCallbacks.current.push(cb)
|
||||||
}
|
}
|
||||||
sheet.current?.close()
|
// sheet.current?.close() // @TODO DIALOG REFACTOR
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
// This is the actual thing we are doing once we "confirm" the dialog. We want the dialog's close animation to
|
// This is the actual thing we are doing once we "confirm" the dialog. We want the dialog's close animation to
|
||||||
@@ -146,8 +79,6 @@ export function Outer({
|
|||||||
// This removes the dialog from our list of stored dialogs. Not super necessary on iOS, but on Android this
|
// This removes the dialog from our list of stored dialogs. Not super necessary on iOS, but on Android this
|
||||||
// tells us that we need to toggle the accessibility overlay setting
|
// tells us that we need to toggle the accessibility overlay setting
|
||||||
setDialogIsOpen(control.id, false)
|
setDialogIsOpen(control.id, false)
|
||||||
setOpenIndex(-1)
|
|
||||||
|
|
||||||
callQueuedCallbacks()
|
callQueuedCallbacks()
|
||||||
onClose?.()
|
onClose?.()
|
||||||
}, [callQueuedCallbacks, control.id, onClose, setDialogIsOpen])
|
}, [callQueuedCallbacks, control.id, onClose, setDialogIsOpen])
|
||||||
@@ -161,58 +92,47 @@ export function Outer({
|
|||||||
[open, close],
|
[open, close],
|
||||||
)
|
)
|
||||||
|
|
||||||
React.useEffect(() => {
|
// @TODO DIALOG REFACTOR - what is this? rm i think?
|
||||||
return () => {
|
// React.useEffect(() => {
|
||||||
setDialogIsOpen(control.id, false)
|
// return () => {
|
||||||
}
|
// setDialogIsOpen(control.id, false)
|
||||||
}, [control.id, setDialogIsOpen])
|
// }
|
||||||
|
// }, [control.id, setDialogIsOpen])
|
||||||
|
|
||||||
const context = React.useMemo(() => ({close}), [close])
|
const context = React.useMemo(() => ({close}), [close])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
isOpen && (
|
isOpen && (
|
||||||
<Portal>
|
<Portal>
|
||||||
<FullWindowOverlay>
|
<View
|
||||||
<View
|
// iOS
|
||||||
// iOS
|
accessibilityViewIsModal
|
||||||
accessibilityViewIsModal
|
style={[a.absolute, a.inset_0]}
|
||||||
style={[a.absolute, a.inset_0]}
|
testID={testID}
|
||||||
testID={testID}
|
onTouchMove={() => Keyboard.dismiss()}>
|
||||||
onTouchMove={() => Keyboard.dismiss()}>
|
<BottomSheet
|
||||||
<BottomSheet
|
topInset={insets.top}
|
||||||
enableDynamicSizing={!hasSnapPoints}
|
bottomInset={insets.bottom}
|
||||||
enablePanDownToClose
|
ref={sheet}
|
||||||
keyboardBehavior="interactive"
|
// handleIndicatorStyle={{backgroundColor: t.palette.primary_500}} // @TODO DIALOG REFACTOR need to add this to lib!
|
||||||
android_keyboardInputMode="adjustResize"
|
onClose={onCloseAnimationComplete}>
|
||||||
keyboardBlurBehavior="restore"
|
<Context.Provider value={context}>
|
||||||
topInset={insets.top}
|
<View
|
||||||
{...sheetOptions}
|
style={[
|
||||||
snapPoints={sheetOptions.snapPoints || ['100%']}
|
a.absolute,
|
||||||
ref={sheet}
|
a.inset_0,
|
||||||
index={openIndex}
|
t.atoms.bg,
|
||||||
backgroundStyle={{backgroundColor: 'transparent'}}
|
{
|
||||||
backdropComponent={Backdrop}
|
borderTopLeftRadius: 40,
|
||||||
handleIndicatorStyle={{backgroundColor: t.palette.primary_500}}
|
borderTopRightRadius: 40,
|
||||||
handleStyle={{display: 'none'}}
|
height: Dimensions.get('window').height * 2,
|
||||||
onClose={onCloseAnimationComplete}>
|
},
|
||||||
<Context.Provider value={context}>
|
]}
|
||||||
<View
|
/>
|
||||||
style={[
|
{children}
|
||||||
a.absolute,
|
</Context.Provider>
|
||||||
a.inset_0,
|
</BottomSheet>
|
||||||
t.atoms.bg,
|
</View>
|
||||||
{
|
|
||||||
borderTopLeftRadius: 40,
|
|
||||||
borderTopRightRadius: 40,
|
|
||||||
height: Dimensions.get('window').height * 2,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
{children}
|
|
||||||
</Context.Provider>
|
|
||||||
</BottomSheet>
|
|
||||||
</View>
|
|
||||||
</FullWindowOverlay>
|
|
||||||
</Portal>
|
</Portal>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -294,28 +214,6 @@ export const InnerFlatList = React.forwardRef<
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
export function Handle() {
|
|
||||||
const t = useTheme()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View style={[a.absolute, a.w_full, a.align_center, a.z_10, {height: 40}]}>
|
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
a.rounded_sm,
|
|
||||||
{
|
|
||||||
top: a.pt_lg.paddingTop,
|
|
||||||
width: 35,
|
|
||||||
height: 4,
|
|
||||||
alignSelf: 'center',
|
|
||||||
backgroundColor: t.palette.contrast_900,
|
|
||||||
opacity: 0.5,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Close() {
|
export function Close() {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,10 +229,6 @@ export const InnerFlatList = React.forwardRef<
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
export function Handle() {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Close() {
|
export function Close() {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const {close} = React.useContext(Context)
|
const {close} = React.useContext(Context)
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
import React, {useMemo, useCallback} from 'react'
|
import React, {useCallback, useMemo} from 'react'
|
||||||
import {ActivityIndicator, FlatList, View} from 'react-native'
|
import {ActivityIndicator, FlatList, View} from 'react-native'
|
||||||
|
import {AppBskyFeedGetLikes as GetLikes} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {AppBskyFeedGetLikes as GetLikes} from '@atproto/api'
|
|
||||||
|
|
||||||
import {useResolveUriQuery} from '#/state/queries/resolve-uri'
|
|
||||||
import {useLikedByQuery} from '#/state/queries/post-liked-by'
|
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
|
import {useLikedByQuery} from '#/state/queries/post-liked-by'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {useResolveUriQuery} from '#/state/queries/resolve-uri'
|
||||||
import {Text} from '#/components/Typography'
|
|
||||||
import * as Dialog from '#/components/Dialog'
|
|
||||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
|
||||||
import {ProfileCardWithFollowBtn} from '#/view/com/profile/ProfileCard'
|
import {ProfileCardWithFollowBtn} from '#/view/com/profile/ProfileCard'
|
||||||
|
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||||
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
|
import * as Dialog from '#/components/Dialog'
|
||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
interface LikesDialogProps {
|
interface LikesDialogProps {
|
||||||
control: Dialog.DialogOuterProps['control']
|
control: Dialog.DialogOuterProps['control']
|
||||||
@@ -24,8 +23,6 @@ interface LikesDialogProps {
|
|||||||
export function LikesDialog(props: LikesDialogProps) {
|
export function LikesDialog(props: LikesDialogProps) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={props.control}>
|
<Dialog.Outer control={props.control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<LikesDialogInner {...props} />
|
<LikesDialogInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {msg, Trans} from '@lingui/macro'
|
|||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import flattenReactChildren from 'react-keyed-flatten-children'
|
import flattenReactChildren from 'react-keyed-flatten-children'
|
||||||
|
|
||||||
import {isNative} from 'platform/detection'
|
import {isNative} from '#/platform/detection'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
@@ -85,8 +85,6 @@ export function Outer({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={context.control}>
|
<Dialog.Outer control={context.control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
{/* Re-wrap with context since Dialogs are portal-ed to root */}
|
{/* Re-wrap with context since Dialogs are portal-ed to root */}
|
||||||
<Context.Provider value={context}>
|
<Context.Provider value={context}>
|
||||||
<Dialog.ScrollableInner label="Menu TODO">
|
<Dialog.ScrollableInner label="Menu TODO">
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import {msg, Trans} from '@lingui/macro'
|
|||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {differenceInSeconds} from 'date-fns'
|
import {differenceInSeconds} from 'date-fns'
|
||||||
|
|
||||||
|
import {HITSLOP_10} from '#/lib/constants'
|
||||||
import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo'
|
import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo'
|
||||||
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||||
import {isNative} from '#/platform/detection'
|
import {isNative} from '#/platform/detection'
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {HITSLOP_10} from 'lib/constants'
|
import {useSession} from '#/state/session'
|
||||||
import {sanitizeDisplayName} from 'lib/strings/display-names'
|
|
||||||
import {useSession} from 'state/session'
|
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
@@ -78,7 +78,6 @@ export function NewskieDialog({
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`New user info dialog`)}
|
label={_(msg`New user info dialog`)}
|
||||||
style={[{width: 'auto', maxWidth: 400, minWidth: 200}]}>
|
style={[{width: 'auto', maxWidth: 400, minWidth: 200}]}>
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ export function Outer({
|
|||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control} testID={testID}>
|
<Dialog.Outer control={control} testID={testID}>
|
||||||
<Context.Provider value={context}>
|
<Context.Provider value={context}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
accessibilityLabelledBy={titleId}
|
accessibilityLabelledBy={titleId}
|
||||||
accessibilityDescribedBy={descriptionId}
|
accessibilityDescribedBy={descriptionId}
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ import {ReportDialogProps} from './types'
|
|||||||
export function ReportDialog(props: ReportDialogProps) {
|
export function ReportDialog(props: ReportDialogProps) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={props.control}>
|
<Dialog.Outer control={props.control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<ReportDialogInner {...props} />
|
<ReportDialogInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ export function QrCodeDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`Create a QR code for a starter pack`)}>
|
label={_(msg`Create a QR code for a starter pack`)}>
|
||||||
<View style={[a.flex_1, a.align_center, a.gap_5xl]}>
|
<View style={[a.flex_1, a.align_center, a.gap_5xl]}>
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ import {AppBskyGraphDefs} from '@atproto/api'
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
|
import {saveImageToMediaLibrary} from '#/lib/media/manip'
|
||||||
|
import {shareUrl} from '#/lib/sharing'
|
||||||
|
import {logEvent} from '#/lib/statsig/statsig'
|
||||||
|
import {getStarterPackOgCard} from '#/lib/strings/starter-pack'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
import {isNative, isWeb} from '#/platform/detection'
|
||||||
import {saveImageToMediaLibrary} from 'lib/media/manip'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import {shareUrl} from 'lib/sharing'
|
|
||||||
import {logEvent} from 'lib/statsig/statsig'
|
|
||||||
import {getStarterPackOgCard} from 'lib/strings/starter-pack'
|
|
||||||
import {isNative, isWeb} from 'platform/detection'
|
|
||||||
import * as Toast from 'view/com/util/Toast'
|
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import {DialogControlProps} from '#/components/Dialog'
|
import {DialogControlProps} from '#/components/Dialog'
|
||||||
@@ -84,7 +84,6 @@ function ShareDialogInner({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.ScrollableInner label={_(msg`Share link dialog`)}>
|
<Dialog.ScrollableInner label={_(msg`Share link dialog`)}>
|
||||||
{!imageLoaded || !link ? (
|
{!imageLoaded || !link ? (
|
||||||
<View style={[a.p_xl, a.align_center]}>
|
<View style={[a.p_xl, a.align_center]}>
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import {BottomSheetFlatListMethods} from '@discord/bottom-sheet'
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {useInitialNumToRender} from 'lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {isWeb} from 'platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import {useSession} from 'state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {WizardAction, WizardState} from '#/screens/StarterPack/Wizard/State'
|
import {WizardAction, WizardState} from '#/screens/StarterPack/Wizard/State'
|
||||||
import {atoms as a, native, useTheme, web} from '#/alf'
|
import {atoms as a, native, useTheme, web} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
@@ -80,7 +80,6 @@ export function WizardEditListDialog({
|
|||||||
control={control}
|
control={control}
|
||||||
testID="newChatDialog"
|
testID="newChatDialog"
|
||||||
nativeOptions={{sheet: {snapPoints: ['95%']}}}>
|
nativeOptions={{sheet: {snapPoints: ['95%']}}}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.InnerFlatList
|
<Dialog.InnerFlatList
|
||||||
ref={listRef}
|
ref={listRef}
|
||||||
data={getData()}
|
data={getData()}
|
||||||
|
|||||||
@@ -84,8 +84,6 @@ export function TagMenu({
|
|||||||
{children}
|
{children}
|
||||||
|
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.Inner label={_(msg`Tag menu: ${displayTag}`)}>
|
<Dialog.Inner label={_(msg`Tag menu: ${displayTag}`)}>
|
||||||
{isPreferencesLoading ? (
|
{isPreferencesLoading ? (
|
||||||
<View style={[a.w_full, a.align_center]}>
|
<View style={[a.w_full, a.align_center]}>
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ function WhoCanReplyDialog({
|
|||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`Dialog: adjust who can interact with this post`)}
|
label={_(msg`Dialog: adjust who can interact with this post`)}
|
||||||
style={[{width: 'auto', maxWidth: 400, minWidth: 200}]}>
|
style={[{width: 'auto', maxWidth: 400, minWidth: 200}]}>
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ export function BirthDateSettingsDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner label={_(msg`My Birthday`)}>
|
<Dialog.ScrollableInner label={_(msg`My Birthday`)}>
|
||||||
<View style={[a.gap_sm, a.pb_lg]}>
|
<View style={[a.gap_sm, a.pb_lg]}>
|
||||||
<Text style={[a.text_2xl, a.font_bold]}>
|
<Text style={[a.text_2xl, a.font_bold]}>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ type EmbedDialogProps = {
|
|||||||
let EmbedDialog = ({control, ...rest}: EmbedDialogProps): React.ReactNode => {
|
let EmbedDialog = ({control, ...rest}: EmbedDialogProps): React.ReactNode => {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<EmbedDialogInner {...rest} />
|
<EmbedDialogInner {...rest} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ export function EmbedConsentDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`External Media`)}
|
label={_(msg`External Media`)}
|
||||||
style={[gtMobile ? {width: 'auto', maxWidth: 400} : a.w_full]}>
|
style={[gtMobile ? {width: 'auto', maxWidth: 400} : a.w_full]}>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
|||||||
import * as TextField from '#/components/forms/TextField'
|
import * as TextField from '#/components/forms/TextField'
|
||||||
import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2'
|
import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2'
|
||||||
import {Button, ButtonText} from '../Button'
|
import {Button, ButtonText} from '../Button'
|
||||||
import {Handle} from '../Dialog'
|
|
||||||
import {useThrottledValue} from '../hooks/useThrottledValue'
|
import {useThrottledValue} from '../hooks/useThrottledValue'
|
||||||
import {ListFooter, ListMaybePlaceholder} from '../Lists'
|
import {ListFooter, ListMaybePlaceholder} from '../Lists'
|
||||||
import {GifPreview} from './GifSelect.shared'
|
import {GifPreview} from './GifSelect.shared'
|
||||||
@@ -70,7 +69,6 @@ export function GifSelectDialog({
|
|||||||
aria-modal
|
aria-modal
|
||||||
accessibilityViewIsModal>
|
accessibilityViewIsModal>
|
||||||
<View style={[a.flex_1, t.atoms.bg]}>
|
<View style={[a.flex_1, t.atoms.bg]}>
|
||||||
<Handle />
|
|
||||||
<ErrorBoundary renderError={renderErrorBoundary}>
|
<ErrorBoundary renderError={renderErrorBoundary}>
|
||||||
<GifList onSelectGif={onSelectGif} close={close} />
|
<GifList onSelectGif={onSelectGif} close={close} />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ export function GifSelectDialog({
|
|||||||
control={control}
|
control={control}
|
||||||
nativeOptions={{sheet: {snapPoints: ['100%']}}}
|
nativeOptions={{sheet: {snapPoints: ['100%']}}}
|
||||||
onClose={onClose}>
|
onClose={onClose}>
|
||||||
<Dialog.Handle />
|
|
||||||
<ErrorBoundary renderError={renderErrorBoundary}>
|
<ErrorBoundary renderError={renderErrorBoundary}>
|
||||||
<GifList control={control} onSelectGif={onSelectGif} />
|
<GifList control={control} onSelectGif={onSelectGif} />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ export function MutedWordsDialog() {
|
|||||||
const {mutedWordsDialogControl: control} = useGlobalDialogsControlContext()
|
const {mutedWordsDialogControl: control} = useGlobalDialogsControlContext()
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<MutedWordsInner />
|
<MutedWordsInner />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ export function PostInteractionSettingsControlledDialog({
|
|||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`Edit post interaction settings`)}
|
label={_(msg`Edit post interaction settings`)}
|
||||||
style={[{maxWidth: 500}, a.w_full]}>
|
style={[{maxWidth: 500}, a.w_full]}>
|
||||||
@@ -96,7 +95,6 @@ export function PostInteractionSettingsDialog(
|
|||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={props.control}>
|
<Dialog.Outer control={props.control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<PostInteractionSettingsDialogControlledInner {...props} />
|
<PostInteractionSettingsDialogControlledInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export function SigninDialog() {
|
|||||||
const {signinDialogControl: control} = useGlobalDialogsControlContext()
|
const {signinDialogControl: control} = useGlobalDialogsControlContext()
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<SigninDialogInner control={control} />
|
<SigninDialogInner control={control} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ export function SwitchAccountDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner label={_(msg`Switch Account`)}>
|
<Dialog.ScrollableInner label={_(msg`Switch Account`)}>
|
||||||
<View style={[a.gap_lg]}>
|
<View style={[a.gap_lg]}>
|
||||||
<Text style={[a.text_2xl, a.font_bold]}>
|
<Text style={[a.text_2xl, a.font_bold]}>
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ export function NeueTypography() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control} onClose={onClose}>
|
<Dialog.Outer control={control} onClose={onClose}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner label={_(msg`Introducing new font settings`)}>
|
<Dialog.ScrollableInner label={_(msg`Introducing new font settings`)}>
|
||||||
<View style={[a.gap_xl]}>
|
<View style={[a.gap_xl]}>
|
||||||
<View style={[a.gap_md]}>
|
<View style={[a.gap_md]}>
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ export function MessagesNUX() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<DialogInner chatDeclation={profile.associated?.chat} />
|
<DialogInner chatDeclation={profile.associated?.chat} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ let ReportDialog = ({
|
|||||||
<Dialog.Outer
|
<Dialog.Outer
|
||||||
control={control}
|
control={control}
|
||||||
nativeOptions={isAndroid ? {sheet: {snapPoints: ['100%']}} : {}}>
|
nativeOptions={isAndroid ? {sheet: {snapPoints: ['100%']}} : {}}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.ScrollableInner label={_(msg`Report this message`)}>
|
<Dialog.ScrollableInner label={_(msg`Report this message`)}>
|
||||||
<DialogInner params={params} />
|
<DialogInner params={params} />
|
||||||
<Dialog.Close />
|
<Dialog.Close />
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ export function DateField({
|
|||||||
accessibilityHint={accessibilityHint}
|
accessibilityHint={accessibilityHint}
|
||||||
/>
|
/>
|
||||||
<Dialog.Outer control={control} testID={testID}>
|
<Dialog.Outer control={control} testID={testID}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.Inner label={label}>
|
<Dialog.Inner label={label}>
|
||||||
<View style={a.gap_lg}>
|
<View style={a.gap_lg}>
|
||||||
<View style={[a.relative, a.w_full, a.align_center]}>
|
<View style={[a.relative, a.w_full, a.align_center]}>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {View} from 'react-native'
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {useAgent, useSession} from 'state/session'
|
import {useAgent, useSession} from '#/state/session'
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
@@ -17,7 +17,6 @@ export function VerifyEmailIntentDialog() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Inner control={control} />
|
<Inner control={control} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ export interface LabelsOnMeDialogProps {
|
|||||||
export function LabelsOnMeDialog(props: LabelsOnMeDialogProps) {
|
export function LabelsOnMeDialog(props: LabelsOnMeDialogProps) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={props.control}>
|
<Dialog.Outer control={props.control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<LabelsOnMeDialogInner {...props} />
|
<LabelsOnMeDialogInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ export interface ModerationDetailsDialogProps {
|
|||||||
export function ModerationDetailsDialog(props: ModerationDetailsDialogProps) {
|
export function ModerationDetailsDialog(props: ModerationDetailsDialogProps) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={props.control}>
|
<Dialog.Outer control={props.control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<ModerationDetailsDialogInner {...props} />
|
<ModerationDetailsDialogInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ function AppealDialog() {
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
<DialogInner />
|
<DialogInner />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -286,7 +286,6 @@ export function StepProfile() {
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
<Dialog.Outer control={creatorControl}>
|
<Dialog.Outer control={creatorControl}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.Inner
|
<Dialog.Inner
|
||||||
label="Avatar creator"
|
label="Avatar creator"
|
||||||
style={[
|
style={[
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
import {isWeb} from '#/platform/detection'
|
||||||
import {DialogControlRefProps} from '#/components/Dialog'
|
import {DialogControlRefProps} from '#/components/Dialog'
|
||||||
import {Provider as GlobalDialogsProvider} from '#/components/dialogs/Context'
|
import {Provider as GlobalDialogsProvider} from '#/components/dialogs/Context'
|
||||||
|
|
||||||
@@ -42,11 +43,18 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
const openDialogs = React.useRef<Set<string>>(new Set())
|
const openDialogs = React.useRef<Set<string>>(new Set())
|
||||||
|
|
||||||
const closeAllDialogs = React.useCallback(() => {
|
const closeAllDialogs = React.useCallback(() => {
|
||||||
openDialogs.current.forEach(id => {
|
if (isWeb) {
|
||||||
const dialog = activeDialogs.current.get(id)
|
openDialogs.current.forEach(id => {
|
||||||
if (dialog) dialog.current.close()
|
const dialog = activeDialogs.current.get(id)
|
||||||
})
|
if (dialog) dialog.current.close()
|
||||||
return openDialogs.current.size > 0
|
})
|
||||||
|
|
||||||
|
return openDialogs.current.size > 0
|
||||||
|
} else {
|
||||||
|
// @TODO DIALOGS REFACTOR
|
||||||
|
console.error('HAILEY FIX THIS 🥺📋')
|
||||||
|
return false
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const setDialogIsOpen = React.useCallback((id: string, isOpen: boolean) => {
|
const setDialogIsOpen = React.useCallback((id: string, isOpen: boolean) => {
|
||||||
|
|||||||
@@ -70,8 +70,6 @@ export function ServerInputDialog({
|
|||||||
control={control}
|
control={control}
|
||||||
nativeOptions={{sheet: {snapPoints: ['100%']}}}
|
nativeOptions={{sheet: {snapPoints: ['100%']}}}
|
||||||
onClose={onClose}>
|
onClose={onClose}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
accessibilityDescribedBy="dialog-description"
|
accessibilityDescribedBy="dialog-description"
|
||||||
accessibilityLabelledBy="dialog-title">
|
accessibilityLabelledBy="dialog-title">
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ export function GifAltText({
|
|||||||
<Dialog.Outer
|
<Dialog.Outer
|
||||||
control={control}
|
control={control}
|
||||||
nativeOptions={isAndroid ? {sheet: {snapPoints: ['100%']}} : {}}>
|
nativeOptions={isAndroid ? {sheet: {snapPoints: ['100%']}} : {}}>
|
||||||
<Dialog.Handle />
|
|
||||||
<AltTextInner
|
<AltTextInner
|
||||||
onSubmit={onPressSubmit}
|
onSubmit={onPressSubmit}
|
||||||
link={link}
|
link={link}
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ type Props = {
|
|||||||
export const ImageAltTextDialog = (props: Props): React.ReactNode => {
|
export const ImageAltTextDialog = (props: Props): React.ReactNode => {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={props.control}>
|
<Dialog.Outer control={props.control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<ImageAltTextInner {...props} />
|
<ImageAltTextInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ export function SubtitleDialogBtn(props: Props) {
|
|||||||
<Dialog.Outer
|
<Dialog.Outer
|
||||||
control={control}
|
control={control}
|
||||||
nativeOptions={isAndroid ? {sheet: {snapPoints: ['60%']}} : {}}>
|
nativeOptions={isAndroid ? {sheet: {snapPoints: ['60%']}} : {}}>
|
||||||
<Dialog.Handle />
|
|
||||||
<SubtitleDialogInner {...props} />
|
<SubtitleDialogInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ let RepostButton = ({
|
|||||||
) : undefined}
|
) : undefined}
|
||||||
</Button>
|
</Button>
|
||||||
<Dialog.Outer control={dialogControl}>
|
<Dialog.Outer control={dialogControl}>
|
||||||
<Dialog.Handle />
|
|
||||||
<Dialog.Inner label={_(msg`Repost or quote post`)}>
|
<Dialog.Inner label={_(msg`Repost or quote post`)}>
|
||||||
<View style={a.gap_xl}>
|
<View style={a.gap_xl}>
|
||||||
<View style={a.gap_xs}>
|
<View style={a.gap_xs}>
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ export function DisableEmail2FADialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
accessibilityDescribedBy="dialog-description"
|
accessibilityDescribedBy="dialog-description"
|
||||||
accessibilityLabelledBy="dialog-title">
|
accessibilityLabelledBy="dialog-title">
|
||||||
|
|||||||
@@ -52,8 +52,6 @@ export function ExportCarDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
accessibilityDescribedBy="dialog-description"
|
accessibilityDescribedBy="dialog-description"
|
||||||
accessibilityLabelledBy="dialog-title">
|
accessibilityLabelledBy="dialog-title">
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import React from 'react'
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {NavigationProp} from '#/lib/routes/types'
|
||||||
import {useDialogStateControlContext} from '#/state/dialogs'
|
import {useDialogStateControlContext} from '#/state/dialogs'
|
||||||
import {NavigationProp} from 'lib/routes/types'
|
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
@@ -179,8 +179,6 @@ export function Dialogs() {
|
|||||||
</Prompt.Outer>
|
</Prompt.Outer>
|
||||||
|
|
||||||
<Dialog.Outer control={basic}>
|
<Dialog.Outer control={basic}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.Inner label="test">
|
<Dialog.Inner label="test">
|
||||||
<H3 nativeID="dialog-title">Dialog</H3>
|
<H3 nativeID="dialog-title">Dialog</H3>
|
||||||
<P nativeID="dialog-description">A basic dialog</P>
|
<P nativeID="dialog-description">A basic dialog</P>
|
||||||
@@ -190,8 +188,6 @@ export function Dialogs() {
|
|||||||
<Dialog.Outer
|
<Dialog.Outer
|
||||||
control={scrollable}
|
control={scrollable}
|
||||||
nativeOptions={{sheet: {snapPoints: ['100%']}}}>
|
nativeOptions={{sheet: {snapPoints: ['100%']}}}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
accessibilityDescribedBy="dialog-description"
|
accessibilityDescribedBy="dialog-description"
|
||||||
accessibilityLabelledBy="dialog-title">
|
accessibilityLabelledBy="dialog-title">
|
||||||
@@ -230,8 +226,6 @@ export function Dialogs() {
|
|||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
|
|
||||||
<Dialog.Outer control={testDialog}>
|
<Dialog.Outer control={testDialog}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
accessibilityDescribedBy="dialog-description"
|
accessibilityDescribedBy="dialog-description"
|
||||||
accessibilityLabelledBy="dialog-title">
|
accessibilityLabelledBy="dialog-title">
|
||||||
@@ -356,8 +350,6 @@ export function Dialogs() {
|
|||||||
|
|
||||||
{shouldRenderUnmountTest && (
|
{shouldRenderUnmountTest && (
|
||||||
<Dialog.Outer control={unmountTestDialog}>
|
<Dialog.Outer control={unmountTestDialog}>
|
||||||
<Dialog.Handle />
|
|
||||||
|
|
||||||
<Dialog.Inner label="test">
|
<Dialog.Inner label="test">
|
||||||
<H3 nativeID="dialog-title">Unmount Test Dialog</H3>
|
<H3 nativeID="dialog-title">Unmount Test Dialog</H3>
|
||||||
<P nativeID="dialog-description">Will unmount in about 5 seconds</P>
|
<P nativeID="dialog-description">Will unmount in about 5 seconds</P>
|
||||||
|
|||||||
@@ -4120,6 +4120,11 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861"
|
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861"
|
||||||
integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==
|
integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==
|
||||||
|
|
||||||
|
"@haileyok/bluesky-bottom-sheet@^0.1.1-alpha.4":
|
||||||
|
version "0.1.1-alpha.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@haileyok/bluesky-bottom-sheet/-/bluesky-bottom-sheet-0.1.1-alpha.4.tgz#19717e57e63d70e79b8bd86984903c448deb83bc"
|
||||||
|
integrity sha512-bEZRbErsI6OJCgmFolbr9Ta5LxNvyaltzRPFOVtwsykIwL8tqNJeNlmfxP8EdJa5lSu2kK1MauQcygmCIouzwg==
|
||||||
|
|
||||||
"@haileyok/bluesky-video@0.1.10":
|
"@haileyok/bluesky-video@0.1.10":
|
||||||
version "0.1.10"
|
version "0.1.10"
|
||||||
resolved "https://registry.yarnpkg.com/@haileyok/bluesky-video/-/bluesky-video-0.1.10.tgz#2756e8c83a78caeb6b120a175578eac1eb6889a9"
|
resolved "https://registry.yarnpkg.com/@haileyok/bluesky-video/-/bluesky-video-0.1.10.tgz#2756e8c83a78caeb6b120a175578eac1eb6889a9"
|
||||||
|
|||||||
Reference in New Issue
Block a user