remove use of flatten where possible
This commit is contained in:
@@ -7,7 +7,6 @@ import {
|
|||||||
Pressable,
|
Pressable,
|
||||||
type PressableProps,
|
type PressableProps,
|
||||||
type StyleProp,
|
type StyleProp,
|
||||||
StyleSheet,
|
|
||||||
type TargetedEvent,
|
type TargetedEvent,
|
||||||
type TextProps,
|
type TextProps,
|
||||||
type TextStyle,
|
type TextStyle,
|
||||||
@@ -512,8 +511,6 @@ export const Button = React.forwardRef<View, ButtonProps>(
|
|||||||
[state, variant, color, size, disabled],
|
[state, variant, color, size, disabled],
|
||||||
)
|
)
|
||||||
|
|
||||||
const flattenedBaseStyles = flatten([baseStyles, style])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PressableComponent
|
<PressableComponent
|
||||||
role="button"
|
role="button"
|
||||||
@@ -533,9 +530,10 @@ export const Button = React.forwardRef<View, ButtonProps>(
|
|||||||
a.align_center,
|
a.align_center,
|
||||||
a.justify_center,
|
a.justify_center,
|
||||||
a.curve_continuous,
|
a.curve_continuous,
|
||||||
flattenedBaseStyles,
|
baseStyles,
|
||||||
|
style,
|
||||||
...(state.hovered || state.pressed
|
...(state.hovered || state.pressed
|
||||||
? [hoverStyles, flatten(hoverStyleProp)]
|
? [hoverStyles, hoverStyleProp]
|
||||||
: []),
|
: []),
|
||||||
]}
|
]}
|
||||||
onPressIn={onPressIn}
|
onPressIn={onPressIn}
|
||||||
@@ -726,7 +724,7 @@ export function useSharedButtonTextStyles() {
|
|||||||
baseStyles.push(a.text_xs, a.leading_snug, a.font_semi_bold)
|
baseStyles.push(a.text_xs, a.leading_snug, a.font_semi_bold)
|
||||||
}
|
}
|
||||||
|
|
||||||
return StyleSheet.flatten(baseStyles)
|
return flatten(baseStyles)
|
||||||
}, [t, variant, color, size, disabled])
|
}, [t, variant, color, size, disabled])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {RemoveScrollBar} from 'react-remove-scroll-bar'
|
|||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useA11y} from '#/state/a11y'
|
import {useA11y} from '#/state/a11y'
|
||||||
import {useDialogStateControlContext} from '#/state/dialogs'
|
import {useDialogStateControlContext} from '#/state/dialogs'
|
||||||
import {atoms as a, flatten, useBreakpoints, useTheme, web} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme, web} from '#/alf'
|
||||||
import {Button, ButtonIcon} from '#/components/Button'
|
import {Button, ButtonIcon} from '#/components/Button'
|
||||||
import {Context} from '#/components/Dialog/context'
|
import {Context} from '#/components/Dialog/context'
|
||||||
import {
|
import {
|
||||||
@@ -180,7 +180,7 @@ export function Inner({
|
|||||||
onClick={stopPropagation}
|
onClick={stopPropagation}
|
||||||
onStartShouldSetResponder={_ => true}
|
onStartShouldSetResponder={_ => true}
|
||||||
onTouchEnd={stopPropagation}
|
onTouchEnd={stopPropagation}
|
||||||
style={flatten([
|
style={[
|
||||||
a.relative,
|
a.relative,
|
||||||
a.rounded_md,
|
a.rounded_md,
|
||||||
a.w_full,
|
a.w_full,
|
||||||
@@ -195,7 +195,7 @@ export function Inner({
|
|||||||
},
|
},
|
||||||
!reduceMotionEnabled && a.zoom_fade_in,
|
!reduceMotionEnabled && a.zoom_fade_in,
|
||||||
style,
|
style,
|
||||||
])}>
|
]}>
|
||||||
<DismissableLayer.DismissableLayer
|
<DismissableLayer.DismissableLayer
|
||||||
onInteractOutside={preventDefault}
|
onInteractOutside={preventDefault}
|
||||||
onFocusOutside={preventDefault}
|
onFocusOutside={preventDefault}
|
||||||
@@ -244,7 +244,7 @@ export const InnerFlatList = React.forwardRef<
|
|||||||
contentContainerStyle={[a.h_full, a.px_0, webInnerContentContainerStyle]}>
|
contentContainerStyle={[a.h_full, a.px_0, webInnerContentContainerStyle]}>
|
||||||
<FlatList
|
<FlatList
|
||||||
ref={ref}
|
ref={ref}
|
||||||
style={[a.h_full, gtMobile ? a.px_2xl : a.px_xl, flatten(style)]}
|
style={[a.h_full, gtMobile ? a.px_2xl : a.px_xl, style]}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
{footer}
|
{footer}
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ export function Description({
|
|||||||
return rt
|
return rt
|
||||||
}, [description])
|
}, [description])
|
||||||
if (!rt) return null
|
if (!rt) return null
|
||||||
return <RichText value={rt} style={[a.leading_snug]} disableLinks {...rest} />
|
return <RichText value={rt} disableLinks {...rest} />
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DescriptionPlaceholder() {
|
export function DescriptionPlaceholder() {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import {View} from 'react-native'
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
atoms as a,
|
atoms as a,
|
||||||
flatten,
|
|
||||||
type TextStyleProp,
|
type TextStyleProp,
|
||||||
useTheme,
|
useTheme,
|
||||||
type ViewStyleProp,
|
type ViewStyleProp,
|
||||||
@@ -33,17 +32,9 @@ export function IconCircle({
|
|||||||
height: size === 'lg' ? 52 : 64,
|
height: size === 'lg' ? 52 : 64,
|
||||||
backgroundColor: t.palette.primary_50,
|
backgroundColor: t.palette.primary_50,
|
||||||
},
|
},
|
||||||
flatten(style),
|
style,
|
||||||
]}>
|
]}>
|
||||||
<Icon
|
<Icon size={size} style={[{color: t.palette.primary_500}, iconStyle]} />
|
||||||
size={size}
|
|
||||||
style={[
|
|
||||||
{
|
|
||||||
color: t.palette.primary_500,
|
|
||||||
},
|
|
||||||
flatten(iconStyle),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export function Description({value, handle}: {value?: string; handle: string}) {
|
|||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
return value ? (
|
return value ? (
|
||||||
<Text numberOfLines={2}>
|
<Text numberOfLines={2}>
|
||||||
<RichText value={value} style={[a.leading_snug]} />
|
<RichText value={value} />
|
||||||
</Text>
|
</Text>
|
||||||
) : (
|
) : (
|
||||||
<Text emoji style={[a.leading_snug]}>
|
<Text emoji style={[a.leading_snug]}>
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ export function Link({
|
|||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
{...rest}
|
{...rest}
|
||||||
style={[a.justify_start, flatten(rest.style)]}
|
style={[a.justify_start, rest.style]}
|
||||||
role="link"
|
role="link"
|
||||||
accessibilityRole="link"
|
accessibilityRole="link"
|
||||||
href={href}
|
href={href}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {useLingui} from '@lingui/react'
|
|||||||
|
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {CenteredView} from '#/view/com/util/Views'
|
import {CenteredView} from '#/view/com/util/Views'
|
||||||
import {atoms as a, flatten, useBreakpoints, useTheme} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import {Error} from '#/components/Error'
|
import {Error} from '#/components/Error'
|
||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
@@ -43,7 +43,7 @@ export function ListFooter({
|
|||||||
a.pb_lg,
|
a.pb_lg,
|
||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
{height: height ?? 180, paddingTop: 30},
|
{height: height ?? 180, paddingTop: 30},
|
||||||
flatten(style),
|
style,
|
||||||
]}>
|
]}>
|
||||||
{isFetchingNextPage ? (
|
{isFetchingNextPage ? (
|
||||||
<Loader size="xl" />
|
<Loader size="xl" />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Animated, {
|
|||||||
withTiming,
|
withTiming,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
|
|
||||||
import {atoms as a, flatten, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {type Props, useCommonSVGProps} from '#/components/icons/common'
|
import {type Props, useCommonSVGProps} from '#/components/icons/common'
|
||||||
import {Loader_Stroke2_Corner0_Rounded as Icon} from '#/components/icons/Loader'
|
import {Loader_Stroke2_Corner0_Rounded as Icon} from '#/components/icons/Loader'
|
||||||
|
|
||||||
@@ -37,12 +37,7 @@ export function Loader(props: Props) {
|
|||||||
]}>
|
]}>
|
||||||
<Icon
|
<Icon
|
||||||
{...props}
|
{...props}
|
||||||
style={[
|
style={[a.absolute, a.inset_0, t.atoms.text_contrast_high, props.style]}
|
||||||
a.absolute,
|
|
||||||
a.inset_0,
|
|
||||||
t.atoms.text_contrast_high,
|
|
||||||
flatten(props.style),
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
|
|
||||||
import {atoms as a, flatten, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {type Props, useCommonSVGProps} from '#/components/icons/common'
|
import {type Props, useCommonSVGProps} from '#/components/icons/common'
|
||||||
import {Loader_Stroke2_Corner0_Rounded as Icon} from '#/components/icons/Loader'
|
import {Loader_Stroke2_Corner0_Rounded as Icon} from '#/components/icons/Loader'
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ export function Loader(props: Props) {
|
|||||||
a.absolute,
|
a.absolute,
|
||||||
a.inset_0,
|
a.inset_0,
|
||||||
t.atoms.text_contrast_high,
|
t.atoms.text_contrast_high,
|
||||||
flatten(props.style),
|
props.style,
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ export function Item({children, label, onPress, style, ...rest}: ItemProps) {
|
|||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
// need `flatten` here for Radix compat
|
// need `flatten` here for Radix compat
|
||||||
style={flatten([
|
style={[
|
||||||
a.flex_row,
|
a.flex_row,
|
||||||
a.align_center,
|
a.align_center,
|
||||||
a.gap_lg,
|
a.gap_lg,
|
||||||
@@ -272,7 +272,7 @@ export function Item({children, label, onPress, style, ...rest}: ItemProps) {
|
|||||||
: t.atoms.bg_contrast_50,
|
: t.atoms.bg_contrast_50,
|
||||||
],
|
],
|
||||||
style,
|
style,
|
||||||
])}
|
]}
|
||||||
{...web({
|
{...web({
|
||||||
onMouseEnter,
|
onMouseEnter,
|
||||||
onMouseLeave,
|
onMouseLeave,
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ import {
|
|||||||
useSafeAreaInsets,
|
useSafeAreaInsets,
|
||||||
} from 'react-native-safe-area-context'
|
} from 'react-native-safe-area-context'
|
||||||
import {LinearGradient} from 'expo-linear-gradient'
|
import {LinearGradient} from 'expo-linear-gradient'
|
||||||
|
import {utils} from '@bsky.app/alf'
|
||||||
|
|
||||||
import {isAndroid, isNative} from '#/platform/detection'
|
import {isAndroid, isNative} from '#/platform/detection'
|
||||||
import {useA11y} from '#/state/a11y'
|
import {useA11y} from '#/state/a11y'
|
||||||
import {atoms as a, flatten, useBreakpoints, useTheme, web} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme, web} from '#/alf'
|
||||||
import {transparentifyColor} from '#/alf/util/colorGeneration'
|
|
||||||
import {FocusScope} from '#/components/FocusScope'
|
import {FocusScope} from '#/components/FocusScope'
|
||||||
import {LockScroll} from '#/components/LockScroll'
|
import {LockScroll} from '#/components/LockScroll'
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ export function Overlay({
|
|||||||
]}>
|
]}>
|
||||||
<LinearGradient
|
<LinearGradient
|
||||||
colors={[
|
colors={[
|
||||||
transparentifyColor(t.atoms.bg.backgroundColor, 0),
|
utils.alpha(t.atoms.bg.backgroundColor, 0),
|
||||||
t.atoms.bg.backgroundColor,
|
t.atoms.bg.backgroundColor,
|
||||||
]}
|
]}
|
||||||
start={[0.5, 0]}
|
start={[0.5, 0]}
|
||||||
@@ -113,7 +113,7 @@ export function Overlay({
|
|||||||
role="dialog"
|
role="dialog"
|
||||||
aria-role="dialog"
|
aria-role="dialog"
|
||||||
aria-label={label}
|
aria-label={label}
|
||||||
style={flatten([
|
style={[
|
||||||
a.relative,
|
a.relative,
|
||||||
a.w_full,
|
a.w_full,
|
||||||
a.p_2xl,
|
a.p_2xl,
|
||||||
@@ -128,7 +128,7 @@ export function Overlay({
|
|||||||
maxWidth: 420,
|
maxWidth: 420,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
])}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
</FocusScope>
|
</FocusScope>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {memo, useState} from 'react'
|
import {memo, useMemo, useState} from 'react'
|
||||||
import {type StyleProp, View, type ViewStyle} from 'react-native'
|
import {type StyleProp, View, type ViewStyle} from 'react-native'
|
||||||
import {
|
import {
|
||||||
type AppBskyFeedDefs,
|
type AppBskyFeedDefs,
|
||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
useProgressGuideControls,
|
useProgressGuideControls,
|
||||||
} from '#/state/shell/progress-guide'
|
} from '#/state/shell/progress-guide'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import {atoms as a, flatten, useBreakpoints} from '#/alf'
|
import {atoms as a, useBreakpoints} from '#/alf'
|
||||||
import {Reply as Bubble} from '#/components/icons/Reply'
|
import {Reply as Bubble} from '#/components/icons/Reply'
|
||||||
import {useFormatPostStatCount} from '#/components/PostControls/util'
|
import {useFormatPostStatCount} from '#/components/PostControls/util'
|
||||||
import {BookmarkButton} from './BookmarkButton'
|
import {BookmarkButton} from './BookmarkButton'
|
||||||
@@ -188,11 +188,12 @@ let PostControls = ({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const secondaryControlSpacingStyles = flatten([
|
const secondaryControlSpacingStyles = useMemo(() => {
|
||||||
{gap: 0}, // default, we want `gap` to be defined on the resulting object
|
let gap = 0 // default, we want `gap` to be defined on the resulting object
|
||||||
variant !== 'compact' && a.gap_xs,
|
if (variant !== 'compact') gap = a.gap_xs.gap
|
||||||
(big || gtPhone) && a.gap_sm,
|
if (big || gtPhone) gap = a.gap_sm.gap
|
||||||
])
|
return {gap}
|
||||||
|
}, [variant, big, gtPhone])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ export function Description({
|
|||||||
<View style={[a.pt_xs]}>
|
<View style={[a.pt_xs]}>
|
||||||
<RichText
|
<RichText
|
||||||
value={rt}
|
value={rt}
|
||||||
style={[a.leading_snug, style]}
|
style={style}
|
||||||
numberOfLines={numberOfLines}
|
numberOfLines={numberOfLines}
|
||||||
disableLinks
|
disableLinks
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -48,18 +48,14 @@ export function RichText({
|
|||||||
[value],
|
[value],
|
||||||
)
|
)
|
||||||
|
|
||||||
const flattenedStyle = flatten(style)
|
const plainStyles = [a.leading_snug, style]
|
||||||
const plainStyles = [a.leading_snug, flattenedStyle]
|
const interactiveStyles = [plainStyles, interactiveStyle]
|
||||||
const interactiveStyles = [
|
|
||||||
a.leading_snug,
|
|
||||||
flatten(interactiveStyle),
|
|
||||||
flattenedStyle,
|
|
||||||
]
|
|
||||||
|
|
||||||
const {text, facets} = richText
|
const {text, facets} = richText
|
||||||
|
|
||||||
if (!facets?.length) {
|
if (!facets?.length) {
|
||||||
if (isOnlyEmoji(text)) {
|
if (isOnlyEmoji(text)) {
|
||||||
|
const flattenedStyle = flatten(style)
|
||||||
const fontSize =
|
const fontSize =
|
||||||
(flattenedStyle.fontSize ?? a.text_sm.fontSize) * emojiMultiplier
|
(flattenedStyle.fontSize ?? a.text_sm.fontSize) * emojiMultiplier
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {Children, createContext, useContext, useMemo} from 'react'
|
import {Children, createContext, useContext, useMemo} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
|
import {utils} from '@bsky.app/alf'
|
||||||
import {Popover} from 'radix-ui'
|
import {Popover} from 'radix-ui'
|
||||||
|
|
||||||
import {atoms as a, flatten, select, useTheme} from '#/alf'
|
import {atoms as a, flatten, select, useTheme} from '#/alf'
|
||||||
import {transparentifyColor} from '#/alf/util/colorGeneration'
|
|
||||||
import {
|
import {
|
||||||
ARROW_SIZE,
|
ARROW_SIZE,
|
||||||
BUBBLE_MAX_WIDTH,
|
BUBBLE_MAX_WIDTH,
|
||||||
@@ -80,9 +80,9 @@ export function Content({
|
|||||||
{
|
{
|
||||||
minWidth: 'max-content',
|
minWidth: 'max-content',
|
||||||
boxShadow: select(t.name, {
|
boxShadow: select(t.name, {
|
||||||
light: `0 0 24px ${transparentifyColor(t.palette.black, 0.2)}`,
|
light: `0 0 24px ${utils.alpha(t.palette.black, 0.2)}`,
|
||||||
dark: `0 0 24px ${transparentifyColor(t.palette.black, 0.2)}`,
|
dark: `0 0 24px ${utils.alpha(t.palette.black, 0.2)}`,
|
||||||
dim: `0 0 24px ${transparentifyColor(t.palette.black, 0.2)}`,
|
dim: `0 0 24px ${utils.alpha(t.palette.black, 0.2)}`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
])}>
|
])}>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {UITextView} from 'react-native-uitextview'
|
import {UITextView} from 'react-native-uitextview'
|
||||||
|
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {atoms, flatten, useAlf, useTheme, web} from '#/alf'
|
import {atoms, useAlf, useTheme, web} from '#/alf'
|
||||||
import {
|
import {
|
||||||
childHasEmoji,
|
childHasEmoji,
|
||||||
normalizeTextStyles,
|
normalizeTextStyles,
|
||||||
@@ -26,7 +26,7 @@ export function Text({
|
|||||||
}: TextProps) {
|
}: TextProps) {
|
||||||
const {fonts, flags} = useAlf()
|
const {fonts, flags} = useAlf()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const s = normalizeTextStyles([atoms.text_sm, t.atoms.text, flatten(style)], {
|
const s = normalizeTextStyles([atoms.text_sm, t.atoms.text, style], {
|
||||||
fontScale: fonts.scaleMultiplier,
|
fontScale: fonts.scaleMultiplier,
|
||||||
fontFamily: fonts.family,
|
fontFamily: fonts.family,
|
||||||
flags,
|
flags,
|
||||||
@@ -84,7 +84,7 @@ export function P({style, ...rest}: TextProps) {
|
|||||||
<Text
|
<Text
|
||||||
{...attr}
|
{...attr}
|
||||||
{...rest}
|
{...rest}
|
||||||
style={[atoms.text_md, atoms.leading_normal, flatten(style)]}
|
style={[atoms.text_md, atoms.leading_relaxed, style]}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {FocusGuards, FocusScope} from 'radix-ui/internal'
|
|||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||||
import {Logo} from '#/view/icons/Logo'
|
import {Logo} from '#/view/icons/Logo'
|
||||||
import {atoms as a, flatten, useBreakpoints, web} from '#/alf'
|
import {atoms as a, useBreakpoints, web} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import {TimesLarge_Stroke2_Corner0_Rounded as XIcon} from '#/components/icons/Times'
|
import {TimesLarge_Stroke2_Corner0_Rounded as XIcon} from '#/components/icons/Times'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
@@ -78,7 +78,7 @@ export function WelcomeModal({control}: WelcomeModalProps) {
|
|||||||
]}>
|
]}>
|
||||||
<FocusScope.FocusScope asChild loop trapped>
|
<FocusScope.FocusScope asChild loop trapped>
|
||||||
<View
|
<View
|
||||||
style={flatten([
|
style={[
|
||||||
{
|
{
|
||||||
maxWidth: 800,
|
maxWidth: 800,
|
||||||
maxHeight: 600,
|
maxHeight: 600,
|
||||||
@@ -89,7 +89,7 @@ export function WelcomeModal({control}: WelcomeModalProps) {
|
|||||||
a.rounded_lg,
|
a.rounded_lg,
|
||||||
a.overflow_hidden,
|
a.overflow_hidden,
|
||||||
a.zoom_in,
|
a.zoom_in,
|
||||||
])}>
|
]}>
|
||||||
<ImageBackground
|
<ImageBackground
|
||||||
source={welcomeModalBg}
|
source={welcomeModalBg}
|
||||||
style={[a.flex_1, a.justify_center]}
|
style={[a.flex_1, a.justify_center]}
|
||||||
|
|||||||
@@ -134,12 +134,12 @@ function MenuInner({
|
|||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
role="button"
|
role="button"
|
||||||
onPress={() => setExpanded(true)}
|
onPress={() => setExpanded(true)}
|
||||||
style={flatten([
|
style={[
|
||||||
a.rounded_full,
|
a.rounded_full,
|
||||||
{height: 34, width: 34},
|
{height: 34, width: 34},
|
||||||
a.justify_center,
|
a.justify_center,
|
||||||
a.align_center,
|
a.align_center,
|
||||||
])}>
|
]}>
|
||||||
<DotGridIcon size="lg" style={t.atoms.text_contrast_medium} />
|
<DotGridIcon size="lg" style={t.atoms.text_contrast_medium} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ function PreviewMessage({message}: {message: ChatBskyConvoDefs.MessageView}) {
|
|||||||
]}>
|
]}>
|
||||||
<RichText
|
<RichText
|
||||||
value={rt}
|
value={rt}
|
||||||
style={[a.text_md, a.leading_snug]}
|
style={[a.text_md]}
|
||||||
interactiveStyle={a.underline}
|
interactiveStyle={a.underline}
|
||||||
enableTags
|
enableTags
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {HITSLOP_10} from '#/lib/constants'
|
|||||||
import {isNative} from '#/platform/detection'
|
import {isNative} from '#/platform/detection'
|
||||||
import {
|
import {
|
||||||
atoms as a,
|
atoms as a,
|
||||||
flatten,
|
|
||||||
native,
|
native,
|
||||||
type TextStyleProp,
|
type TextStyleProp,
|
||||||
useTheme,
|
useTheme,
|
||||||
@@ -233,7 +232,7 @@ export function Item({
|
|||||||
onPressOut={onPressOut}
|
onPressOut={onPressOut}
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
style={[a.flex_row, a.align_center, a.gap_sm, flatten(style)]}>
|
style={[a.flex_row, a.align_center, a.gap_sm, style]}>
|
||||||
{typeof children === 'function' ? children(state) : children}
|
{typeof children === 'function' ? children(state) : children}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</ItemContext.Provider>
|
</ItemContext.Provider>
|
||||||
@@ -260,7 +259,7 @@ export function LabelText({
|
|||||||
native({
|
native({
|
||||||
paddingTop: 2,
|
paddingTop: 2,
|
||||||
}),
|
}),
|
||||||
flatten(style),
|
style,
|
||||||
]}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export function createSinglePathSVG({path}: {path: string}) {
|
|||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
width={size}
|
width={size}
|
||||||
height={size}
|
height={size}
|
||||||
style={[style]}>
|
style={style}>
|
||||||
{gradient}
|
{gradient}
|
||||||
<Path fill={fill} fillRule="evenodd" clipRule="evenodd" d={path} />
|
<Path fill={fill} fillRule="evenodd" clipRule="evenodd" d={path} />
|
||||||
</Svg>
|
</Svg>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {Pressable, StyleSheet, View} from 'react-native'
|
import {Pressable, View} from 'react-native'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import Graphemer from 'graphemer'
|
import Graphemer from 'graphemer'
|
||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
type EmojiPickerPosition,
|
type EmojiPickerPosition,
|
||||||
} from '#/view/com/composer/text-input/web/EmojiPicker'
|
} from '#/view/com/composer/text-input/web/EmojiPicker'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, flatten, useTheme} from '#/alf'
|
||||||
import {Button} from '#/components/Button'
|
import {Button} from '#/components/Button'
|
||||||
import {useSharedInputStyles} from '#/components/forms/TextField'
|
import {useSharedInputStyles} from '#/components/forms/TextField'
|
||||||
import {EmojiArc_Stroke2_Corner0_Rounded as EmojiSmile} from '#/components/icons/Emoji'
|
import {EmojiArc_Stroke2_Corner0_Rounded as EmojiSmile} from '#/components/icons/Emoji'
|
||||||
@@ -199,7 +199,7 @@ export function MessageInput({
|
|||||||
</Button>
|
</Button>
|
||||||
<TextareaAutosize
|
<TextareaAutosize
|
||||||
ref={textAreaRef}
|
ref={textAreaRef}
|
||||||
style={StyleSheet.flatten([
|
style={flatten([
|
||||||
a.flex_1,
|
a.flex_1,
|
||||||
a.px_sm,
|
a.px_sm,
|
||||||
a.border_0,
|
a.border_0,
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import {useOnboardingDispatch} from '#/state/shell'
|
|||||||
import {Context} from '#/screens/Onboarding/state'
|
import {Context} from '#/screens/Onboarding/state'
|
||||||
import {
|
import {
|
||||||
atoms as a,
|
atoms as a,
|
||||||
flatten,
|
|
||||||
native,
|
native,
|
||||||
type TextStyleProp,
|
type TextStyleProp,
|
||||||
tokens,
|
tokens,
|
||||||
@@ -228,13 +227,7 @@ export function TitleText({
|
|||||||
}: React.PropsWithChildren<TextStyleProp>) {
|
}: React.PropsWithChildren<TextStyleProp>) {
|
||||||
return (
|
return (
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[a.pb_sm, a.text_4xl, a.font_semi_bold, a.leading_tight, style]}>
|
||||||
a.pb_sm,
|
|
||||||
a.text_4xl,
|
|
||||||
a.font_semi_bold,
|
|
||||||
a.leading_tight,
|
|
||||||
flatten(style),
|
|
||||||
]}>
|
|
||||||
{children}
|
{children}
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
@@ -245,7 +238,5 @@ export function DescriptionText({
|
|||||||
style,
|
style,
|
||||||
}: React.PropsWithChildren<TextStyleProp>) {
|
}: React.PropsWithChildren<TextStyleProp>) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
return (
|
return <P style={[t.atoms.text_contrast_medium, style]}>{children}</P>
|
||||||
<P style={[t.atoms.text_contrast_medium, flatten(style)]}>{children}</P>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ function DialogInner({
|
|||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<RichText value={rt} style={[a.text_md, a.leading_snug]} />
|
<RichText value={rt} style={[a.text_md]} />
|
||||||
|
|
||||||
<View style={[a.flex_row, a.gap_sm, a.align_center]}>
|
<View style={[a.flex_row, a.gap_sm, a.align_center]}>
|
||||||
{typeof likeCount === 'number' && (
|
{typeof likeCount === 'number' && (
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ export function Header({
|
|||||||
</ProfileSubpageHeader>
|
</ProfileSubpageHeader>
|
||||||
{descriptionRT ? (
|
{descriptionRT ? (
|
||||||
<View style={[a.px_lg, a.pt_sm, a.pb_sm, a.gap_md]}>
|
<View style={[a.px_lg, a.pt_sm, a.pb_sm, a.gap_md]}>
|
||||||
<RichText value={descriptionRT} style={[a.text_md, a.leading_snug]} />
|
<RichText value={descriptionRT} style={[a.text_md]} />
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -458,9 +458,7 @@ function Header({
|
|||||||
</ProfileSubpageHeader>
|
</ProfileSubpageHeader>
|
||||||
{!hasSession || richText || joinedAllTimeCount >= 25 ? (
|
{!hasSession || richText || joinedAllTimeCount >= 25 ? (
|
||||||
<View style={[a.px_lg, a.pt_md, a.pb_sm, a.gap_md]}>
|
<View style={[a.px_lg, a.pt_md, a.pb_sm, a.gap_md]}>
|
||||||
{richText ? (
|
{richText ? <RichText value={richText} style={[a.text_md]} /> : null}
|
||||||
<RichText value={richText} style={[a.text_md, a.leading_snug]} />
|
|
||||||
) : null}
|
|
||||||
{!hasSession ? (
|
{!hasSession ? (
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Join Bluesky`)}
|
label={_(msg`Join Bluesky`)}
|
||||||
|
|||||||
@@ -955,7 +955,7 @@ function ExpandableRichTextView({
|
|||||||
]}>
|
]}>
|
||||||
<RichText
|
<RichText
|
||||||
value={value}
|
value={value}
|
||||||
style={[a.text_sm, a.flex_1, a.leading_normal]}
|
style={[a.text_sm, a.flex_1, a.leading_relaxed]}
|
||||||
authorHandle={authorHandle}
|
authorHandle={authorHandle}
|
||||||
enableTags
|
enableTags
|
||||||
numberOfLines={
|
numberOfLines={
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {type StyleProp, StyleSheet, View, type ViewStyle} from 'react-native'
|
import {type StyleProp, View, type ViewStyle} from 'react-native'
|
||||||
import {type AnimatedRef, useAnimatedRef} from 'react-native-reanimated'
|
import {type AnimatedRef, useAnimatedRef} from 'react-native-reanimated'
|
||||||
import {type AppBskyEmbedImages} from '@atproto/api'
|
import {type AppBskyEmbedImages} from '@atproto/api'
|
||||||
|
|
||||||
@@ -224,5 +224,5 @@ function noCorners(
|
|||||||
if (corners.includes('bottomRight')) {
|
if (corners.includes('bottomRight')) {
|
||||||
styles.push({borderBottomRightRadius: 0})
|
styles.push({borderBottomRightRadius: 0})
|
||||||
}
|
}
|
||||||
return StyleSheet.flatten(styles)
|
return styles
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {StyleSheet, type TextProps} from 'react-native'
|
import {type TextProps} from 'react-native'
|
||||||
import Svg, {
|
import Svg, {
|
||||||
Defs,
|
Defs,
|
||||||
LinearGradient,
|
LinearGradient,
|
||||||
@@ -12,6 +12,7 @@ import {Image} from 'expo-image'
|
|||||||
|
|
||||||
import {colors} from '#/lib/styles'
|
import {colors} from '#/lib/styles'
|
||||||
import {useKawaiiMode} from '#/state/preferences/kawaii'
|
import {useKawaiiMode} from '#/state/preferences/kawaii'
|
||||||
|
import {flatten} from '#/alf'
|
||||||
|
|
||||||
const ratio = 57 / 64
|
const ratio = 57 / 64
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ type Props = {
|
|||||||
export const Logo = React.forwardRef(function LogoImpl(props: Props, ref) {
|
export const Logo = React.forwardRef(function LogoImpl(props: Props, ref) {
|
||||||
const {fill, ...rest} = props
|
const {fill, ...rest} = props
|
||||||
const gradient = fill === 'sky'
|
const gradient = fill === 'sky'
|
||||||
const styles = StyleSheet.flatten(props.style)
|
const styles = flatten(props.style)
|
||||||
const _fill = gradient ? 'url(#sky)' : fill || styles?.color || colors.blue3
|
const _fill = gradient ? 'url(#sky)' : fill || styles?.color || colors.blue3
|
||||||
// @ts-ignore it's fiiiiine
|
// @ts-ignore it's fiiiiine
|
||||||
const size = parseInt(rest.width || 32)
|
const size = parseInt(rest.width || 32)
|
||||||
|
|||||||
Reference in New Issue
Block a user