diff --git a/src/components/AccountList.tsx b/src/components/AccountList.tsx --- a/src/components/AccountList.tsx +++ b/src/components/AccountList.tsx @@ -8,6 +8,7 @@ import {isJwtExpired} from '#/lib/jwt' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useProfilesQuery} from '#/state/queries/profile' import {type SessionAccount, useSession} from '#/state/session' import {UserAvatar} from '#/view/com/util/UserAvatar' @@ -34,6 +35,7 @@ const {currentAccount, accounts} = useSession() const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() const {data: profiles} = useProfilesQuery({ handles: accounts.map(acc => acc.did), }) @@ -81,7 +83,7 @@ { onSelect(account) @@ -201,7 +204,7 @@ height: 20, backgroundColor: t.palette.positive_500, }, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.justify_center, a.align_center, ]}> diff --git a/src/components/BlockedGeoOverlay.tsx b/src/components/BlockedGeoOverlay.tsx --- a/src/components/BlockedGeoOverlay.tsx +++ b/src/components/BlockedGeoOverlay.tsx @@ -7,6 +7,7 @@ import {logger} from '#/logger' import {isWeb} from '#/platform/detection' import {useDeviceGeolocationApi} from '#/state/geolocation' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' @@ -27,6 +28,8 @@ const insets = useSafeAreaInsets() const geoDialog = Dialog.useDialogControl() const {setDeviceGeolocation} = useDeviceGeolocationApi() + + const enableSquareButtons = useEnableSquareButtons() useEffect(() => { // just counting overall hits here @@ -85,7 +88,7 @@ a.pl_md, a.pr_lg, a.py_sm, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.flex_row, a.align_center, a.gap_xs, diff --git a/src/components/Button.tsx b/src/components/Button.tsx --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -14,6 +14,7 @@ type ViewStyle, } from 'react-native' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, flatten, select, useTheme} from '#/alf' import {type Props as SVGIconProps} from '#/components/icons/common' import {Text} from '#/components/Typography' @@ -150,6 +151,8 @@ if (!variant && color) { variant = 'solid' } + + const enableSquareButtons = useEnableSquareButtons() const t = useTheme() const [state, setState] = React.useState({ @@ -440,19 +443,19 @@ if (shape === 'default') { if (size === 'large') { - baseStyles.push(a.rounded_full, { + baseStyles.push(enableSquareButtons ? a.rounded_sm : a.rounded_full, { paddingVertical: 12, paddingHorizontal: 24, gap: 6, }) } else if (size === 'small') { - baseStyles.push(a.rounded_full, { + baseStyles.push(enableSquareButtons ? a.rounded_sm : a.rounded_full, { paddingVertical: 8, paddingHorizontal: 14, gap: 5, }) } else if (size === 'tiny') { - baseStyles.push(a.rounded_full, { + baseStyles.push(enableSquareButtons ? a.rounded_sm : a.rounded_full, { paddingVertical: 5, paddingHorizontal: 10, gap: 3, @@ -507,7 +510,7 @@ } if (shape === 'round') { - baseStyles.push(a.rounded_full) + baseStyles.push(enableSquareButtons ? a.rounded_sm : a.rounded_full) } else if (shape === 'square') { if (size === 'tiny') { baseStyles.push({ @@ -523,7 +526,7 @@ baseStyles, hoverStyles, } - }, [t, variant, color, size, shape, disabled]) + }, [t, variant, color, size, shape, disabled, enableSquareButtons]) const context = React.useMemo( () => ({ diff --git a/src/components/IconCircle.tsx b/src/components/IconCircle.tsx --- a/src/components/IconCircle.tsx +++ b/src/components/IconCircle.tsx @@ -1,5 +1,6 @@ import {View} from 'react-native' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { atoms as a, type TextStyleProp, @@ -20,13 +21,14 @@ iconStyle?: TextStyleProp['style'] }) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( ([]) const [tabOffsets, setTabOffsets] = useState<{x: number; width: number}[]>([]) + + const enableSquareButtons = useEnableSquareButtons() const onInitialLayout = useNonReactiveCallback(() => { const index = interests.indexOf(selectedInterest) @@ -264,7 +267,7 @@ t.atoms.bg, a.h_full, a.aspect_square, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, ]}> @@ -298,7 +301,7 @@ t.atoms.bg, a.h_full, a.aspect_square, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, ]}> @@ -325,6 +328,7 @@ }) { const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() const label = active ? _( msg({ @@ -355,7 +359,7 @@ {({hovered, pressed, focused}) => ( { switch (size) { case 'lg': { @@ -116,7 +119,7 @@ style={[ a.flex_row, a.align_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, outer, (hovered || pressed) && t.atoms.bg_contrast_50, ]}> diff --git a/src/components/TrendingTopics.tsx b/src/components/TrendingTopics.tsx --- a/src/components/TrendingTopics.tsx +++ b/src/components/TrendingTopics.tsx @@ -5,6 +5,7 @@ import {useLingui} from '@lingui/react' import {PressableScale} from '#/lib/custom-animations/PressableScale' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' // import {makeProfileLink} from '#/lib/routes/links' // import {feedUriToHref} from '#/lib/strings/url-helpers' // import {Hashtag_Stroke2_Corner0_Rounded as Hashtag} from '#/components/icons/Hashtag' @@ -28,12 +29,14 @@ const hasIcon = topic.type === 'starter-pack' && !isSmall const iconSize = 20 + const enableSquareButtons = useEnableSquareButtons() + return ( { @@ -133,7 +136,7 @@ size="small" variant="ghost" color="primary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={onShare} hitSlop={HITSLOP_10} style={[{right: -3}]}> diff --git a/src/screens/Topic.tsx b/src/screens/Topic.tsx --- a/src/screens/Topic.tsx +++ b/src/screens/Topic.tsx @@ -12,6 +12,7 @@ import {shareUrl} from '#/lib/sharing' import {cleanError} from '#/lib/strings/errors' import {enforceLen} from '#/lib/strings/helpers' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useSearchPostsQuery} from '#/state/queries/search-posts' import {useSetMinimalShellMode} from '#/state/shell' import {Pager} from '#/view/com/pager/Pager' @@ -37,6 +38,8 @@ }: NativeStackScreenProps) { const {topic} = route.params const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() const headerTitle = React.useMemo(() => { return enforceLen(decodeURIComponent(topic), 24, true, 'middle') @@ -103,7 +106,7 @@ size="small" variant="ghost" color="primary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={onShare} hitSlop={HITSLOP_10} style={[{right: -3}]}> diff --git a/src/components/ContextMenu/index.tsx b/src/components/ContextMenu/index.tsx --- a/src/components/ContextMenu/index.tsx +++ b/src/components/ContextMenu/index.tsx @@ -50,6 +50,7 @@ import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' import {logger} from '#/logger' import {isAndroid, isIOS} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, platform, tokens, useTheme} from '#/alf' import { Context, @@ -824,12 +825,13 @@ export function ItemRadio({selected}: {selected: boolean}) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( close()} label={_(msg`Close active dialog`)}> diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx --- a/src/components/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -11,6 +11,7 @@ import flattenReactChildren from 'react-keyed-flatten-children' import {isAndroid, isIOS, isNative} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' @@ -219,12 +220,13 @@ export function ItemRadio({selected}: {selected: boolean}) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( ({ @@ -82,7 +85,7 @@ onLongPress={handleLongPress} style={style} hoverStyle={t.atoms.bg_contrast_25} - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} variant="ghost" color="secondary" {...props} diff --git a/src/components/ProfileHoverCard/index.web.tsx b/src/components/ProfileHoverCard/index.web.tsx --- a/src/components/ProfileHoverCard/index.web.tsx +++ b/src/components/ProfileHoverCard/index.web.tsx @@ -18,6 +18,7 @@ import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {useProfileShadow} from '#/state/cache/profile-shadow' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {usePrefetchProfileQuery, useProfileQuery} from '#/state/queries/profile' import {useSession} from '#/state/session' @@ -460,6 +461,8 @@ const isLabeler = profile.associated?.labeler const verification = useSimpleVerificationState({profile}) + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -482,7 +485,7 @@ size="small" color="secondary" variant="solid" - style={[a.rounded_full]}> + style={enableSquareButtons ? [a.rounded_sm] : [a.rounded_full]}> {_(msg`View profile`)} ) : ( @@ -495,7 +498,7 @@ ? _(msg`Following`) : _(msg`Follow`) } - style={[a.rounded_full]} + style={enableSquareButtons ? [a.rounded_sm] : [a.rounded_full]} onPress={profileShadow.viewer?.following ? unfollow : follow}> { return renderItem(item, index, context.value) @@ -187,13 +190,13 @@ size="small" color="primary" variant="ghost" - style={[a.rounded_full]}> + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]}> Done ), - [control, _], + [control, _, enableSquareButtons], ) return ( diff --git a/src/components/activity-notifications/SubscribeProfileButton.tsx b/src/components/activity-notifications/SubscribeProfileButton.tsx --- a/src/components/activity-notifications/SubscribeProfileButton.tsx +++ b/src/components/activity-notifications/SubscribeProfileButton.tsx @@ -5,6 +5,7 @@ import {useRequireEmailVerification} from '#/lib/hooks/useRequireEmailVerification' import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {Button, ButtonIcon} from '#/components/Button' import {useDialogControl} from '#/components/Dialog' import {BellPlus_Stroke2_Corner0_Rounded as BellPlusIcon} from '#/components/icons/BellPlus' @@ -66,6 +67,8 @@ const Icon = isSubscribed ? BellRingingIcon : BellPlusIcon + const enableSquareButtons = useEnableSquareButtons() + return ( <> diff --git a/src/components/ageAssurance/AgeAssuranceAdmonition.tsx b/src/components/ageAssurance/AgeAssuranceAdmonition.tsx --- a/src/components/ageAssurance/AgeAssuranceAdmonition.tsx +++ b/src/components/ageAssurance/AgeAssuranceAdmonition.tsx @@ -4,6 +4,7 @@ import {useAgeAssurance} from '#/state/ageAssurance/useAgeAssurance' import {logger} from '#/state/ageAssurance/util' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, select, useTheme, type ViewStyleProp} from '#/alf' import {useDialogControl} from '#/components/ageAssurance/AgeAssuranceInitDialog' import type * as Dialog from '#/components/Dialog' @@ -38,6 +39,7 @@ }) { const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() return ( <> @@ -67,7 +69,7 @@ style={[ a.align_center, a.justify_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, { width: 32, height: 32, diff --git a/src/components/ageAssurance/AgeAssuranceBadge.tsx b/src/components/ageAssurance/AgeAssuranceBadge.tsx --- a/src/components/ageAssurance/AgeAssuranceBadge.tsx +++ b/src/components/ageAssurance/AgeAssuranceBadge.tsx @@ -1,12 +1,14 @@ import {View} from 'react-native' import {Trans} from '@lingui/macro' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, select, useTheme} from '#/alf' import {ShieldCheck_Stroke2_Corner0_Rounded as Shield} from '#/components/icons/Shield' import {Text} from '#/components/Typography' export function AgeAssuranceBadge() { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( ) - }, [gtMobile, t.atoms.bg, _, control]) + }, [gtMobile, t.atoms.bg, _, control, enableSquareButtons]) return ( <> diff --git a/src/components/dialogs/MutedWords.tsx b/src/components/dialogs/MutedWords.tsx --- a/src/components/dialogs/MutedWords.tsx +++ b/src/components/dialogs/MutedWords.tsx @@ -6,6 +6,7 @@ import {logger} from '#/logger' import {isNative} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { usePreferencesQuery, useRemoveMutedWordMutation, @@ -426,6 +427,8 @@ const isExpired = expiryDate && expiryDate < new Date() const formatDistance = useFormatDistance() + const enableSquareButtons = useEnableSquareButtons() + const remove = React.useCallback(async () => { control.close() removeMutedWord(word) @@ -529,7 +532,7 @@ diff --git a/src/components/dms/ActionsWrapper.web.tsx b/src/components/dms/ActionsWrapper.web.tsx --- a/src/components/dms/ActionsWrapper.web.tsx +++ b/src/components/dms/ActionsWrapper.web.tsx @@ -5,6 +5,7 @@ import {useLingui} from '@lingui/react' import {useConvoActive} from '#/state/messages/convo' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useSession} from '#/state/session' import * as Toast from '#/view/com/util/Toast' import {atoms as a, useTheme} from '#/alf' @@ -30,6 +31,8 @@ const {currentAccount} = useSession() const [showActions, setShowActions] = useState(false) + + const enableSquareButtons = useEnableSquareButtons() const onMouseEnter = useCallback(() => { setShowActions(true) @@ -99,7 +102,7 @@ style={[ {opacity: showMenuTrigger}, a.p_xs, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, (state.hovered || state.pressed) && t.atoms.bg_contrast_25, ]}> { return [ @@ -79,7 +82,7 @@ style={[ a.px_xl, a.py_md, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, t.atoms.bg_contrast_25, a.align_center, animatedStyle, diff --git a/src/components/dms/ConvoMenu.tsx b/src/components/dms/ConvoMenu.tsx --- a/src/components/dms/ConvoMenu.tsx +++ b/src/components/dms/ConvoMenu.tsx @@ -7,6 +7,7 @@ import {type NavigationProp} from '#/lib/routes/types' import {type Shadow} from '#/state/cache/types' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useConvoQuery, useMarkAsReadMutation, @@ -70,6 +71,8 @@ const {listBlocks} = blockInfo + const enableSquareButtons = useEnableSquareButtons() + return ( <> @@ -86,7 +89,7 @@ }} size="small" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} variant="ghost" style={[a.bg_transparent]}> diff --git a/src/components/dms/EmojiPopup.android.tsx b/src/components/dms/EmojiPopup.android.tsx --- a/src/components/dms/EmojiPopup.android.tsx +++ b/src/components/dms/EmojiPopup.android.tsx @@ -4,6 +4,7 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' import {TimesLarge_Stroke2_Corner0_Rounded as CloseIcon} from '#/components/icons/Times' @@ -20,6 +21,8 @@ const [modalVisible, setModalVisible] = useState(false) const {_} = useLingui() const t = useTheme() + + const enableSquareButtons = useEnableSquareButtons() return ( <> @@ -60,7 +63,7 @@ size="small" variant="ghost" color="secondary" - shape="round"> + shape={enableSquareButtons ? 'square' : 'round'}> diff --git a/src/components/dms/EmojiReactionPicker.tsx b/src/components/dms/EmojiReactionPicker.tsx --- a/src/components/dms/EmojiReactionPicker.tsx +++ b/src/components/dms/EmojiReactionPicker.tsx @@ -4,6 +4,7 @@ import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useSession} from '#/state/session' import {atoms as a, tokens, useTheme} from '#/alf' import * as ContextMenu from '#/components/ContextMenu' @@ -55,12 +56,14 @@ const bgColor = t.scheme === 'light' ? t.atoms.bg : t.atoms.bg_contrast_25 + const enableSquareButtons = useEnableSquareButtons() + return ( setLayout(evt.nativeEvent.layout)} style={[ bgColor, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.absolute, {bottom: '100%'}, isFromSelf ? a.right_0 : a.left_0, @@ -90,7 +93,7 @@ {hovered => ( ) : ( - + {['👍', '😆', '❤️', '👀', '😢'].map(emoji => { const alreadyReacted = hasAlreadyReacted( @@ -109,7 +112,7 @@ style={flatten([ a.flex, a.flex_col, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.justify_center, a.align_center, a.transition_transform, @@ -135,7 +138,7 @@ role="button" onPress={() => setExpanded(true)} style={flatten([ - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, {height: 34, width: 34}, a.justify_center, a.align_center, diff --git a/src/components/dms/MessageProfileButton.tsx b/src/components/dms/MessageProfileButton.tsx --- a/src/components/dms/MessageProfileButton.tsx +++ b/src/components/dms/MessageProfileButton.tsx @@ -8,6 +8,7 @@ import {useRequireEmailVerification} from '#/lib/hooks/useRequireEmailVerification' import {type NavigationProp} from '#/lib/routes/types' import {logEvent} from '#/lib/statsig/statsig' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useGetConvoAvailabilityQuery} from '#/state/queries/messages/get-convo-availability' import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members' import * as Toast from '#/view/com/util/Toast' @@ -25,6 +26,8 @@ const t = useTheme() const navigation = useNavigation() const requireEmailVerification = useRequireEmailVerification() + + const enableSquareButtons = useEnableSquareButtons() const {data: convoAvailability} = useGetConvoAvailabilityQuery(profile.did) const {mutate: initiateConvo} = useGetConvoForMembers({ @@ -72,7 +75,7 @@ a.justify_center, a.align_center, t.atoms.bg_contrast_25, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, // Matches size of button below to avoid layout shift {width: 33, height: 33}, ]}> @@ -93,7 +96,7 @@ size="small" color="secondary" variant="solid" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} label={_(msg`Message ${profile.handle}`)} style={[a.justify_center]} onPress={wrappedOnPress}> diff --git a/src/components/dms/NewMessagesPill.tsx b/src/components/dms/NewMessagesPill.tsx --- a/src/components/dms/NewMessagesPill.tsx +++ b/src/components/dms/NewMessagesPill.tsx @@ -15,6 +15,7 @@ } from '#/lib/custom-animations/ScaleAndFade' import {useHaptics} from '#/lib/haptics' import {isAndroid, isIOS, isWeb} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme} from '#/alf' import {Text} from '#/components/Typography' @@ -32,6 +33,8 @@ const bottomOffset = isWeb ? 0 : bottomInset + bottomBarHeight const scale = useSharedValue(1) + + const enableSquareButtons = useEnableSquareButtons() const onPressIn = React.useCallback(() => { if (isWeb) return @@ -68,7 +71,7 @@ 0 + + const enableSquareButtons = useEnableSquareButtons() return ( @@ -70,7 +73,7 @@ label={_(msg`Clear search query`)} hitSlop={HITSLOP_10} size="tiny" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} variant="ghost" color="secondary"> diff --git a/src/components/interstitials/Trending.tsx b/src/components/interstitials/Trending.tsx --- a/src/components/interstitials/Trending.tsx +++ b/src/components/interstitials/Trending.tsx @@ -4,6 +4,7 @@ import {useLingui} from '@lingui/react' import {logEvent} from '#/lib/statsig/statsig' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useTrendingSettings, useTrendingSettingsApi, @@ -34,6 +35,8 @@ const {setTrendingDisabled} = useTrendingSettingsApi() const {data: trending, error, isLoading} = useTrendingTopics() const noTopics = !isLoading && !error && !trending?.topics?.length + + const enableSquareButtons = useEnableSquareButtons() const onConfirmHide = React.useCallback(() => { logEvent('trendingTopics:hide', {context: 'interstitial'}) @@ -114,7 +117,7 @@ size="tiny" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => trendingPrompt.open()}> diff --git a/src/components/interstitials/TrendingVideos.tsx b/src/components/interstitials/TrendingVideos.tsx --- a/src/components/interstitials/TrendingVideos.tsx +++ b/src/components/interstitials/TrendingVideos.tsx @@ -8,6 +8,7 @@ import {VIDEO_FEED_URI} from '#/lib/constants' import {makeCustomFeedLink} from '#/lib/routes/links' import {logEvent} from '#/lib/statsig/statsig' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useTrendingSettingsApi} from '#/state/preferences/trending' import {usePostFeedQuery} from '#/state/queries/post-feed' import {RQKEY} from '#/state/queries/post-feed' @@ -191,6 +192,8 @@ return makeCustomFeedLink(urip.host, urip.rkey, undefined, 'discover') }, []) + const enableSquareButtons = useEnableSquareButtons() + return ( diff --git a/src/components/moderation/ScreenHider.tsx b/src/components/moderation/ScreenHider.tsx --- a/src/components/moderation/ScreenHider.tsx +++ b/src/components/moderation/ScreenHider.tsx @@ -13,6 +13,7 @@ import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {useModerationCauseDescription} from '#/lib/moderation/useModerationCauseDescription' import {type NavigationProp} from '#/lib/routes/types' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {CenteredView} from '#/view/com/util/Views' import {atoms as a, useTheme, web} from '#/alf' import {Button, ButtonText} from '#/components/Button' @@ -44,6 +45,8 @@ const control = useModerationDetailsDialogControl() const blur = modui.blurs[0] const desc = useModerationCauseDescription(blur) + + const enableSquareButtons = useEnableSquareButtons() if (!blur || override) { return ( @@ -156,7 +159,7 @@ variant="solid" color="primary" size="large" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} label={_(msg`Go back`)} onPress={() => { if (navigation.canGoBack()) { @@ -174,7 +177,7 @@ variant="solid" color="secondary" size="large" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} label={_(msg`Show anyway`)} onPress={() => setOverride(v => !v)}> diff --git a/src/components/verification/VerificationsDialog.tsx b/src/components/verification/VerificationsDialog.tsx --- a/src/components/verification/VerificationsDialog.tsx +++ b/src/components/verification/VerificationsDialog.tsx @@ -6,6 +6,7 @@ import {urls} from '#/lib/constants' import {getUserDisplayName} from '#/lib/getUserDisplayName' import {logger} from '#/logger' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useProfileQuery} from '#/state/queries/profile' import {useSession} from '#/state/session' @@ -194,6 +195,8 @@ const verificationRemovePromptControl = useDialogControl() const canAdminister = verification.issuer === currentAccount?.did + const enableSquareButtons = useEnableSquareButtons() + return ( { verificationRemovePromptControl.open() }}> diff --git a/src/components/video/PlayButtonIcon.tsx b/src/components/video/PlayButtonIcon.tsx --- a/src/components/video/PlayButtonIcon.tsx +++ b/src/components/video/PlayButtonIcon.tsx @@ -1,5 +1,6 @@ import {View} from 'react-native' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme} from '#/alf' import {Play_Filled_Corner0_Rounded as PlayIcon} from '#/components/icons/Play' @@ -8,11 +9,13 @@ const bg = t.name === 'light' ? t.palette.contrast_25 : t.palette.contrast_975 const fg = t.name === 'light' ? t.palette.contrast_975 : t.palette.contrast_25 + const enableSquareButtons = useEnableSquareButtons() + return ( <> { newChatControl.open() }, [newChatControl]) @@ -381,7 +384,7 @@ size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} style={[a.justify_center]}> diff --git a/src/screens/Settings/DeerSettings.tsx b/src/screens/Settings/DeerSettings.tsx --- a/src/screens/Settings/DeerSettings.tsx +++ b/src/screens/Settings/DeerSettings.tsx @@ -62,6 +62,10 @@ useSetEnableSquareAvatars, } from '#/state/preferences/enable-square-avatars' import { + useEnableSquareButtons, + useSetEnableSquareButtons, +} from '#/state/preferences/enable-square-buttons' +import { useHideFeedsPromoTab, useSetHideFeedsPromoTab, } from '#/state/preferences/hide-feeds-promo-tab' @@ -282,6 +286,9 @@ const enableSquareAvatars = useEnableSquareAvatars() const setEnableSquareAvatars = useSetEnableSquareAvatars() + + const enableSquareButtons = useEnableSquareButtons() + const setEnableSquareButtons = useSetEnableSquareButtons() const constellationInstance = useConstellationInstance() const setConstellationInstanceControl = Dialog.useDialogControl() @@ -599,6 +606,18 @@ style={[a.w_full]}> Enable square avatars + + + + + setEnableSquareButtons(value)} + style={[a.w_full]}> + + Enable square buttons diff --git a/src/screens/Settings/InterestsSettings.tsx b/src/screens/Settings/InterestsSettings.tsx --- a/src/screens/Settings/InterestsSettings.tsx +++ b/src/screens/Settings/InterestsSettings.tsx @@ -12,6 +12,7 @@ useInterestsDisplayNames, } from '#/lib/interests' import {type CommonNavigatorParams} from '#/lib/routes/types' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { preferencesQueryKey, usePreferencesQuery, @@ -187,6 +188,8 @@ const interestsDisplayNames = useInterestsDisplayNames() const ctx = Toggle.useItemContext() + const enableSquareButtons = useEnableSquareButtons() + const styles = useMemo(() => { const hovered: ViewStyle[] = [t.atoms.bg_contrast_100] const focused: ViewStyle[] = [] @@ -208,7 +211,7 @@ return ( { if (pendingDid) return onPressSwitchAccount(account, 'Settings') @@ -638,7 +641,7 @@ a.absolute, {top: 10, right: tokens.space.lg}, a.p_xs, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, (state.hovered || state.pressed) && t.atoms.bg_contrast_25, ]}> diff --git a/src/screens/StarterPack/StarterPackScreen.tsx b/src/screens/StarterPack/StarterPackScreen.tsx --- a/src/screens/StarterPack/StarterPackScreen.tsx +++ b/src/screens/StarterPack/StarterPackScreen.tsx @@ -29,6 +29,7 @@ import {logger} from '#/logger' import {isWeb} from '#/platform/detection' import {updateProfileShadow} from '#/state/cache/profile-shadow' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {getAllListMembers} from '#/state/queries/list-members' import {useResolvedStarterPackShortLink} from '#/state/queries/resolve-short-link' @@ -522,6 +523,8 @@ const deleteDialogControl = useDialogControl() const navigation = useNavigation() + const enableSquareButtons = useEnableSquareButtons() + const { mutate: deleteStarterPack, isPending: isDeletePending, @@ -570,7 +573,7 @@ variant="solid" color="secondary" size="small" - shape="round"> + shape={enableSquareButtons ? 'square' : 'round'}> )} diff --git a/src/screens/VideoFeed/index.tsx b/src/screens/VideoFeed/index.tsx --- a/src/screens/VideoFeed/index.tsx +++ b/src/screens/VideoFeed/index.tsx @@ -71,6 +71,7 @@ useFeedFeedbackContext, } from '#/state/feed-feedback' import {useFeedFeedback} from '#/state/feed-feedback' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useFeedInfo} from '#/state/queries/feed' import {usePostLikeMutationQueue} from '#/state/queries/post' import { @@ -1110,6 +1111,7 @@ const navigation = useNavigation() const {_} = useLingui() const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( void + +const stateContext = React.createContext( + persisted.defaults.enableSquareButtons, +) +const setContext = React.createContext( + (_: persisted.Schema['enableSquareButtons']) => {}, +) + +export function Provider({children}: React.PropsWithChildren<{}>) { + const [state, setState] = React.useState(persisted.get('enableSquareButtons')) + + const setStateWrapped = React.useCallback( + (value: persisted.Schema['enableSquareButtons']) => { + setState(value) + persisted.write('enableSquareButtons', value) + }, + [setState], + ) + + React.useEffect(() => { + return persisted.onUpdate('enableSquareButtons', next => { + setState(next) + }) + }, [setStateWrapped]) + + return ( + + + {children} + + + ) +} + +export function useEnableSquareButtons() { + return React.useContext(stateContext) +} + +export function useSetEnableSquareButtons() { + return React.useContext(setContext) +} diff --git a/src/state/preferences/index.tsx b/src/state/preferences/index.tsx --- a/src/state/preferences/index.tsx +++ b/src/state/preferences/index.tsx @@ -14,6 +14,7 @@ import {Provider as DisableSavesMetricsProvider} from './disable-saves-metrics' import {Provider as DisableViaRepostNotificationProvider} from './disable-via-repost-notification' import {Provider as EnableSquareAvatarsProvider} from './enable-square-avatars' +import {Provider as EnableSquareButtonsProvider} from './enable-square-buttons' import {Provider as ExternalEmbedsProvider} from './external-embeds-prefs' import {Provider as GoLinksProvider} from './go-links-enabled' import {Provider as HiddenPostsProvider} from './hidden-posts' @@ -85,7 +86,9 @@ - {children} + + {children} + diff --git a/src/view/screens/DebugMod.tsx b/src/view/screens/DebugMod.tsx --- a/src/view/screens/DebugMod.tsx +++ b/src/view/screens/DebugMod.tsx @@ -24,6 +24,7 @@ type CommonNavigatorParams, type NativeStackScreenProps, } from '#/lib/routes/types' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {moderationOptsOverrideContext} from '#/state/preferences/moderation-opts' import {type FeedNotification} from '#/state/queries/notifications/types' @@ -85,6 +86,8 @@ const [view, setView] = React.useState(['post']) const labelStrings = useGlobalLabelStrings() const {currentAccount} = useSession() + + const enableSquareButtons = useEnableSquareButtons() const isTargetMe = scenario[0] === 'label' && scenarioSwitches.includes('targetMe') @@ -449,7 +452,7 @@ }) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( (null) + + const enableSquareButtons = useEnableSquareButtons() /** * A search query is present. We may not have search results yet. @@ -519,7 +522,7 @@ size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} style={[a.justify_center, {right: -3}]}> diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx --- a/src/view/screens/Notifications.tsx +++ b/src/view/screens/Notifications.tsx @@ -16,6 +16,7 @@ import {logger} from '#/logger' import {isNative} from '#/platform/detection' import {emitSoftReset, listenSoftReset} from '#/state/events' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {RQKEY as NOTIFS_RQKEY} from '#/state/queries/notifications/feed' import {useNotificationSettingsQuery} from '#/state/queries/notifications/settings' import { @@ -60,6 +61,8 @@ const initialActiveTab = lastActiveTab const [activeTab, setActiveTab] = useState(initialActiveTab) const isLoading = activeTab === 0 ? isLoadingAll : isLoadingMentions + + const enableSquareButtons = useEnableSquareButtons() const onPageSelected = useCallback( (index: number) => { @@ -137,7 +140,7 @@ size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} style={[a.justify_center]}> diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -15,6 +15,7 @@ import {colors} from '#/lib/styles' import {isWeb} from '#/platform/detection' import {emitSoftReset} from '#/state/events' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useKawaiiMode} from '#/state/preferences/kawaii' import {useUnreadNotifications} from '#/state/queries/notifications/unread' import {useProfileQuery} from '#/state/queries/profile' @@ -615,6 +616,7 @@ function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( ), - [onPressCancel, _], + [onPressCancel, _, enableSquareButtons], ) const saveButton = useCallback( @@ -301,7 +304,7 @@ size="small" color="primary" variant="ghost" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} testID="editProfileSaveBtn"> Save @@ -318,6 +321,7 @@ isUpdatingList, displayNameTooLong, descriptionTooLong, + enableSquareButtons, ], ) diff --git a/src/components/dialogs/nuxs/ActivitySubscriptions.tsx b/src/components/dialogs/nuxs/ActivitySubscriptions.tsx --- a/src/components/dialogs/nuxs/ActivitySubscriptions.tsx +++ b/src/components/dialogs/nuxs/ActivitySubscriptions.tsx @@ -5,6 +5,7 @@ import {useLingui} from '@lingui/react' import {isWeb} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme, web} from '#/alf' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' @@ -17,6 +18,8 @@ const {_} = useLingui() const nuxDialogs = useNuxDialogContext() const control = Dialog.useDialogControl() + + const enableSquareButtons = useEnableSquareButtons() Dialog.useAutoOpen(control) @@ -55,7 +58,7 @@ a.pl_sm, a.pr_md, a.py_sm, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.flex_row, a.align_center, a.gap_xs, diff --git a/src/components/dialogs/nuxs/InitialVerificationAnnouncement.tsx b/src/components/dialogs/nuxs/InitialVerificationAnnouncement.tsx --- a/src/components/dialogs/nuxs/InitialVerificationAnnouncement.tsx +++ b/src/components/dialogs/nuxs/InitialVerificationAnnouncement.tsx @@ -7,6 +7,7 @@ import {urls} from '#/lib/constants' import {logger} from '#/logger' import {isNative} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' @@ -22,6 +23,8 @@ const {gtMobile} = useBreakpoints() const nuxDialogs = useNuxDialogContext() const control = Dialog.useDialogControl() + + const enableSquareButtons = useEnableSquareButtons() Dialog.useAutoOpen(control) @@ -44,7 +47,7 @@ a.pl_sm, a.pr_md, a.py_sm, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.flex_row, a.align_center, a.gap_xs, diff --git a/src/components/forms/Toggle/index.tsx b/src/components/forms/Toggle/index.tsx --- a/src/components/forms/Toggle/index.tsx +++ b/src/components/forms/Toggle/index.tsx @@ -11,6 +11,7 @@ import {HITSLOP_10} from '#/lib/constants' import {useHaptics} from '#/lib/haptics' import {isNative} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { atoms as a, native, @@ -395,6 +396,7 @@ export function Switch() { const t = useTheme() const {selected, hovered, disabled, isInvalid} = useItemContext() + const enableSquareButtons = useEnableSquareButtons() const {baseStyles, baseHoverStyles, indicatorStyles} = useMemo(() => { const base: ViewStyle[] = [] const baseHover: ViewStyle[] = [] @@ -469,7 +471,7 @@ { dispatch({type: 'clearCategory'}) }}> @@ -370,7 +373,7 @@ size="tiny" variant="solid" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => { dispatch({type: 'clearOption'}) }}> @@ -425,7 +428,7 @@ size="tiny" variant="solid" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => { dispatch({type: 'clearLabeler'}) }}> @@ -605,13 +608,14 @@ const t = useTheme() const active = activeIndex1 === index const completed = activeIndex1 > index + const enableSquareButtons = useEnableSquareButtons() return ( moderateProfile(profile, moderationOpts), [profile, moderationOpts], @@ -494,7 +498,7 @@ (null) + + const enableSquareButtons = useEnableSquareButtons() const onSubmit = React.useCallback(() => { if (!hasEmbed && message.trim() === '') { @@ -168,7 +171,7 @@ }) }} style={[ - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.overflow_hidden, a.align_center, a.justify_center, @@ -235,7 +238,7 @@ accessibilityLabel={_(msg`Send message`)} accessibilityHint="" style={[ - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.align_center, a.justify_center, { diff --git a/src/screens/Messages/components/MessageInputEmbed.tsx b/src/screens/Messages/components/MessageInputEmbed.tsx --- a/src/screens/Messages/components/MessageInputEmbed.tsx +++ b/src/screens/Messages/components/MessageInputEmbed.tsx @@ -21,6 +21,7 @@ isBskyPostUrl, makeRecordUri, } from '#/lib/strings/url-helpers' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {usePostQuery} from '#/state/queries/post' import {PostMeta} from '#/view/com/util/PostMeta' @@ -104,6 +105,8 @@ }) { const t = useTheme() const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() const {data: post, status} = usePostQuery(embedUri) @@ -217,7 +220,7 @@ size="tiny" variant="solid" color="secondary" - shape="round"> + shape={enableSquareButtons ? 'square' : 'round'}> diff --git a/src/screens/PostThread/components/HeaderDropdown.tsx b/src/screens/PostThread/components/HeaderDropdown.tsx --- a/src/screens/PostThread/components/HeaderDropdown.tsx +++ b/src/screens/PostThread/components/HeaderDropdown.tsx @@ -3,6 +3,7 @@ import {HITSLOP_10} from '#/lib/constants' import {logger} from '#/logger' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {type ThreadPreferences} from '#/state/queries/preferences/useThreadPreferences' import {Button, ButtonIcon} from '#/components/Button' import {SettingsSliderVertical_Stroke2_Corner0_Rounded as SettingsSlider} from '#/components/icons/SettingsSlider' @@ -18,6 +19,9 @@ 'sort' | 'setSort' | 'view' | 'setView' >): React.ReactNode { const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -27,7 +31,7 @@ size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} hitSlop={HITSLOP_10} onPress={() => { logger.metric('thread:click:headerMenuOpen', {}) diff --git a/src/screens/PostThread/components/ThreadComposePrompt.tsx b/src/screens/PostThread/components/ThreadComposePrompt.tsx --- a/src/screens/PostThread/components/ThreadComposePrompt.tsx +++ b/src/screens/PostThread/components/ThreadComposePrompt.tsx @@ -6,6 +6,7 @@ import {PressableScale} from '#/lib/custom-animations/PressableScale' import {useHaptics} from '#/lib/haptics' import {useHideBottomBarBorderForScreen} from '#/lib/hooks/useHideBottomBarBorder' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useProfileQuery} from '#/state/queries/profile' import {useSession} from '#/state/session' import {UserAvatar} from '#/view/com/util/UserAvatar' @@ -27,6 +28,7 @@ const {gtMobile} = useBreakpoints() const t = useTheme() const playHaptic = useHaptics() + const enableSquareButtons = useEnableSquareButtons() const { state: hovered, onIn: onHoverIn, @@ -76,7 +78,7 @@ a.align_center, a.p_sm, a.gap_sm, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, (!gtMobile || hovered) && t.atoms.bg_contrast_25, native([a.border, t.atoms.border_contrast_low]), a.transition_color, diff --git a/src/screens/PostThread/components/ThreadItemAnchor.tsx b/src/screens/PostThread/components/ThreadItemAnchor.tsx --- a/src/screens/PostThread/components/ThreadItemAnchor.tsx +++ b/src/screens/PostThread/components/ThreadItemAnchor.tsx @@ -31,6 +31,7 @@ import {useDisableQuotesMetrics} from '#/state/preferences/disable-quotes-metrics' import {useDisableRepostsMetrics} from '#/state/preferences/disable-reposts-metrics' import {useDisableSavesMetrics} from '#/state/preferences/disable-saves-metrics' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {type ThreadItem} from '#/state/queries/usePostThread/types' import {useSession} from '#/state/session' import {type OnPostSuccessData} from '#/state/shell/composer' @@ -621,6 +622,7 @@ const t = useTheme() const {_, i18n} = useLingui() const control = Prompt.usePromptControl() + const enableSquareButtons = useEnableSquareButtons() const indexedAt = new Date(post.indexedAt) const createdAt = bsky.dangerousIsType( @@ -655,7 +657,7 @@ style={[ a.flex_row, a.align_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, t.atoms.bg_contrast_25, (hovered || pressed) && t.atoms.bg_contrast_50, { diff --git a/src/screens/PostThread/components/ThreadItemAnchorFollowButton.tsx b/src/screens/PostThread/components/ThreadItemAnchorFollowButton.tsx --- a/src/screens/PostThread/components/ThreadItemAnchorFollowButton.tsx +++ b/src/screens/PostThread/components/ThreadItemAnchorFollowButton.tsx @@ -6,6 +6,7 @@ import {logger} from '#/logger' import {useProfileShadow} from '#/state/cache/profile-shadow' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useProfileFollowMutationQueue, useProfileQuery, @@ -45,6 +46,8 @@ const isFollowing = !!profile.viewer?.following const isFollowedBy = !!profile.viewer?.followedBy const [wasFollowing, setWasFollowing] = React.useState(isFollowing) + + const enableSquareButtons = useEnableSquareButtons() // This prevents the button from disappearing as soon as we follow. const showFollowBtn = React.useMemo( @@ -115,7 +118,7 @@ size="small" variant="solid" color={isFollowing ? 'secondary' : 'secondary_inverted'} - style={[a.rounded_full]}> + style={enableSquareButtons ? [a.rounded_sm] : [a.rounded_full]}> {gtMobile && ( Cancel ), - [onPressCancel, _], + [onPressCancel, _, enableSquareButtons], ) const saveButton = useCallback( @@ -247,7 +249,7 @@ size="small" color="primary" variant="ghost" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} testID="editProfileSaveBtn"> Save @@ -263,6 +265,7 @@ isUpdatingProfile, displayNameTooLong, descriptionTooLong, + enableSquareButtons, ], ) diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx --- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx +++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx @@ -18,6 +18,7 @@ import {isIOS} from '#/platform/detection' import {useProfileShadow} from '#/state/cache/profile-shadow' import {type Shadow} from '#/state/cache/types' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useLabelerSubscriptionMutation} from '#/state/queries/labeler' import {useLikeMutation, useUnlikeMutation} from '#/state/queries/like' import {usePreferencesQuery} from '#/state/queries/preferences' @@ -67,6 +68,8 @@ const playHaptic = useHaptics() const cantSubscribePrompt = Prompt.usePromptControl() const isSelf = currentAccount?.did === profile.did + + const enableSquareButtons = useEnableSquareButtons() const moderation = useMemo( () => moderateProfile(profile, moderationOpts), @@ -179,7 +182,7 @@ variant="solid" onPress={editProfileControl.open} label={_(msg`Edit profile`)} - style={a.rounded_full}> + style={enableSquareButtons ? a.rounded_sm : a.rounded_full}> Edit Profile @@ -266,7 +269,7 @@ size="small" color="secondary" variant="solid" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} label={_(msg`Like this labeler`)} disabled={!hasSession || isLikePending || isUnlikePending} onPress={onToggleLiked}> diff --git a/src/screens/Profile/Header/ProfileHeaderStandard.tsx b/src/screens/Profile/Header/ProfileHeaderStandard.tsx --- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx +++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx @@ -16,6 +16,7 @@ import {logger} from '#/logger' import {isIOS} from '#/platform/detection' import {useProfileShadow} from '#/state/cache/profile-shadow' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useProfileBlockMutationQueue, useProfileFollowMutationQueue, @@ -84,6 +85,8 @@ const playHaptic = useHaptics() const editProfileControl = useDialogControl() + + const enableSquareButtons = useEnableSquareButtons() const onPressFollow = () => { playHaptic() @@ -194,7 +197,9 @@ variant="solid" onPress={editProfileControl.open} label={_(msg`Edit profile`)} - style={[a.rounded_full]}> + style={ + enableSquareButtons ? [a.rounded_sm] : [a.rounded_full] + }> Edit Profile @@ -214,7 +219,9 @@ label={_(msg`Unblock`)} disabled={!hasSession} onPress={() => unblockPromptControl.open()} - style={[a.rounded_full]}> + style={ + enableSquareButtons ? [a.rounded_sm] : [a.rounded_full] + }> Unblock @@ -245,7 +252,9 @@ onPress={ profile.viewer?.following ? onPressUnfollow : onPressFollow } - style={[a.rounded_full]}> + style={ + enableSquareButtons ? [a.rounded_sm] : [a.rounded_full] + }> {!profile.viewer?.following && ( )} diff --git a/src/screens/Profile/Header/Shell.tsx b/src/screens/Profile/Header/Shell.tsx --- a/src/screens/Profile/Header/Shell.tsx +++ b/src/screens/Profile/Header/Shell.tsx @@ -23,6 +23,7 @@ import {type Shadow} from '#/state/cache/types' import {useLightboxControls} from '#/state/lightbox' import {useEnableSquareAvatars} from '#/state/preferences/enable-square-avatars' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { maybeModifyHighQualityImage, useHighQualityImages, @@ -68,6 +69,7 @@ const liveStatusControl = useDialogControl() const highQualityImages = useHighQualityImages() const enableSquareAvatars = useEnableSquareAvatars() + const enableSquareButtons = useEnableSquareButtons() const aviRef = useAnimatedRef() const bannerRef = useAnimatedRef() @@ -233,7 +235,7 @@ style={[ a.align_center, a.justify_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, { width: 31, height: 31, diff --git a/src/screens/Profile/components/ProfileFeedHeader.tsx b/src/screens/Profile/components/ProfileFeedHeader.tsx --- a/src/screens/Profile/components/ProfileFeedHeader.tsx +++ b/src/screens/Profile/components/ProfileFeedHeader.tsx @@ -12,6 +12,7 @@ import {toShareUrl} from '#/lib/strings/url-helpers' import {logger} from '#/logger' import {isWeb} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {type FeedSourceFeedInfo} from '#/state/queries/feed' import {useLikeMutation, useUnlikeMutation} from '#/state/queries/like' import { @@ -55,6 +56,7 @@ export function ProfileFeedHeaderSkeleton() { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( @@ -69,7 +71,7 @@ style={[ a.justify_center, a.align_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, t.atoms.bg_contrast_25, { height: 34, @@ -400,6 +402,8 @@ const isLiked = !!likeUri const feedRkey = React.useMemo(() => new AtUri(info.uri).rkey, [info.uri]) + const enableSquareButtons = useEnableSquareButtons() + const onToggleLiked = async () => { try { playHaptic() @@ -472,7 +476,7 @@ size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={onPressShare}> diff --git a/src/screens/ProfileList/components/Header.tsx b/src/screens/ProfileList/components/Header.tsx --- a/src/screens/ProfileList/components/Header.tsx +++ b/src/screens/ProfileList/components/Header.tsx @@ -7,6 +7,7 @@ import {useHaptics} from '#/lib/haptics' import {makeListLink} from '#/lib/routes/links' import {logger} from '#/logger' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useListBlockMutation, useListMuteMutation} from '#/state/queries/list' import { useAddSavedFeedsMutation, @@ -40,6 +41,8 @@ const isBlocking = !!list.viewer?.blocked const isMuting = !!list.viewer?.muted const playHaptic = useHaptics() + + const enableSquareButtons = useEnableSquareButtons() const {mutateAsync: muteList, isPending: isMutePending} = useListMuteMutation() @@ -157,7 +160,7 @@ onPress={onTogglePinned} disabled={isPending} size="small" - style={[a.rounded_full]}> + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]}> {!isPinned && } {isPinned ? Unpin : Pin to home} @@ -171,7 +174,7 @@ label={_(msg`Unblock`)} onPress={onUnsubscribeBlock} size="small" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} disabled={isBlockPending}> {isBlockPending && } @@ -185,7 +188,7 @@ label={_(msg`Unmute`)} onPress={onUnsubscribeMute} size="small" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} disabled={isMutePending}> {isMutePending && } diff --git a/src/screens/ProfileList/components/MoreOptionsMenu.tsx b/src/screens/ProfileList/components/MoreOptionsMenu.tsx --- a/src/screens/ProfileList/components/MoreOptionsMenu.tsx +++ b/src/screens/ProfileList/components/MoreOptionsMenu.tsx @@ -8,6 +8,7 @@ import {toShareUrl} from '#/lib/strings/url-helpers' import {logger} from '#/logger' import {isWeb} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useListBlockMutation, useListDeleteMutation, @@ -60,6 +61,8 @@ const isMuting = !!list.viewer?.muted const isPinned = Boolean(savedFeedConfig?.pinned) const isOwner = currentAccount?.did === list.creator.did + + const enableSquareButtons = useEnableSquareButtons() const onPressShare = () => { const {rkey} = new AtUri(list.uri) @@ -153,7 +156,7 @@ testID="moreOptionsBtn" size="small" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} {...props}> diff --git a/src/screens/ProfileList/components/SubscribeMenu.tsx b/src/screens/ProfileList/components/SubscribeMenu.tsx --- a/src/screens/ProfileList/components/SubscribeMenu.tsx +++ b/src/screens/ProfileList/components/SubscribeMenu.tsx @@ -3,6 +3,7 @@ import {useLingui} from '@lingui/react' import {logger} from '#/logger' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useListBlockMutation, useListMuteMutation} from '#/state/queries/list' import {atoms as a} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' @@ -24,6 +25,8 @@ useListBlockMutation() const isPending = isMutePending || isBlockPending + + const enableSquareButtons = useEnableSquareButtons() const onSubscribeMute = async () => { try { @@ -73,7 +76,7 @@ testID="subscribeBtn" size="small" color="primary_subtle" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} disabled={isPending} {...props}> {isPending && } diff --git a/src/screens/Search/components/ModuleHeader.tsx b/src/screens/Search/components/ModuleHeader.tsx --- a/src/screens/Search/components/ModuleHeader.tsx +++ b/src/screens/Search/components/ModuleHeader.tsx @@ -5,6 +5,7 @@ import {PressableScale} from '#/lib/custom-animations/PressableScale' import {makeCustomFeedLink} from '#/lib/routes/links' import {logger} from '#/logger' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {UserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, native, useTheme, type ViewStyleProp} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' @@ -126,13 +127,14 @@ metricsTag: 'suggestedAccounts' | 'suggestedFeeds' onPress?: () => void }) { + const enableSquareButtons = useEnableSquareButtons() return ( @@ -128,6 +131,8 @@ moderation.ui('displayName'), ) const verification = useSimpleVerificationState({profile}) + + const enableSquareButtons = useEnableSquareButtons() return ( @@ -169,7 +174,7 @@ size="tiny" variant="outline" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={onRemove} style={[ a.absolute, diff --git a/src/screens/Search/components/StarterPackCard.tsx b/src/screens/Search/components/StarterPackCard.tsx --- a/src/screens/Search/components/StarterPackCard.tsx +++ b/src/screens/Search/components/StarterPackCard.tsx @@ -9,6 +9,7 @@ import {useLingui} from '@lingui/react' import {sanitizeHandle} from '#/lib/strings/handles' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useSession} from '#/state/session' import {LoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder' @@ -144,6 +145,8 @@ const widthPerc = 100 / circlesCount const [size, setSize] = React.useState(null) + const enableSquareButtons = useEnableSquareButtons() + const isPending = (numPending && profiles.length === 0) || !moderationOpts const items = isPending @@ -186,7 +189,7 @@ setSize(e.nativeEvent.layout.width)} style={[ - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, t.atoms.bg_contrast_25, { paddingTop: '100%', @@ -201,7 +204,9 @@ style={[a.absolute, a.inset_0]} /> ) : ( - + )} @@ -231,7 +236,7 @@ style={[ a.absolute, a.inset_0, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.align_center, a.justify_center, { diff --git a/src/screens/Search/modules/ExploreInterestsCard.tsx b/src/screens/Search/modules/ExploreInterestsCard.tsx --- a/src/screens/Search/modules/ExploreInterestsCard.tsx +++ b/src/screens/Search/modules/ExploreInterestsCard.tsx @@ -4,6 +4,7 @@ import {useLingui} from '@lingui/react' import {useInterestsDisplayNames} from '#/lib/interests' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {Nux, useSaveNux} from '#/state/queries/nuxs' import {usePreferencesQuery} from '#/state/queries/preferences' import {atoms as a, useTheme} from '#/alf' @@ -22,6 +23,8 @@ const {mutateAsync: saveNux} = useSaveNux() const trendingPrompt = Prompt.usePromptControl() const [closing, setClosing] = useState(false) + + const enableSquareButtons = useEnableSquareButtons() const onClose = () => { trendingPrompt.open() @@ -77,7 +80,7 @@ style={[ a.justify_center, a.align_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, t.atoms.bg_contrast_25, a.px_lg, {height: 32}, @@ -111,7 +114,7 @@ size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={onClose} style={[ a.absolute, diff --git a/src/screens/Search/modules/ExploreTrendingTopics.tsx b/src/screens/Search/modules/ExploreTrendingTopics.tsx --- a/src/screens/Search/modules/ExploreTrendingTopics.tsx +++ b/src/screens/Search/modules/ExploreTrendingTopics.tsx @@ -5,6 +5,7 @@ import {useLingui} from '@lingui/react' import {logger} from '#/logger' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useTrendingSettings} from '#/state/preferences/trending' import {useGetTrendsQuery} from '#/state/queries/trending/useGetTrendsQuery' @@ -158,11 +159,14 @@ function TrendingIndicator({type}: {type: TrendingIndicatorType | 'skeleton'}) { const t = useTheme() const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() + const pillStyles = [ a.flex_row, a.align_center, a.gap_xs, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, {height: 28, paddingHorizontal: 10}, ] @@ -246,6 +250,8 @@ const t = useTheme() const gutters = useGutters([0, 'base']) + const enableSquareButtons = useEnableSquareButtons() + return ( diff --git a/src/screens/Search/modules/ExploreTrendingVideos.tsx b/src/screens/Search/modules/ExploreTrendingVideos.tsx --- a/src/screens/Search/modules/ExploreTrendingVideos.tsx +++ b/src/screens/Search/modules/ExploreTrendingVideos.tsx @@ -9,6 +9,7 @@ import {VIDEO_FEED_URI} from '#/lib/constants' import {makeCustomFeedLink} from '#/lib/routes/links' import {logger} from '#/logger' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {RQKEY, usePostFeedQuery} from '#/state/queries/post-feed' import {BlockDrawerGesture} from '#/view/shell/BlockDrawerGesture' import {atoms as a, tokens, useGutters, useTheme} from '#/alf' @@ -151,6 +152,7 @@ }) { const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() const items = useMemo(() => { return data.pages .flatMap(page => page.slices) @@ -215,7 +217,7 @@ style={[ a.align_center, a.justify_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, { width: 34, height: 34, diff --git a/src/screens/Settings/components/ChangeHandleDialog.tsx b/src/screens/Settings/components/ChangeHandleDialog.tsx --- a/src/screens/Settings/components/ChangeHandleDialog.tsx +++ b/src/screens/Settings/components/ChangeHandleDialog.tsx @@ -19,6 +19,7 @@ import {cleanError} from '#/lib/strings/errors' import {createFullHandle, validateServiceHandle} from '#/lib/strings/handles' import {sanitizeHandle} from '#/lib/strings/handles' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useFetchDid, useUpdateHandleMutation} from '#/state/queries/handle' import {RQKEY as RQKEY_PROFILE} from '#/state/queries/profile' import {useServiceQuery} from '#/state/queries/service' @@ -62,6 +63,7 @@ const control = Dialog.useDialogContext() const {_} = useLingui() const agent = useAgent() + const enableSquareButtons = useEnableSquareButtons() const { data: serviceInfo, error: serviceInfoError, @@ -80,13 +82,13 @@ size="small" color="primary" variant="ghost" - style={[a.rounded_full]}> + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]}> Cancel ), - [control, _], + [control, _, enableSquareButtons], ) return ( @@ -624,6 +626,7 @@ function SuccessMessage({text}: {text: string}) { const {gtMobile} = useBreakpoints() const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( () + const enableSquareButtons = useEnableSquareButtons() + const onPressBack = useCallback( (evt: GestureResponderEvent) => { onPress?.(evt) @@ -164,7 +167,7 @@ size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={onPressBack} hitSlop={HITSLOP_30} style={[ diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -86,6 +86,7 @@ } from '#/state/gallery' import {useModalControls} from '#/state/modals' import {useRequireAltTextEnabled} from '#/state/preferences' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { fromPostLanguages, toPostLanguages, @@ -855,6 +856,8 @@ : _(msg`What's up?`) const discardPromptControl = Prompt.usePromptControl() + const enableSquareButtons = useEnableSquareButtons() + const dispatchPost = useCallback( (action: PostAction) => { dispatch({ @@ -968,7 +971,7 @@ size="small" color="secondary" variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} style={[a.absolute, {top: 0, right: 0}]} onPress={() => { if ( @@ -1039,6 +1042,9 @@ }) { const pal = usePalette('default') const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -1365,6 +1378,8 @@ let selectedAssetsCount = 0 let isMediaSelectionDisabled = false + const enableSquareButtons = useEnableSquareButtons() + if (media?.type === 'images') { isMediaSelectionDisabled = isMaxImages selectedAssetsCount = images.length @@ -1476,7 +1491,7 @@ label={_(msg`Open emoji picker`)} accessibilityHint={_(msg`Opens emoji picker`)} variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} color="primary"> @@ -1492,7 +1507,7 @@ onPress={onAddPost} style={[a.p_sm]} variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} color="primary"> @@ -1774,6 +1789,8 @@ const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() + const videoError = videoState.status === 'error' ? videoState.error : undefined const error = standardError || videoError @@ -1811,7 +1828,7 @@ size="tiny" color="secondary" variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} style={[a.absolute, {top: 0, right: 0}]} onPress={onClearError}> diff --git a/src/view/com/composer/ExternalEmbedRemoveBtn.tsx b/src/view/com/composer/ExternalEmbedRemoveBtn.tsx --- a/src/view/com/composer/ExternalEmbedRemoveBtn.tsx +++ b/src/view/com/composer/ExternalEmbedRemoveBtn.tsx @@ -2,6 +2,7 @@ import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme, type ViewStyleProp} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times' @@ -13,6 +14,8 @@ const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() + return ( diff --git a/src/view/com/composer/SelectMediaButton.tsx b/src/view/com/composer/SelectMediaButton.tsx --- a/src/view/com/composer/SelectMediaButton.tsx +++ b/src/view/com/composer/SelectMediaButton.tsx @@ -12,6 +12,7 @@ import {openUnifiedPicker} from '#/lib/media/picker' import {extractDataUriMime} from '#/lib/media/util' import {isNative, isWeb} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {MAX_IMAGES} from '#/view/com/composer/state/composer' import {atoms as a, useTheme} from '#/alf' import {Button} from '#/components/Button' @@ -460,6 +461,8 @@ selectionCountRemaining, ]) + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -77,7 +80,7 @@ size="tiny" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => scrollRight()}> @@ -135,6 +138,7 @@ isCarouselItem={true} rootPost={slice.items[0].post} showReplyTo={false} + reqId={undefined} /> ) diff --git a/src/view/com/profile/ProfileMenu.tsx b/src/view/com/profile/ProfileMenu.tsx --- a/src/view/com/profile/ProfileMenu.tsx +++ b/src/view/com/profile/ProfileMenu.tsx @@ -20,6 +20,7 @@ useDeerVerificationTrusted, useSetDeerVerificationTrust, } from '#/state/preferences/deer-verification' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { RQKEY as profileQueryKey, useProfileBlockMutationQueue, @@ -235,6 +236,8 @@ const status = useActorStatus(profile) + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -249,7 +252,7 @@ variant="solid" color="secondary" size="small" - shape="round"> + shape={enableSquareButtons ? 'square' : 'round'}> ) diff --git a/src/view/com/util/LoadingPlaceholder.tsx b/src/view/com/util/LoadingPlaceholder.tsx --- a/src/view/com/util/LoadingPlaceholder.tsx +++ b/src/view/com/util/LoadingPlaceholder.tsx @@ -8,6 +8,7 @@ } from 'react-native' import {s} from '#/lib/styles' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme} from '#/alf' import {Bubble_Stroke2_Corner2_Rounded as Bubble} from '#/components/icons/Bubble' import { @@ -277,9 +278,14 @@ }) { const t = useTheme() const random = useMemo(() => Math.random(), []) + const enableSquareButtons = useEnableSquareButtons() return ( - + diff --git a/src/view/screens/Storybook/Links.tsx b/src/view/screens/Storybook/Links.tsx --- a/src/view/screens/Storybook/Links.tsx +++ b/src/view/screens/Storybook/Links.tsx @@ -1,5 +1,6 @@ import {View} from 'react-native' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme} from '#/alf' import {ButtonText} from '#/components/Button' import {InlineLinkText, Link} from '#/components/Link' @@ -7,6 +8,7 @@ export function Links() { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return (

