From 67e4d775c9408e4fdefb190e0bb0d55584372424 Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 2 Oct 2024 17:13:42 -0700 Subject: [PATCH] revert all the changes that are not needed' --- src/components/BottomSheetButton.tsx | 12 ----------- src/components/BottomSheetButton.web.tsx | 3 --- src/components/Dialog/index.web.tsx | 1 + src/components/Link.tsx | 5 ++--- src/components/Prompt.tsx | 20 +++++++++---------- .../ReportDialog/SelectLabelerView.tsx | 7 +++---- src/components/ReportDialog/index.tsx | 3 ++- .../moderation/LabelsOnMeDialog.tsx | 15 +++++++------- 8 files changed, 24 insertions(+), 42 deletions(-) delete mode 100644 src/components/BottomSheetButton.tsx delete mode 100644 src/components/BottomSheetButton.web.tsx diff --git a/src/components/BottomSheetButton.tsx b/src/components/BottomSheetButton.tsx deleted file mode 100644 index 9eaee55deb..0000000000 --- a/src/components/BottomSheetButton.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' - -import {Button, ButtonProps} from '#/components/Button' -import {NormalizedRNGHPressable} from '#/components/NormalizedRNGHPressable' - -export function BottomSheetButton({children, ...rest}: ButtonProps) { - return ( - - ) -} diff --git a/src/components/BottomSheetButton.web.tsx b/src/components/BottomSheetButton.web.tsx deleted file mode 100644 index c3752a03e4..0000000000 --- a/src/components/BottomSheetButton.web.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import {Button as BottomSheetButton} from '#/components/Button' - -export {BottomSheetButton} diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index f8ecbd5d94..a50e960a8a 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -103,6 +103,7 @@ export function Outer({ const context = React.useMemo( () => ({ close, + insideDialog: true, }), [close], ) diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 56d030b5df..5a66767243 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -23,7 +23,6 @@ import {shouldClickOpenNewTab} from '#/platform/urls' import {useModalControls} from '#/state/modals' import {useOpenLink} from '#/state/preferences/in-app-browser' import {atoms as a, flatten, TextStyleProp, useTheme, web} from '#/alf' -import {BottomSheetButton} from '#/components/BottomSheetButton' import {Button, ButtonProps} from '#/components/Button' import {useInteractionState} from '#/components/hooks/useInteractionState' import {Text, TextProps} from '#/components/Typography' @@ -258,7 +257,7 @@ export function BottomSheetLink({ }) return ( - {children} - + ) } diff --git a/src/components/Prompt.tsx b/src/components/Prompt.tsx index 7bd284f2ae..3e877a6630 100644 --- a/src/components/Prompt.tsx +++ b/src/components/Prompt.tsx @@ -1,13 +1,11 @@ import React from 'react' -import {View} from 'react-native' -import {PressableEvent} from 'react-native-gesture-handler/lib/typescript/components/Pressable/PressableProps' +import {GestureResponderEvent, View} from 'react-native' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {isNative} from '#/platform/detection' import {atoms as a, useBreakpoints, useTheme} from '#/alf' -import {BottomSheetButton} from '#/components/BottomSheetButton' -import {ButtonColor, ButtonText} from '#/components/Button' +import {Button, ButtonColor, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {Text} from '#/components/Typography' @@ -123,14 +121,14 @@ export function Cancel({ }, [close]) return ( - {cta || _(msg`Cancel`)} - + ) } @@ -147,7 +145,7 @@ export function Action({ * Note: The dialog will close automatically when the action is pressed, you * should NOT close the dialog as a side effect of this method. */ - onPress: (e: PressableEvent) => void + onPress: (e: GestureResponderEvent) => void color?: ButtonColor /** * Optional i18n string. If undefined, it will default to "Confirm". @@ -159,14 +157,14 @@ export function Action({ const {gtMobile} = useBreakpoints() const {close} = Dialog.useDialogContext() const handleOnPress = React.useCallback( - (e: PressableEvent) => { + (e: GestureResponderEvent) => { close(() => onPress?.(e)) }, [close, onPress], ) return ( - {cta || _(msg`Confirm`)} - + ) } @@ -201,7 +199,7 @@ export function Basic({ * Note: The dialog will close automatically when the action is pressed, you * should NOT close the dialog as a side effect of this method. */ - onConfirm: (e: PressableEvent) => void + onConfirm: (e: GestureResponderEvent) => void confirmButtonColor?: ButtonColor showCancel?: boolean withoutPortal?: boolean diff --git a/src/components/ReportDialog/SelectLabelerView.tsx b/src/components/ReportDialog/SelectLabelerView.tsx index e62dc9910b..039bbf123f 100644 --- a/src/components/ReportDialog/SelectLabelerView.tsx +++ b/src/components/ReportDialog/SelectLabelerView.tsx @@ -6,8 +6,7 @@ import {useLingui} from '@lingui/react' import {getLabelingServiceTitle} from '#/lib/moderation' import {atoms as a, useBreakpoints, useTheme} from '#/alf' -import {BottomSheetButton} from '#/components/BottomSheetButton' -import {useButtonContext} from '#/components/Button' +import {Button, useButtonContext} from '#/components/Button' import {Divider} from '#/components/Divider' import * as LabelingServiceCard from '#/components/LabelingServiceCard' import {Text} from '#/components/Typography' @@ -39,12 +38,12 @@ export function SelectLabelerView({ {props.labelers.map(labeler => { return ( - props.onSelectLabeler(labeler.creator.did)}> - + ) })} diff --git a/src/components/ReportDialog/index.tsx b/src/components/ReportDialog/index.tsx index b942659380..b781d9f39e 100644 --- a/src/components/ReportDialog/index.tsx +++ b/src/components/ReportDialog/index.tsx @@ -1,5 +1,6 @@ import React from 'react' -import {Pressable, ScrollView, View} from 'react-native' +import {Pressable, View} from 'react-native' +import {ScrollView} from 'react-native-gesture-handler' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' diff --git a/src/components/moderation/LabelsOnMeDialog.tsx b/src/components/moderation/LabelsOnMeDialog.tsx index 22eb406a00..fc30b004ad 100644 --- a/src/components/moderation/LabelsOnMeDialog.tsx +++ b/src/components/moderation/LabelsOnMeDialog.tsx @@ -13,9 +13,8 @@ import {logger} from '#/logger' import {useAgent, useSession} from '#/state/session' import * as Toast from '#/view/com/util/Toast' import {atoms as a, useBreakpoints, useTheme} from '#/alf' -import {BottomSheetButton} from '#/components/BottomSheetButton' import {BottomSheetInlineLinkText} from '#/components/BottomSheetLink' -import {ButtonIcon, ButtonText} from '#/components/Button' +import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {InlineLinkText} from '#/components/Link' import {Text} from '#/components/Typography' @@ -141,7 +140,7 @@ function Label({ {!isSelfLabel && ( - Appeal - + )} @@ -279,7 +278,7 @@ function AppealForm({ ? [a.flex_row, a.justify_between] : [{flexDirection: 'column-reverse'}, a.gap_sm] }> - {_(msg`Back`)} - - + )