more fixes

This commit is contained in:
Hailey
2024-10-02 11:55:00 -07:00
parent f365ae004a
commit ca0888c633
6 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import {NormalizedRNGHPressable} from '#/components/NormalizedRNGHPressable'
export function BottomSheetButton({children, ...rest}: ButtonProps) { export function BottomSheetButton({children, ...rest}: ButtonProps) {
return ( return (
<Button {...rest} Component={NormalizedRNGHPressable}> <Button {...rest} PressableComponent={NormalizedRNGHPressable}>
{children} {children}
</Button> </Button>
) )
+4 -4
View File
@@ -87,7 +87,7 @@ export type ButtonProps = Pick<
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
hoverStyle?: StyleProp<ViewStyle> hoverStyle?: StyleProp<ViewStyle>
children: NonTextElements | ((context: ButtonContext) => NonTextElements) children: NonTextElements | ((context: ButtonContext) => NonTextElements)
Component?: React.ComponentType<PressableProps> PressableComponent?: React.ComponentType<PressableProps>
} }
export type ButtonTextProps = TextProps & export type ButtonTextProps = TextProps &
@@ -117,7 +117,7 @@ export const Button = React.forwardRef<View, ButtonProps>(
disabled = false, disabled = false,
style, style,
hoverStyle: hoverStyleProp, hoverStyle: hoverStyleProp,
Component = Pressable, PressableComponent = Pressable,
...rest ...rest
}, },
ref, ref,
@@ -239,7 +239,7 @@ export const Button = React.forwardRef<View, ButtonProps>(
const flattenedBaseStyles = flatten([baseStyles, style]) const flattenedBaseStyles = flatten([baseStyles, style])
return ( return (
<Component <PressableComponent
role="button" role="button"
accessibilityHint={undefined} // optional accessibilityHint={undefined} // optional
{...rest} {...rest}
@@ -290,7 +290,7 @@ export const Button = React.forwardRef<View, ButtonProps>(
<Context.Provider value={context}> <Context.Provider value={context}>
{typeof children === 'function' ? children(context) : children} {typeof children === 'function' ? children(context) : children}
</Context.Provider> </Context.Provider>
</Component> </PressableComponent>
) )
}, },
) )
+3 -1
View File
@@ -17,6 +17,7 @@ import * as Toggle from '#/components/forms/Toggle'
import {Check_Stroke2_Corner0_Rounded as Check} from '#/components/icons/Check' import {Check_Stroke2_Corner0_Rounded as Check} from '#/components/icons/Check'
import {ChevronLeft_Stroke2_Corner0_Rounded as ChevronLeft} from '#/components/icons/Chevron' import {ChevronLeft_Stroke2_Corner0_Rounded as ChevronLeft} from '#/components/icons/Chevron'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {NormalizedRNGHPressable} from '#/components/NormalizedRNGHPressable'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import {ReportDialogProps} from './types' import {ReportDialogProps} from './types'
@@ -154,7 +155,8 @@ export function SubmitView({
<Toggle.Item <Toggle.Item
key={labeler.creator.did} key={labeler.creator.did}
name={labeler.creator.did} name={labeler.creator.did}
label={title}> label={title}
PressableComponent={NormalizedRNGHPressable}>
<LabelerToggle title={title} /> <LabelerToggle title={title} />
</Toggle.Item> </Toggle.Item>
) )
@@ -38,6 +38,7 @@ import * as Toggle from '#/components/forms/Toggle'
import {Check_Stroke2_Corner0_Rounded as Check} from '#/components/icons/Check' import {Check_Stroke2_Corner0_Rounded as Check} from '#/components/icons/Check'
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo' import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {NormalizedRNGHPressable} from '#/components/NormalizedRNGHPressable'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
export type PostInteractionSettingsFormProps = { export type PostInteractionSettingsFormProps = {
@@ -303,7 +304,8 @@ export function PostInteractionSettingsForm({
} }
value={quotesEnabled} value={quotesEnabled}
onChange={onChangeQuotesEnabled} onChange={onChangeQuotesEnabled}
style={[, a.justify_between, a.pt_xs]}> style={[, a.justify_between, a.pt_xs]}
PressableComponent={NormalizedRNGHPressable}>
<Text style={[t.atoms.text_contrast_medium]}> <Text style={[t.atoms.text_contrast_medium]}>
{quotesEnabled ? ( {quotesEnabled ? (
<Trans>Quote posts enabled</Trans> <Trans>Quote posts enabled</Trans>
+3 -2
View File
@@ -14,6 +14,7 @@ import {useAgent} from '#/state/session'
import {CharProgress} from '#/view/com/composer/char-progress/CharProgress' import {CharProgress} from '#/view/com/composer/char-progress/CharProgress'
import * as Toast from '#/view/com/util/Toast' import * as Toast from '#/view/com/util/Toast'
import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {atoms as a, useBreakpoints, useTheme} from '#/alf'
import {BottomSheetButton} from '#/components/BottomSheetButton'
import * as Dialog from '#/components/Dialog' import * as Dialog from '#/components/Dialog'
import {KeyboardControllerPadding} from '#/components/KeyboardControllerPadding' import {KeyboardControllerPadding} from '#/components/KeyboardControllerPadding'
import {Button, ButtonIcon, ButtonText} from '../Button' import {Button, ButtonIcon, ButtonText} from '../Button'
@@ -142,7 +143,7 @@ function SubmitStep({
return ( return (
<View style={a.gap_lg}> <View style={a.gap_lg}>
<Button <BottomSheetButton
size="small" size="small"
variant="solid" variant="solid"
color="secondary" color="secondary"
@@ -150,7 +151,7 @@ function SubmitStep({
label={_(msg`Go back to previous step`)} label={_(msg`Go back to previous step`)}
onPress={goBack}> onPress={goBack}>
<ButtonIcon icon={Chevron} /> <ButtonIcon icon={Chevron} />
</Button> </BottomSheetButton>
<View style={[a.justify_center, gtMobile ? a.gap_sm : a.gap_xs]}> <View style={[a.justify_center, gtMobile ? a.gap_sm : a.gap_xs]}>
<Text style={[a.text_2xl, a.font_bold]}>{copy.title}</Text> <Text style={[a.text_2xl, a.font_bold]}>{copy.title}</Text>
@@ -157,7 +157,6 @@ let RepostButton = ({
</View> </View>
<BottomSheetButton <BottomSheetButton
label={_(msg`Cancel quote post`)} label={_(msg`Cancel quote post`)}
onAccessibilityEscape={close}
onPress={close} onPress={close}
size="large" size="large"
variant="solid" variant="solid"