diff --git a/assets/icons/dotGrid1x3Horizontal_stroke2_corner2_rounded.svg b/assets/icons/dotGrid1x3Horizontal_stroke2_corner2_rounded.svg new file mode 100644 index 0000000000..c3b456b100 --- /dev/null +++ b/assets/icons/dotGrid1x3Horizontal_stroke2_corner2_rounded.svg @@ -0,0 +1 @@ + diff --git a/src/alf/atoms.ts b/src/alf/atoms.ts index 43ee3bd51f..478a1b13e9 100644 --- a/src/alf/atoms.ts +++ b/src/alf/atoms.ts @@ -122,6 +122,9 @@ export const atoms = { flex_shrink: { flexShrink: 1, }, + justify_start: { + justifyContent: 'flex-start', + }, justify_center: { justifyContent: 'center', }, @@ -140,6 +143,24 @@ export const atoms = { align_end: { alignItems: 'flex-end', }, + self_auto: { + alignSelf: 'auto', + }, + self_start: { + alignSelf: 'flex-start', + }, + self_end: { + alignSelf: 'flex-end', + }, + self_center: { + alignSelf: 'center', + }, + self_stretch: { + alignSelf: 'stretch', + }, + self_baseline: { + alignSelf: 'baseline', + }, /* * Text diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 9428b6a063..4f9ac4dedb 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -361,7 +361,6 @@ export function Button({ disabled: disabled || false, }} style={[ - flatten(style), a.flex_row, a.align_center, a.justify_center, @@ -370,6 +369,7 @@ export function Button({ ...baseStyles, ...(state.hovered || state.pressed ? hoverStyles : []), ...(state.focused ? focusStyles : []), + flatten(style), ]} onPressIn={onPressIn} onPressOut={onPressOut} diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 63b0c73f1f..ee5c916958 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -13,7 +13,7 @@ import {sanitizeUrl} from '@braintree/sanitize-url' import {useInteractionState} from '#/components/hooks/useInteractionState' import {isWeb} from '#/platform/detection' -import {useTheme, web, flatten, TextStyleProp} from '#/alf' +import {useTheme, web, flatten, TextStyleProp, atoms as a} from '#/alf' import {Button, ButtonProps} from '#/components/Button' import {AllNavigatorParams, NavigationProp} from '#/lib/routes/types' import { @@ -35,6 +35,8 @@ type BaseLinkProps = Pick< Parameters>[0], 'to' > & { + testID?: string + /** * The React Navigation `StackAction` to perform when the link is pressed. */ @@ -46,6 +48,13 @@ type BaseLinkProps = Pick< * Note: atm this only works for `InlineLink`s with a string child. */ warnOnMismatchingTextChild?: boolean + + /** + * Callback for when the link is pressed. + * + * DO NOT use this for navigation, that's what the `to` prop is for. + */ + onPress?: (e: GestureResponderEvent) => void } export function useLink({ @@ -53,6 +62,7 @@ export function useLink({ displayText, action = 'push', warnOnMismatchingTextChild, + onPress: outerOnPress, }: BaseLinkProps & { displayText: string }) { @@ -66,6 +76,8 @@ export function useLink({ const onPress = React.useCallback( (e: GestureResponderEvent) => { + outerOnPress?.(e) + const requiresWarning = Boolean( warnOnMismatchingTextChild && displayText && @@ -143,7 +155,7 @@ export function useLink({ } export type LinkProps = Omit & - Omit & { + Omit & { /** * Label for a11y. Defaults to the href. */ @@ -169,6 +181,10 @@ export function Link({children, to, action = 'push', ...rest}: LinkProps) { + + + + + )} - - - - - - - - Moderation service - - + + - + style={[ + a.p_md, + t.atoms.bg_contrast_50, + a.rounded_md, + a.overflow_hidden, + ]}> + c[1])} + locations={tokens.gradients.bonfire.values.map(c => c[0])} + start={{x: 0, y: 0}} + end={{x: 1, y: 1}} + style={[a.absolute, a.inset_0]} + /> + + + + + + {/* A really long and complex title for a moderation service */} + {info.creator.displayName + ? sanitizeDisplayName(info.creator.displayName) + : sanitizeHandle(info.creator.handle, '@')} + + + + Moderation service + + + + + + {!isMobile && } - + ) } @@ -143,7 +150,7 @@ function CommonControls({ }: { info: AppBskyModerationDefs.ModServiceViewDetailed }) { - const pal = usePalette('default') + const t = useTheme() const {hasSession} = useSession() const {openModal} = useModalControls() const {_} = useLingui() @@ -199,8 +206,8 @@ function CommonControls({ items={dropdownItems} accessibilityLabel={_(msg`More options`)} accessibilityHint=""> - - + + @@ -229,4 +236,3 @@ const styles = StyleSheet.create({ borderRadius: 50, }, }) -