Links

@@ -55,7 +57,7 @@ diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -21,6 +21,7 @@ import {useGate} from '#/lib/statsig/statsig' import {emitSoftReset} from '#/state/events' import {useHomeBadge} from '#/state/home-badge' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useUnreadMessageCount} from '#/state/queries/messages/list-conversations' import {useUnreadNotifications} from '#/state/queries/notifications/unread' import {useProfileQuery} from '#/state/queries/profile' @@ -396,6 +397,7 @@ accessibilityHint, accessibilityLabel, }: BtnProps) { + const enableSquareButtons = useEnableSquareButtons() return ( {icon} {notificationCount ? ( - + {notificationCount} ) : hasNew ? ( - + ) : null} ) diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -21,6 +21,7 @@ import {isInvalidHandle, sanitizeHandle} from '#/lib/strings/handles' import {emitSoftReset} from '#/state/events' import {useHomeBadge} from '#/state/home-badge' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useFetchHandle} from '#/state/queries/handle' import {useUnreadMessageCount} from '#/state/queries/messages/list-conversations' import {useUnreadNotifications} from '#/state/queries/notifications/unread' @@ -103,6 +104,8 @@ const {isActive: live} = useActorStatus(profile) + const enableSquareButtons = useEnableSquareButtons() + return ( {!isLoading && profile ? ( @@ -118,7 +121,7 @@ a.w_full, a.transition_color, active ? t.atoms.bg_contrast_25 : a.transition_delay_50ms, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.justify_between, a.align_center, a.flex_row, @@ -379,6 +382,9 @@ const {currentAccount} = useSession() const {leftNavMinimal} = useLayoutBreakpoints() const [pathName] = useMemo(() => router.matchPath(href), [href]) + + const enableSquareButtons = useEnableSquareButtons() + const currentRouteInfo = useNavigationState(state => { if (!state) { return {name: 'Home'} @@ -465,7 +471,7 @@ a.absolute, a.text_xs, a.font_semi_bold, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.text_center, a.leading_tight, a.z_20, @@ -493,7 +499,7 @@ { const routes = getState()?.routes @@ -577,7 +585,7 @@ size="large" variant="solid" color="primary" - style={[a.rounded_full]}> + style={enableSquareButtons ? [a.rounded_sm] : [a.rounded_full]}> New Post diff --git a/src/view/shell/desktop/SidebarTrendingTopics.tsx b/src/view/shell/desktop/SidebarTrendingTopics.tsx --- a/src/view/shell/desktop/SidebarTrendingTopics.tsx +++ b/src/view/shell/desktop/SidebarTrendingTopics.tsx @@ -4,6 +4,7 @@ import {useLingui} from '@lingui/react' import {logEvent} from '#/lib/statsig/statsig' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useTrendingSettings, useTrendingSettingsApi, @@ -39,6 +40,8 @@ const {data: trending, error, isLoading} = useTrendingTopics() const noTopics = !isLoading && !error && !trending?.topics?.length + const enableSquareButtons = useEnableSquareButtons() + const onConfirmHide = React.useCallback(() => { logEvent('trendingTopics:hide', {context: 'sidebar'}) setTrendingDisabled(true) @@ -63,7 +66,7 @@ size="tiny" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => trendingPrompt.open()}> @@ -82,7 +85,7 @@ { logEvent('trendingTopic:click', {context: 'sidebar'}) }}> diff --git a/src/components/Post/Embed/VideoEmbed/index.tsx b/src/components/Post/Embed/VideoEmbed/index.tsx --- a/src/components/Post/Embed/VideoEmbed/index.tsx +++ b/src/components/Post/Embed/VideoEmbed/index.tsx @@ -5,6 +5,7 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {ErrorBoundary} from '#/view/com/util/ErrorBoundary' import {ConstrainedImage} from '#/view/com/util/images/AutoSizedImage' import {atoms as a} from '#/alf' @@ -66,6 +67,8 @@ const {_} = useLingui() const ref = useRef<{togglePlayback: () => void}>(null) + const enableSquareButtons = useEnableSquareButtons() + const [status, setStatus] = useState<'playing' | 'paused' | 'pending'>( 'pending', ) @@ -116,7 +119,7 @@ {showSpinner ? ( Promise}>(null) + const enableSquareButtons = useEnableSquareButtons() + const cancelButton = useCallback( () => ( ), - [control, _, pending], + [control, _, pending, enableSquareButtons], ) const saveButton = useCallback( @@ -69,7 +72,7 @@ size="small" color="primary" variant="ghost" - style={[a.rounded_full]} + style={enableSquareButtons ? [a.rounded_sm] : [a.rounded_full]} testID="cropImageSaveBtn"> Save @@ -77,7 +80,7 @@ {pending && } ), - [_, pending], + [_, pending, enableSquareButtons], ) return ( diff --git a/src/view/com/composer/photos/Gallery.tsx b/src/view/com/composer/photos/Gallery.tsx --- a/src/view/com/composer/photos/Gallery.tsx +++ b/src/view/com/composer/photos/Gallery.tsx @@ -18,6 +18,7 @@ import {colors, s} from '#/lib/styles' import {isNative} from '#/platform/detection' import {type ComposerImage, cropImage} from '#/state/gallery' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {Text} from '#/view/com/util/text/Text' import {tokens, useTheme} from '#/alf' import * as Dialog from '#/components/Dialog' @@ -144,6 +145,8 @@ const altTextControl = Dialog.useDialogControl() const editControl = Dialog.useDialogControl() + const enableSquareButtons = useEnableSquareButtons() + const onImageEdit = () => { if (isNative) { cropImage(image).then(next => { @@ -195,7 +198,11 @@ accessibilityLabel={_(msg`Edit image`)} accessibilityHint="" onPress={onImageEdit} - style={styles.imageControl}> + style={ + enableSquareButtons + ? styles.imageControlSquare + : styles.imageControl + }> + style={ + enableSquareButtons + ? styles.imageControlSquare + : styles.imageControl + }> { try { @@ -71,7 +74,7 @@ accessibilityHint={_(msg`Opens camera on device`)} style={a.p_sm} variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} color="primary" disabled={disabled}> diff --git a/src/view/com/composer/photos/SelectGifBtn.tsx b/src/view/com/composer/photos/SelectGifBtn.tsx --- a/src/view/com/composer/photos/SelectGifBtn.tsx +++ b/src/view/com/composer/photos/SelectGifBtn.tsx @@ -4,6 +4,7 @@ import {useLingui} from '@lingui/react' import {logEvent} from '#/lib/statsig/statsig' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {type Gif} from '#/state/queries/tenor' import {atoms as a, useTheme} from '#/alf' import {Button} from '#/components/Button' @@ -21,6 +22,8 @@ const ref = useRef<{open: () => void}>(null) const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() + const onPressSelectGif = useCallback(async () => { logEvent('composer:gif:open', {}) Keyboard.dismiss() @@ -36,7 +39,7 @@ accessibilityHint={_(msg`Opens GIF select dialog`)} style={a.p_sm} variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} color="primary" disabled={disabled}> diff --git a/src/view/com/composer/select-language/PostLanguageSelectDialog.tsx b/src/view/com/composer/select-language/PostLanguageSelectDialog.tsx --- a/src/view/com/composer/select-language/PostLanguageSelectDialog.tsx +++ b/src/view/com/composer/select-language/PostLanguageSelectDialog.tsx @@ -7,6 +7,7 @@ import {languageName} from '#/locale/helpers' import {type Language, LANGUAGES, LANGUAGES_MAP_CODE2} from '#/locale/languages' import {isNative, isWeb} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { toPostLanguages, useLanguagePrefs, @@ -92,6 +93,8 @@ const setLangPrefs = useLanguagePrefsApi() const t = useTheme() const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() const handleClose = () => { control.close(() => { @@ -200,7 +203,7 @@ variant="ghost" size="small" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} label={_(msg`Close dialog`)} onPress={handleClose}> diff --git a/src/view/com/composer/videos/SubtitleDialog.tsx b/src/view/com/composer/videos/SubtitleDialog.tsx --- a/src/view/com/composer/videos/SubtitleDialog.tsx +++ b/src/view/com/composer/videos/SubtitleDialog.tsx @@ -8,6 +8,7 @@ import {LANGUAGES} from '#/locale/languages' import {isWeb} from '#/platform/detection' import {useLanguagePrefs} from '#/state/preferences' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme, web} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' @@ -212,6 +213,8 @@ [setCaptions, language], ) + const enableSquareButtons = useEnableSquareButtons() + return ( diff --git a/src/view/com/util/error/ErrorScreen.tsx b/src/view/com/util/error/ErrorScreen.tsx --- a/src/view/com/util/error/ErrorScreen.tsx +++ b/src/view/com/util/error/ErrorScreen.tsx @@ -7,6 +7,7 @@ import {useLingui} from '@lingui/react' import {usePalette} from '#/lib/hooks/usePalette' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as ArrowRotateCounterClockwiseIcon} from '#/components/icons/ArrowRotateCounterClockwise' @@ -31,6 +32,7 @@ const t = useTheme() const pal = usePalette('default') const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() return ( @@ -49,7 +51,7 @@ - + }) { + const enableSquareButtons = useEnableSquareButtons() return ( void @@ -21,10 +22,14 @@ const ImageDefaultHeader = ({onRequestClose}: Props) => { const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() return ( void }) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/web-controls/Scrubber.tsx @@ -5,6 +5,7 @@ import {isFirefox, isTouchDevice} from '#/lib/browser' import {clamp} from '#/lib/numbers' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {atoms as a, useTheme, web} from '#/alf' import {useInteractionState} from '#/components/hooks/useInteractionState' import {formatTime} from './utils' @@ -33,6 +34,7 @@ const {_} = useLingui() const t = useTheme() const [scrubberActive, setScrubberActive] = useState(false) + const enableSquareButtons = useEnableSquareButtons() const { state: hovered, onIn: onStartHover, @@ -174,7 +176,7 @@