revert all the changes that are not needed'
This commit is contained in:
@@ -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 (
|
||||
<Button {...rest} Component={NormalizedRNGHPressable}>
|
||||
{children}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import {Button as BottomSheetButton} from '#/components/Button'
|
||||
|
||||
export {BottomSheetButton}
|
||||
@@ -103,6 +103,7 @@ export function Outer({
|
||||
const context = React.useMemo(
|
||||
() => ({
|
||||
close,
|
||||
insideDialog: true,
|
||||
}),
|
||||
[close],
|
||||
)
|
||||
|
||||
@@ -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 (
|
||||
<BottomSheetButton
|
||||
<Button
|
||||
{...rest}
|
||||
style={[a.justify_start, flatten(rest.style)]}
|
||||
role="link"
|
||||
@@ -277,7 +276,7 @@ export function BottomSheetLink({
|
||||
},
|
||||
})}>
|
||||
{children}
|
||||
</BottomSheetButton>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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 (
|
||||
<BottomSheetButton
|
||||
<Button
|
||||
variant="solid"
|
||||
color="secondary"
|
||||
size={gtMobile ? 'small' : 'large'}
|
||||
label={cta || _(msg`Cancel`)}
|
||||
onPress={onPress}>
|
||||
<ButtonText>{cta || _(msg`Cancel`)}</ButtonText>
|
||||
</BottomSheetButton>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
<BottomSheetButton
|
||||
<Button
|
||||
variant="solid"
|
||||
color={color}
|
||||
size={gtMobile ? 'small' : 'large'}
|
||||
@@ -174,7 +172,7 @@ export function Action({
|
||||
onPress={handleOnPress}
|
||||
testID={testID}>
|
||||
<ButtonText>{cta || _(msg`Confirm`)}</ButtonText>
|
||||
</BottomSheetButton>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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({
|
||||
<View style={[a.gap_sm]}>
|
||||
{props.labelers.map(labeler => {
|
||||
return (
|
||||
<BottomSheetButton
|
||||
<Button
|
||||
key={labeler.creator.did}
|
||||
label={_(msg`Send report to ${labeler.creator.displayName}`)}
|
||||
onPress={() => props.onSelectLabeler(labeler.creator.did)}>
|
||||
<LabelerButton labeler={labeler} />
|
||||
</BottomSheetButton>
|
||||
</Button>
|
||||
)
|
||||
})}
|
||||
</View>
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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({
|
||||
</View>
|
||||
{!isSelfLabel && (
|
||||
<View>
|
||||
<BottomSheetButton
|
||||
<Button
|
||||
variant="solid"
|
||||
color="secondary"
|
||||
size="small"
|
||||
@@ -150,7 +149,7 @@ function Label({
|
||||
<ButtonText>
|
||||
<Trans>Appeal</Trans>
|
||||
</ButtonText>
|
||||
</BottomSheetButton>
|
||||
</Button>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
@@ -279,7 +278,7 @@ function AppealForm({
|
||||
? [a.flex_row, a.justify_between]
|
||||
: [{flexDirection: 'column-reverse'}, a.gap_sm]
|
||||
}>
|
||||
<BottomSheetButton
|
||||
<Button
|
||||
testID="backBtn"
|
||||
variant="solid"
|
||||
color="secondary"
|
||||
@@ -287,8 +286,8 @@ function AppealForm({
|
||||
onPress={onPressBack}
|
||||
label={_(msg`Back`)}>
|
||||
<ButtonText>{_(msg`Back`)}</ButtonText>
|
||||
</BottomSheetButton>
|
||||
<BottomSheetButton
|
||||
</Button>
|
||||
<Button
|
||||
testID="submitBtn"
|
||||
variant="solid"
|
||||
color="primary"
|
||||
@@ -297,7 +296,7 @@ function AppealForm({
|
||||
label={_(msg`Submit`)}>
|
||||
<ButtonText>{_(msg`Submit`)}</ButtonText>
|
||||
{isPending && <ButtonIcon icon={Loader} />}
|
||||
</BottomSheetButton>
|
||||
</Button>
|
||||
</View>
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user