Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make proper extension of `Button` more clearly defined (#8753)

* Remove unecessary color prop from SettingsList LinkItem

* Add UninheritableButtonProps to avoid misuse

authored by

Eric Bailey and committed by
GitHub
b3d207c7 85981deb

+15 -3
+12
src/components/Button.tsx
··· 20 20 import {type Props as SVGIconProps} from '#/components/icons/common' 21 21 import {Text} from '#/components/Typography' 22 22 23 + /** 24 + * The `Button` component, and some extensions of it like `Link` are intended 25 + * to be generic and therefore apply no styles by default. These `VariantProps` 26 + * are what control the `Button`'s presentation, and are intended only use cases where the buttons appear as, well, buttons. 27 + * 28 + * If `Button` or an extension of it are used for other compound components, use this property to avoid misuse of these variant props further down the line. 29 + * 30 + * @example 31 + * type MyComponentProps = Omit<ButtonProps, UninheritableButtonProps> & {...} 32 + */ 33 + export type UninheritableButtonProps = 'variant' | 'color' | 'size' | 'shape' 34 + 23 35 export type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'gradient' 24 36 export type ButtonColor = 25 37 | 'primary'
+3 -3
src/screens/Settings/components/SettingsList.tsx
··· 124 124 contentContainerStyle, 125 125 chevronColor, 126 126 ...props 127 - }: LinkProps & { 127 + }: Omit<LinkProps, Button.UninheritableButtonProps> & { 128 128 contentContainerStyle?: StyleProp<ViewStyle> 129 129 destructive?: boolean 130 130 chevronColor?: string ··· 132 132 const t = useTheme() 133 133 134 134 return ( 135 - <Link color="secondary" {...props}> 135 + <Link {...props}> 136 136 {args => ( 137 137 <Item 138 138 destructive={destructive} ··· 154 154 contentContainerStyle, 155 155 hoverStyle, 156 156 ...props 157 - }: Button.ButtonProps & { 157 + }: Omit<Button.ButtonProps, Button.UninheritableButtonProps> & { 158 158 contentContainerStyle?: StyleProp<ViewStyle> 159 159 destructive?: boolean 160 160 }) {