From cb5eb33ad98d93af99f5f7387fc0cc3312001e7c Mon Sep 17 00:00:00 2001 From: Daniela Henkel Date: Thu, 20 Nov 2025 09:02:46 +0100 Subject: [PATCH] the very awful square ui toggle (not well made n wip) --- src/components/AccountList.tsx | 7 ++- src/components/BlockedGeoOverlay.tsx | 5 +- src/components/Button.tsx | 13 +++-- src/components/ContextMenu/index.tsx | 6 ++- src/components/Dialog/index.web.tsx | 6 ++- src/components/IconCircle.tsx | 4 +- src/components/InterestTabs.tsx | 10 ++-- src/components/Menu/index.tsx | 6 ++- src/components/Menu/index.web.tsx | 6 ++- src/components/Pills.tsx | 5 +- src/components/PolicyUpdateOverlay/Badge.tsx | 4 +- .../VideoEmbedInner/VideoEmbedInnerNative.tsx | 4 +- .../web-controls/ControlButton.tsx | 4 +- .../VideoEmbedInner/web-controls/Scrubber.tsx | 6 ++- .../Post/Embed/VideoEmbed/index.tsx | 5 +- .../PostControls/PostControlButton.tsx | 5 +- .../PostControls/ShareMenu/RecentChats.tsx | 4 +- src/components/ProfileHoverCard/index.web.tsx | 7 ++- src/components/Select/index.tsx | 7 ++- src/components/TrendingTopics.tsx | 10 +++- .../SubscribeProfileButton.tsx | 5 +- .../ageAssurance/AgeAssuranceAdmonition.tsx | 4 +- .../ageAssurance/AgeAssuranceBadge.tsx | 4 +- .../AgeAssuranceDismissibleFeedBanner.tsx | 5 +- .../AgeAssuranceDismissibleNotice.tsx | 5 +- src/components/dialogs/GifSelect.tsx | 7 ++- src/components/dialogs/MutedWords.tsx | 5 +- .../dialogs/SearchablePeopleList.tsx | 9 +++- src/components/dialogs/StarterPackDialog.tsx | 5 +- .../dialogs/lists/CreateOrEditListDialog.tsx | 10 ++-- .../dialogs/nuxs/ActivitySubscriptions.tsx | 5 +- .../nuxs/InitialVerificationAnnouncement.tsx | 5 +- src/components/dms/ActionsWrapper.web.tsx | 7 ++- src/components/dms/ChatEmptyPill.tsx | 5 +- src/components/dms/ConvoMenu.tsx | 5 +- src/components/dms/EmojiPopup.android.tsx | 5 +- src/components/dms/EmojiReactionPicker.tsx | 9 ++-- .../dms/EmojiReactionPicker.web.tsx | 9 ++-- src/components/dms/MessageProfileButton.tsx | 7 ++- src/components/dms/NewMessagesPill.tsx | 5 +- src/components/forms/SearchInput.tsx | 5 +- src/components/forms/Toggle/index.tsx | 11 ++-- src/components/interstitials/Trending.tsx | 5 +- .../interstitials/TrendingVideos.tsx | 5 +- .../moderation/ReportDialog/index.tsx | 12 +++-- src/components/moderation/ScreenHider.tsx | 7 ++- .../verification/VerificationsDialog.tsx | 5 +- src/components/video/PlayButtonIcon.tsx | 5 +- src/screens/Hashtag.tsx | 5 +- src/screens/Messages/ChatList.tsx | 5 +- .../Messages/components/ChatListItem.tsx | 6 ++- .../Messages/components/InboxPreview.tsx | 4 +- .../Messages/components/MessageInput.tsx | 5 +- .../Messages/components/MessageInput.web.tsx | 7 ++- .../Messages/components/MessageInputEmbed.tsx | 5 +- .../PostThread/components/HeaderDropdown.tsx | 6 ++- .../components/ThreadComposePrompt.tsx | 4 +- .../components/ThreadItemAnchor.tsx | 4 +- .../ThreadItemAnchorFollowButton.tsx | 5 +- .../Profile/Header/EditProfileDialog.tsx | 9 ++-- .../Profile/Header/ProfileHeaderLabeler.tsx | 7 ++- .../Profile/Header/ProfileHeaderStandard.tsx | 15 ++++-- src/screens/Profile/Header/Shell.tsx | 4 +- .../Profile/components/ProfileFeedHeader.tsx | 8 ++- src/screens/ProfileList/components/Header.tsx | 9 ++-- .../components/MoreOptionsMenu.tsx | 5 +- .../ProfileList/components/SubscribeMenu.tsx | 5 +- .../Search/components/ModuleHeader.tsx | 4 +- .../Search/components/SearchHistory.tsx | 9 +++- .../Search/components/StarterPackCard.tsx | 11 ++-- .../Search/modules/ExploreInterestsCard.tsx | 7 ++- .../Search/modules/ExploreTrendingTopics.tsx | 10 +++- .../Search/modules/ExploreTrendingVideos.tsx | 4 +- src/screens/Settings/DeerSettings.tsx | 19 +++++++ src/screens/Settings/InterestsSettings.tsx | 5 +- src/screens/Settings/Settings.tsx | 5 +- .../components/ChangeHandleDialog.tsx | 9 ++-- src/screens/StarterPack/StarterPackScreen.tsx | 5 +- src/screens/StarterPack/Wizard/index.tsx | 4 +- src/screens/Topic.tsx | 5 +- src/screens/VideoFeed/components/Header.tsx | 5 +- src/screens/VideoFeed/index.tsx | 4 +- src/state/persisted/schema.ts | 2 + .../preferences/enable-square-buttons.tsx | 50 +++++++++++++++++++ src/state/preferences/index.tsx | 5 +- src/view/com/composer/Composer.tsx | 29 ++++++++--- .../com/composer/ExternalEmbedRemoveBtn.tsx | 5 +- src/view/com/composer/SelectMediaButton.tsx | 5 +- .../composer/photos/EditImageDialog.web.tsx | 11 ++-- src/view/com/composer/photos/Gallery.tsx | 23 ++++++++- .../com/composer/photos/OpenCameraBtn.tsx | 5 +- src/view/com/composer/photos/SelectGifBtn.tsx | 5 +- .../PostLanguageSelectDialog.tsx | 5 +- .../com/composer/videos/SubtitleDialog.tsx | 5 +- .../components/ImageDefaultHeader.tsx | 17 ++++++- src/view/com/lists/MyLists.tsx | 6 ++- src/view/com/posts/PostFeedItemCarousel.tsx | 8 ++- src/view/com/profile/ProfileMenu.tsx | 5 +- src/view/com/util/LoadingPlaceholder.tsx | 8 ++- src/view/com/util/error/ErrorScreen.tsx | 4 +- src/view/com/util/fab/FABInner.tsx | 5 +- .../com/util/load-latest/LoadLatestBtn.tsx | 9 +++- src/view/screens/DebugMod.tsx | 10 ++-- src/view/screens/Feeds.tsx | 5 +- src/view/screens/Notifications.tsx | 5 +- src/view/screens/Storybook/Links.tsx | 4 +- src/view/shell/Drawer.tsx | 4 +- src/view/shell/bottom-bar/BottomBar.tsx | 15 +++++- src/view/shell/desktop/LeftNav.tsx | 16 ++++-- .../shell/desktop/SidebarTrendingTopics.tsx | 7 ++- 110 files changed, 629 insertions(+), 173 deletions(-) create mode 100644 src/state/preferences/enable-square-buttons.tsx diff --git a/src/components/AccountList.tsx b/src/components/AccountList.tsx index 70fc29d5b..7dc8ff03d 100644 --- a/src/components/AccountList.tsx +++ b/src/components/AccountList.tsx @@ -8,6 +8,7 @@ import {useActorStatus} from '#/lib/actor-status' 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 @@ export function AccountList({ 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 @@ export function AccountList({ { onSelect(account) @@ -201,7 +204,7 @@ function AccountItem({ 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 index d6e262687..9061a0cf8 100644 --- a/src/components/BlockedGeoOverlay.tsx +++ b/src/components/BlockedGeoOverlay.tsx @@ -7,6 +7,7 @@ import {useLingui} from '@lingui/react' 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' @@ -28,6 +29,8 @@ export function BlockedGeoOverlay() { const geoDialog = Dialog.useDialogControl() const {setDeviceGeolocation} = useDeviceGeolocationApi() + const enableSquareButtons = useEnableSquareButtons() + useEffect(() => { // just counting overall hits here logger.metric(`blockedGeoOverlay:shown`, {}) @@ -85,7 +88,7 @@ export function BlockedGeoOverlay() { 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 index efac8468d..b07d63cbd 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -14,6 +14,7 @@ import { 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' @@ -151,6 +152,8 @@ export const Button = React.forwardRef( variant = 'solid' } + const enableSquareButtons = useEnableSquareButtons() + const t = useTheme() const [state, setState] = React.useState({ pressed: false, @@ -440,19 +443,19 @@ export const Button = React.forwardRef( 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 @@ export const Button = React.forwardRef( } 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 @@ export const Button = React.forwardRef( baseStyles, hoverStyles, } - }, [t, variant, color, size, shape, disabled]) + }, [t, variant, color, size, shape, disabled, enableSquareButtons]) const context = React.useMemo( () => ({ diff --git a/src/components/ContextMenu/index.tsx b/src/components/ContextMenu/index.tsx index 7d078bb2d..1f9aafc3b 100644 --- a/src/components/ContextMenu/index.tsx +++ b/src/components/ContextMenu/index.tsx @@ -50,6 +50,7 @@ import {useHaptics} from '#/lib/haptics' 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 ItemIcon({icon: Comp}: ItemIconProps) { export function ItemRadio({selected}: {selected: boolean}) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( close()} label={_(msg`Close active dialog`)}> diff --git a/src/components/IconCircle.tsx b/src/components/IconCircle.tsx index 2e3af7d84..53befc5c9 100644 --- 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 @@ export function IconCircle({ 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) scrollIntoViewIfNeeded(index) @@ -264,7 +267,7 @@ export function InterestTabs({ t.atoms.bg, a.h_full, a.aspect_square, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, ]}> @@ -298,7 +301,7 @@ export function InterestTabs({ t.atoms.bg, a.h_full, a.aspect_square, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, ]}> @@ -325,6 +328,7 @@ function Tab({ }) { const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() const label = active ? _( msg({ @@ -355,7 +359,7 @@ function Tab({ {({hovered, pressed, focused}) => ( { switch (size) { case 'lg': { @@ -116,7 +119,7 @@ export function Label({ 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/PolicyUpdateOverlay/Badge.tsx b/src/components/PolicyUpdateOverlay/Badge.tsx index b3bb8b77b..0dc5f82c0 100644 --- a/src/components/PolicyUpdateOverlay/Badge.tsx +++ b/src/components/PolicyUpdateOverlay/Badge.tsx @@ -1,12 +1,14 @@ import {View} from 'react-native' import {Trans} from '@lingui/macro' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {Logo} from '#/view/icons/Logo' import {atoms as a, useTheme} from '#/alf' import {Text} from '#/components/Typography' export function Badge() { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( }) { + 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 index 39661adef..e4ad4c481 100644 --- 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 {useLingui} from '@lingui/react' 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 @@ export function Scrubber({ const {_} = useLingui() const t = useTheme() const [scrubberActive, setScrubberActive] = useState(false) + const enableSquareButtons = useEnableSquareButtons() const { state: hovered, onIn: onStartHover, @@ -174,7 +176,7 @@ export function Scrubber({ void}>(null) + const enableSquareButtons = useEnableSquareButtons() + const [status, setStatus] = useState<'playing' | 'paused' | 'pending'>( 'pending', ) @@ -116,7 +119,7 @@ function InnerWrapper({embed}: Props) { {showSpinner ? ( ({ big, @@ -82,7 +85,7 @@ export function PostControlButton({ 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/PostControls/ShareMenu/RecentChats.tsx b/src/components/PostControls/ShareMenu/RecentChats.tsx index e17a6adb2..4707f1c60 100644 --- a/src/components/PostControls/ShareMenu/RecentChats.tsx +++ b/src/components/PostControls/ShareMenu/RecentChats.tsx @@ -10,6 +10,7 @@ import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {logger} from '#/logger' import {useProfileShadow} from '#/state/cache/profile-shadow' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useListConvosQuery} from '#/state/queries/messages/list-conversations' import {useSession} from '#/state/session' @@ -154,6 +155,7 @@ function RecentChatItem({ function ConvoSkeleton() { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( @@ -482,7 +485,7 @@ function Inner({ 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 @@ function Inner({ ? _(msg`Following`) : _(msg`Follow`) } - style={[a.rounded_full]} + style={enableSquareButtons ? [a.rounded_sm] : [a.rounded_full]} onPress={profileShadow.viewer?.following ? unfollow : follow}> ({ const {_} = useLingui() const [headerHeight, setHeaderHeight] = useState(50) + const enableSquareButtons = useEnableSquareButtons() + const render = useCallback( ({item, index}: {item: T; index: number}) => { return renderItem(item, index, context.value) @@ -187,13 +190,13 @@ function ContentInner({ 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/TrendingTopics.tsx b/src/components/TrendingTopics.tsx index b2ee8140e..efdde6d67 100644 --- a/src/components/TrendingTopics.tsx +++ b/src/components/TrendingTopics.tsx @@ -5,6 +5,7 @@ import {msg} from '@lingui/macro' 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 @@ export function TrendingTopic({ const hasIcon = topic.type === 'starter-pack' && !isSmall const iconSize = 20 + const enableSquareButtons = useEnableSquareButtons() + return ( diff --git a/src/components/ageAssurance/AgeAssuranceAdmonition.tsx b/src/components/ageAssurance/AgeAssuranceAdmonition.tsx index 028e1dad5..047493bbe 100644 --- a/src/components/ageAssurance/AgeAssuranceAdmonition.tsx +++ b/src/components/ageAssurance/AgeAssuranceAdmonition.tsx @@ -4,6 +4,7 @@ import {useLingui} from '@lingui/react' 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 @@ function Inner({ }) { const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() return ( <> @@ -67,7 +69,7 @@ function Inner({ 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 index f8b5ee9b2..f1f158f02 100644 --- 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 index dc9158ede..80ff44a37 100644 --- a/src/components/dialogs/MutedWords.tsx +++ b/src/components/dialogs/MutedWords.tsx @@ -6,6 +6,7 @@ import {useLingui} from '@lingui/react' import {logger} from '#/logger' import {isNative} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { usePreferencesQuery, useRemoveMutedWordMutation, @@ -426,6 +427,8 @@ function MutedWordRow({ 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 @@ function MutedWordRow({ diff --git a/src/components/dialogs/lists/CreateOrEditListDialog.tsx b/src/components/dialogs/lists/CreateOrEditListDialog.tsx index 203882d80..62df3a2ac 100644 --- a/src/components/dialogs/lists/CreateOrEditListDialog.tsx +++ b/src/components/dialogs/lists/CreateOrEditListDialog.tsx @@ -11,6 +11,7 @@ import {shortenLinks, stripInvalidMentions} from '#/lib/strings/rich-text-manip' import {logger} from '#/logger' import {isWeb} from '#/platform/detection' import {type ImageMeta} from '#/state/gallery' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useListCreateMutation, useListMetadataMutation, @@ -120,6 +121,8 @@ function DialogInner({ }, [list, purpose]) const isCurateList = activePurpose === 'app.bsky.graph.defs#curatelist' + const enableSquareButtons = useEnableSquareButtons() + const {_} = useLingui() const t = useTheme() const agent = useAgent() @@ -276,14 +279,14 @@ function DialogInner({ size="small" color="primary" variant="ghost" - style={[a.rounded_full]} + style={[enableSquareButtons ? a.rounded_sm : a.rounded_full]} testID="editProfileCancelBtn"> Cancel ), - [onPressCancel, _], + [onPressCancel, _, enableSquareButtons], ) const saveButton = useCallback( @@ -301,7 +304,7 @@ function DialogInner({ 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 @@ function DialogInner({ isUpdatingList, displayNameTooLong, descriptionTooLong, + enableSquareButtons, ], ) diff --git a/src/components/dialogs/nuxs/ActivitySubscriptions.tsx b/src/components/dialogs/nuxs/ActivitySubscriptions.tsx index 5947b5601..1bdf13bbd 100644 --- a/src/components/dialogs/nuxs/ActivitySubscriptions.tsx +++ b/src/components/dialogs/nuxs/ActivitySubscriptions.tsx @@ -5,6 +5,7 @@ import {msg, Trans} from '@lingui/macro' 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' @@ -18,6 +19,8 @@ export function ActivitySubscriptionsNUX() { const nuxDialogs = useNuxDialogContext() const control = Dialog.useDialogControl() + const enableSquareButtons = useEnableSquareButtons() + Dialog.useAutoOpen(control) const onClose = useCallback(() => { @@ -55,7 +58,7 @@ export function ActivitySubscriptionsNUX() { 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 index d926b82bb..9c7004d6e 100644 --- a/src/components/dialogs/nuxs/InitialVerificationAnnouncement.tsx +++ b/src/components/dialogs/nuxs/InitialVerificationAnnouncement.tsx @@ -7,6 +7,7 @@ import {useLingui} from '@lingui/react' 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' @@ -23,6 +24,8 @@ export function InitialVerificationAnnouncement() { const nuxDialogs = useNuxDialogContext() const control = Dialog.useDialogControl() + const enableSquareButtons = useEnableSquareButtons() + Dialog.useAutoOpen(control) const onClose = useCallback(() => { @@ -44,7 +47,7 @@ export function InitialVerificationAnnouncement() { 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/dms/ActionsWrapper.web.tsx b/src/components/dms/ActionsWrapper.web.tsx index cf62af1b4..961ea3735 100644 --- a/src/components/dms/ActionsWrapper.web.tsx +++ b/src/components/dms/ActionsWrapper.web.tsx @@ -5,6 +5,7 @@ import {msg} from '@lingui/macro' 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' @@ -31,6 +32,8 @@ export function ActionsWrapper({ const [showActions, setShowActions] = useState(false) + const enableSquareButtons = useEnableSquareButtons() + const onMouseEnter = useCallback(() => { setShowActions(true) }, []) @@ -99,7 +102,7 @@ export function ActionsWrapper({ 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 [ _(msg`Say hello!`), @@ -79,7 +82,7 @@ export function ChatEmptyPill() { 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 index fa50ec1e9..50ea7f6b2 100644 --- a/src/components/dms/ConvoMenu.tsx +++ b/src/components/dms/ConvoMenu.tsx @@ -7,6 +7,7 @@ import {useNavigation} from '@react-navigation/native' 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 @@ let ConvoMenu = ({ const {listBlocks} = blockInfo + const enableSquareButtons = useEnableSquareButtons() + return ( <> @@ -86,7 +89,7 @@ let ConvoMenu = ({ }} 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 index c2222e5bf..1d3eb01f0 100644 --- a/src/components/dms/EmojiPopup.android.tsx +++ b/src/components/dms/EmojiPopup.android.tsx @@ -4,6 +4,7 @@ import {SafeAreaView} from 'react-native-safe-area-context' 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' @@ -21,6 +22,8 @@ export function EmojiPopup({ const {_} = useLingui() const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() + return ( <> + shape={enableSquareButtons ? 'square' : 'round'}> diff --git a/src/components/dms/EmojiReactionPicker.tsx b/src/components/dms/EmojiReactionPicker.tsx index b83fd4454..10b12f659 100644 --- a/src/components/dms/EmojiReactionPicker.tsx +++ b/src/components/dms/EmojiReactionPicker.tsx @@ -4,6 +4,7 @@ import {type ChatBskyConvoDefs} from '@atproto/api' 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 @@ export function EmojiReactionPicker({ 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 @@ export function EmojiReactionPicker({ {hovered => ( ) : ( - + {['👍', '😆', '❤️', '👀', '😢'].map(emoji => { const alreadyReacted = hasAlreadyReacted( @@ -109,7 +112,7 @@ function MenuInner({ 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 @@ function MenuInner({ 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 index fbbb5c9bf..4552ab6f7 100644 --- a/src/components/dms/MessageProfileButton.tsx +++ b/src/components/dms/MessageProfileButton.tsx @@ -8,6 +8,7 @@ import {useNavigation} from '@react-navigation/native' 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' @@ -26,6 +27,8 @@ export function MessageProfileButton({ const navigation = useNavigation() const requireEmailVerification = useRequireEmailVerification() + const enableSquareButtons = useEnableSquareButtons() + const {data: convoAvailability} = useGetConvoAvailabilityQuery(profile.did) const {mutate: initiateConvo} = useGetConvoForMembers({ onSuccess: ({convo}) => { @@ -72,7 +75,7 @@ export function MessageProfileButton({ 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 @@ export function MessageProfileButton({ 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 index c220899c4..527cdfa89 100644 --- a/src/components/dms/NewMessagesPill.tsx +++ b/src/components/dms/NewMessagesPill.tsx @@ -15,6 +15,7 @@ import { } 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' @@ -33,6 +34,8 @@ export function NewMessagesPill({ const scale = useSharedValue(1) + const enableSquareButtons = useEnableSquareButtons() + const onPressIn = React.useCallback(() => { if (isWeb) return scale.set(() => withTiming(1.075, {duration: 100})) @@ -68,7 +71,7 @@ export function NewMessagesPill({ ( const {_} = useLingui() const showClear = value && value.length > 0 + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -70,7 +73,7 @@ export const SearchInput = React.forwardRef( 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/forms/Toggle/index.tsx b/src/components/forms/Toggle/index.tsx index 60fa50478..6da3e8a44 100644 --- a/src/components/forms/Toggle/index.tsx +++ b/src/components/forms/Toggle/index.tsx @@ -11,6 +11,7 @@ import Animated, {Easing, LinearTransition} from 'react-native-reanimated' 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 Checkbox() { 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 @@ export function Switch() { { logEvent('trendingTopics:hide', {context: 'interstitial'}) setTrendingDisabled(true) @@ -114,7 +117,7 @@ export function Inner() { 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 index 175f92fd5..36cf27ad0 100644 --- a/src/components/interstitials/TrendingVideos.tsx +++ b/src/components/interstitials/TrendingVideos.tsx @@ -8,6 +8,7 @@ import {useQueryClient} from '@tanstack/react-query' 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 @@ function ViewMoreCard() { return makeCustomFeedLink(urip.host, urip.rkey, undefined, 'discover') }, []) + const enableSquareButtons = useEnableSquareButtons() + return ( diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index 2331db3ea..2a087c5d4 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -10,6 +10,7 @@ import {getLabelingServiceTitle} from '#/lib/moderation' import {sanitizeHandle} from '#/lib/strings/handles' import {Logger} from '#/logger' import {isNative} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useMyLabelersQuery} from '#/state/queries/preferences' import {CharProgress} from '#/view/com/composer/char-progress/CharProgress' import {UserAvatar} from '#/view/com/util/UserAvatar' @@ -106,6 +107,8 @@ function Inner(props: ReportDialogProps) { const {categories, getCategory} = useReportOptions() const [state, dispatch] = React.useReducer(reducer, initialState) + const enableSquareButtons = useEnableSquareButtons() + /** * Submission handling */ @@ -290,7 +293,7 @@ function Inner(props: ReportDialogProps) { size="tiny" variant="solid" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => { dispatch({type: 'clearCategory'}) }}> @@ -370,7 +373,7 @@ function Inner(props: ReportDialogProps) { size="tiny" variant="solid" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => { dispatch({type: 'clearOption'}) }}> @@ -425,7 +428,7 @@ function Inner(props: ReportDialogProps) { size="tiny" variant="solid" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => { dispatch({type: 'clearLabeler'}) }}> @@ -605,13 +608,14 @@ function StepTitle({ const t = useTheme() const active = activeIndex1 === index const completed = activeIndex1 > index + const enableSquareButtons = useEnableSquareButtons() return ( @@ -156,7 +159,7 @@ export function ScreenHider({ 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 @@ export function ScreenHider({ 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 index 4091b8053..0fe4ee3bf 100644 --- a/src/components/verification/VerificationsDialog.tsx +++ b/src/components/verification/VerificationsDialog.tsx @@ -6,6 +6,7 @@ import {useLingui} from '@lingui/react' 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 @@ function VerifierCard({ 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 index 801cad9b9..5d2415789 100644 --- 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 @@ export function PlayButtonIcon({size = 32}: {size?: number}) { 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 ( <> { setMinimalShellMode(false) @@ -133,7 +136,7 @@ export default function HashtagScreen({ 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/Messages/ChatList.tsx b/src/screens/Messages/ChatList.tsx index 906fcb017..c8228f473 100644 --- a/src/screens/Messages/ChatList.tsx +++ b/src/screens/Messages/ChatList.tsx @@ -17,6 +17,7 @@ import {isNative} from '#/platform/detection' import {listenSoftReset} from '#/state/events' import {MESSAGE_SCREEN_POLL_INTERVAL} from '#/state/messages/convo/const' import {useMessagesEventBus} from '#/state/messages/events' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useLeftConvos} from '#/state/queries/messages/leave-conversation' import {useListConvosQuery} from '#/state/queries/messages/list-conversations' import {useSession} from '#/state/session' @@ -363,6 +364,8 @@ function Header({newChatControl}: {newChatControl: DialogControlProps}) { const {gtMobile} = useBreakpoints() const requireEmailVerification = useRequireEmailVerification() + const enableSquareButtons = useEnableSquareButtons() + const openChatControl = useCallback(() => { newChatControl.open() }, [newChatControl]) @@ -381,7 +384,7 @@ function Header({newChatControl}: {newChatControl: DialogControlProps}) { size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} style={[a.justify_center]}> diff --git a/src/screens/Messages/components/ChatListItem.tsx b/src/screens/Messages/components/ChatListItem.tsx index f4e786367..7443e160c 100644 --- a/src/screens/Messages/components/ChatListItem.tsx +++ b/src/screens/Messages/components/ChatListItem.tsx @@ -22,6 +22,7 @@ import { } from '#/lib/strings/url-helpers' import {isNative} from '#/platform/detection' import {useProfileShadow} from '#/state/cache/profile-shadow' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import { precacheConvoQuery, @@ -104,6 +105,9 @@ function ChatListItemReady({ const {gtMobile} = useBreakpoints() const profile = useProfileShadow(profileUnshadowed) const {mutate: markAsRead} = useMarkAsReadMutation() + + const enableSquareButtons = useEnableSquareButtons() + const moderation = React.useMemo( () => moderateProfile(profile, moderationOpts), [profile, moderationOpts], @@ -494,7 +498,7 @@ function ChatListItemReady({ (null) + const enableSquareButtons = useEnableSquareButtons() + const onSubmit = React.useCallback(() => { if (!hasEmbed && message.trim() === '') { return @@ -168,7 +171,7 @@ export function MessageInput({ }) }} style={[ - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, a.overflow_hidden, a.align_center, a.justify_center, @@ -235,7 +238,7 @@ export function MessageInput({ 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 index c4d61b000..842529208 100644 --- a/src/screens/Messages/components/MessageInputEmbed.tsx +++ b/src/screens/Messages/components/MessageInputEmbed.tsx @@ -21,6 +21,7 @@ import { 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' @@ -105,6 +106,8 @@ export function MessageInputEmbed({ const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() + const {data: post, status} = usePostQuery(embedUri) const moderationOpts = useModerationOpts() @@ -217,7 +220,7 @@ export function MessageInputEmbed({ 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 index def3979b7..e0611e4ec 100644 --- a/src/screens/PostThread/components/HeaderDropdown.tsx +++ b/src/screens/PostThread/components/HeaderDropdown.tsx @@ -3,6 +3,7 @@ import {useLingui} from '@lingui/react' 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 @@ export function HeaderDropdown({ 'sort' | 'setSort' | 'view' | 'setView' >): React.ReactNode { const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -27,7 +31,7 @@ export function HeaderDropdown({ 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 index e12c7e766..16d521fb2 100644 --- a/src/screens/PostThread/components/ThreadComposePrompt.tsx +++ b/src/screens/PostThread/components/ThreadComposePrompt.tsx @@ -6,6 +6,7 @@ import {useLingui} from '@lingui/react' 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 @@ export function ThreadComposePrompt({ const {gtMobile} = useBreakpoints() const t = useTheme() const playHaptic = useHaptics() + const enableSquareButtons = useEnableSquareButtons() const { state: hovered, onIn: onHoverIn, @@ -76,7 +78,7 @@ export function ThreadComposePrompt({ 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 index 0131fad54..ab88cb67d 100644 --- a/src/screens/PostThread/components/ThreadItemAnchor.tsx +++ b/src/screens/PostThread/components/ThreadItemAnchor.tsx @@ -31,6 +31,7 @@ import {useDisableLikesMetrics} from '#/state/preferences/disable-likes-metrics' 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 @@ function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) { 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 @@ function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) { 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 index d4cf120cf..ed214d170 100644 --- a/src/screens/PostThread/components/ThreadItemAnchorFollowButton.tsx +++ b/src/screens/PostThread/components/ThreadItemAnchorFollowButton.tsx @@ -6,6 +6,7 @@ import {useNavigation} from '@react-navigation/native' import {logger} from '#/logger' import {useProfileShadow} from '#/state/cache/profile-shadow' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { useProfileFollowMutationQueue, useProfileQuery, @@ -46,6 +47,8 @@ function PostThreadFollowBtnLoaded({ 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( () => !isFollowing || !wasFollowing, @@ -115,7 +118,7 @@ function PostThreadFollowBtnLoaded({ 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 @@ function DialogInner({ 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 @@ function DialogInner({ isUpdatingProfile, displayNameTooLong, descriptionTooLong, + enableSquareButtons, ], ) diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx index 59f090f47..aa5a70b6f 100644 --- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx +++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx @@ -18,6 +18,7 @@ import {logger} from '#/logger' 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' @@ -68,6 +69,8 @@ let ProfileHeaderLabeler = ({ const cantSubscribePrompt = Prompt.usePromptControl() const isSelf = currentAccount?.did === profile.did + const enableSquareButtons = useEnableSquareButtons() + const moderation = useMemo( () => moderateProfile(profile, moderationOpts), [profile, moderationOpts], @@ -179,7 +182,7 @@ let ProfileHeaderLabeler = ({ 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 @@ let ProfileHeaderLabeler = ({ 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 index 66a2352fa..d8727f34e 100644 --- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx +++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx @@ -16,6 +16,7 @@ import {sanitizeHandle} from '#/lib/strings/handles' 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, @@ -85,6 +86,8 @@ let ProfileHeaderStandard = ({ const editProfileControl = useDialogControl() + const enableSquareButtons = useEnableSquareButtons() + const onPressFollow = () => { playHaptic() requireAuth(async () => { @@ -194,7 +197,9 @@ let ProfileHeaderStandard = ({ 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 @@ let ProfileHeaderStandard = ({ 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 @@ let ProfileHeaderStandard = ({ 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 index 06e5d0e52..019738241 100644 --- a/src/screens/Profile/Header/Shell.tsx +++ b/src/screens/Profile/Header/Shell.tsx @@ -23,6 +23,7 @@ import {isIOS} from '#/platform/detection' 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 @@ let ProfileHeaderShell = ({ const liveStatusControl = useDialogControl() const highQualityImages = useHighQualityImages() const enableSquareAvatars = useEnableSquareAvatars() + const enableSquareButtons = useEnableSquareButtons() const aviRef = useAnimatedRef() const bannerRef = useAnimatedRef() @@ -233,7 +235,7 @@ let ProfileHeaderShell = ({ 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 index ab16ba684..605844397 100644 --- a/src/screens/Profile/components/ProfileFeedHeader.tsx +++ b/src/screens/Profile/components/ProfileFeedHeader.tsx @@ -12,6 +12,7 @@ import {sanitizeHandle} from '#/lib/strings/handles' 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 @@ import {Text} from '#/components/Typography' export function ProfileFeedHeaderSkeleton() { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( @@ -69,7 +71,7 @@ export function ProfileFeedHeaderSkeleton() { 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 @@ function DialogInner({ 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 @@ function DialogInner({ 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 index 1dc94fbb6..3a15c3b51 100644 --- a/src/screens/ProfileList/components/Header.tsx +++ b/src/screens/ProfileList/components/Header.tsx @@ -7,6 +7,7 @@ import {useLingui} from '@lingui/react' 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, @@ -41,6 +42,8 @@ export function Header({ const isMuting = !!list.viewer?.muted const playHaptic = useHaptics() + const enableSquareButtons = useEnableSquareButtons() + const {mutateAsync: muteList, isPending: isMutePending} = useListMuteMutation() const {mutateAsync: blockList, isPending: isBlockPending} = @@ -157,7 +160,7 @@ export function Header({ 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 @@ export function Header({ 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 @@ export function Header({ 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 index a275854ff..55c0f77ab 100644 --- a/src/screens/ProfileList/components/MoreOptionsMenu.tsx +++ b/src/screens/ProfileList/components/MoreOptionsMenu.tsx @@ -8,6 +8,7 @@ import {shareUrl} from '#/lib/sharing' 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, @@ -61,6 +62,8 @@ export function MoreOptionsMenu({ const isPinned = Boolean(savedFeedConfig?.pinned) const isOwner = currentAccount?.did === list.creator.did + const enableSquareButtons = useEnableSquareButtons() + const onPressShare = () => { const {rkey} = new AtUri(list.uri) const url = toShareUrl(`/profile/${list.creator.did}/lists/${rkey}`) @@ -153,7 +156,7 @@ export function MoreOptionsMenu({ 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 index 5b6b9ba09..7f84028bb 100644 --- a/src/screens/ProfileList/components/SubscribeMenu.tsx +++ b/src/screens/ProfileList/components/SubscribeMenu.tsx @@ -3,6 +3,7 @@ import {msg, Trans} from '@lingui/macro' 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' @@ -25,6 +26,8 @@ export function SubscribeMenu({list}: {list: AppBskyGraphDefs.ListView}) { const isPending = isMutePending || isBlockPending + const enableSquareButtons = useEnableSquareButtons() + const onSubscribeMute = async () => { try { await muteList({uri: list.uri, mute: true}) @@ -73,7 +76,7 @@ export function SubscribeMenu({list}: {list: AppBskyGraphDefs.ListView}) { 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 index 202137a35..6ca79a755 100644 --- a/src/screens/Search/components/ModuleHeader.tsx +++ b/src/screens/Search/components/ModuleHeader.tsx @@ -5,6 +5,7 @@ import {type AppBskyFeedDefs, AtUri} from '@atproto/api' 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 @@ export function SearchButton({ metricsTag: 'suggestedAccounts' | 'suggestedFeeds' onPress?: () => void }) { + const enableSquareButtons = useEnableSquareButtons() return ( @@ -129,6 +132,8 @@ function RecentProfileItem({ ) const verification = useSimpleVerificationState({profile}) + const enableSquareButtons = useEnableSquareButtons() + return ( (null) + const enableSquareButtons = useEnableSquareButtons() + const isPending = (numPending && profiles.length === 0) || !moderationOpts const items = isPending @@ -186,7 +189,7 @@ export function AvatarStack({ 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 @@ export function AvatarStack({ style={[a.absolute, a.inset_0]} /> ) : ( - + )} @@ -231,7 +236,7 @@ export function AvatarStack({ 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 index 012f1d6e1..35f428690 100644 --- a/src/screens/Search/modules/ExploreInterestsCard.tsx +++ b/src/screens/Search/modules/ExploreInterestsCard.tsx @@ -4,6 +4,7 @@ import {msg, Trans} from '@lingui/macro' 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' @@ -23,6 +24,8 @@ export function ExploreInterestsCard() { const trendingPrompt = Prompt.usePromptControl() const [closing, setClosing] = useState(false) + const enableSquareButtons = useEnableSquareButtons() + const onClose = () => { trendingPrompt.open() } @@ -77,7 +80,7 @@ export function ExploreInterestsCard() { 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 @@ export function ExploreInterestsCard() { 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 index cb24ef45c..c1e20058c 100644 --- a/src/screens/Search/modules/ExploreTrendingTopics.tsx +++ b/src/screens/Search/modules/ExploreTrendingTopics.tsx @@ -5,6 +5,7 @@ import {msg, plural, Trans} from '@lingui/macro' 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 @@ type TrendingIndicatorType = 'hot' | 'new' | number 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 @@ export function TrendingTopicRowSkeleton({}: {withPosts: boolean}) { 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 index f57cdb08a..2a8a2e450 100644 --- a/src/screens/Search/modules/ExploreTrendingVideos.tsx +++ b/src/screens/Search/modules/ExploreTrendingVideos.tsx @@ -9,6 +9,7 @@ import {useQueryClient} from '@tanstack/react-query' 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 @@ function VideoCards({ }) { const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() const items = useMemo(() => { return data.pages .flatMap(page => page.slices) @@ -215,7 +217,7 @@ function VideoCards({ 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/DeerSettings.tsx b/src/screens/Settings/DeerSettings.tsx index 83f10f87b..e93d9b73b 100644 --- a/src/screens/Settings/DeerSettings.tsx +++ b/src/screens/Settings/DeerSettings.tsx @@ -61,6 +61,10 @@ import { useEnableSquareAvatars, useSetEnableSquareAvatars, } from '#/state/preferences/enable-square-avatars' +import { + useEnableSquareButtons, + useSetEnableSquareButtons, +} from '#/state/preferences/enable-square-buttons' import { useHideFeedsPromoTab, useSetHideFeedsPromoTab, @@ -283,6 +287,9 @@ export function DeerSettingsScreen({}: Props) { const enableSquareAvatars = useEnableSquareAvatars() const setEnableSquareAvatars = useSetEnableSquareAvatars() + const enableSquareButtons = useEnableSquareButtons() + const setEnableSquareButtons = useSetEnableSquareButtons() + const constellationInstance = useConstellationInstance() const setConstellationInstanceControl = Dialog.useDialogControl() @@ -602,6 +609,18 @@ export function DeerSettingsScreen({}: Props) { + + setEnableSquareButtons(value)} + style={[a.w_full]}> + + Enable square buttons + + + diff --git a/src/screens/Settings/InterestsSettings.tsx b/src/screens/Settings/InterestsSettings.tsx index 074a423ec..05a5b2d61 100644 --- a/src/screens/Settings/InterestsSettings.tsx +++ b/src/screens/Settings/InterestsSettings.tsx @@ -12,6 +12,7 @@ import { 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 @@ export function InterestButton({interest}: {interest: Interest}) { 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 @@ export function InterestButton({interest}: {interest: Interest}) { return ( { if (pendingDid) return onPressSwitchAccount(account, 'Settings') @@ -638,7 +641,7 @@ function AccountRow({ 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/Settings/components/ChangeHandleDialog.tsx b/src/screens/Settings/components/ChangeHandleDialog.tsx index accbf41c8..ec59eb5b9 100644 --- a/src/screens/Settings/components/ChangeHandleDialog.tsx +++ b/src/screens/Settings/components/ChangeHandleDialog.tsx @@ -19,6 +19,7 @@ import {HITSLOP_10, urls} from '#/lib/constants' 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 @@ function ChangeHandleDialogInner() { const control = Dialog.useDialogContext() const {_} = useLingui() const agent = useAgent() + const enableSquareButtons = useEnableSquareButtons() const { data: serviceInfo, error: serviceInfoError, @@ -80,13 +82,13 @@ function ChangeHandleDialogInner() { 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 ChangeHandleError({error}: {error: unknown}) { function SuccessMessage({text}: {text: string}) { const {gtMobile} = useBreakpoints() const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( () + const enableSquareButtons = useEnableSquareButtons() + const { mutate: deleteStarterPack, isPending: isDeletePending, @@ -570,7 +573,7 @@ function OverflowMenu({ variant="solid" color="secondary" size="small" - shape="round"> + shape={enableSquareButtons ? 'square' : 'round'}> )} diff --git a/src/screens/StarterPack/Wizard/index.tsx b/src/screens/StarterPack/Wizard/index.tsx index 5b14ef520..81953d66b 100644 --- a/src/screens/StarterPack/Wizard/index.tsx +++ b/src/screens/StarterPack/Wizard/index.tsx @@ -32,6 +32,7 @@ import { } from '#/lib/strings/starter-pack' import {logger} from '#/logger' import {isNative} from '#/platform/detection' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useAllListMembersQuery} from '#/state/queries/list-members' import {useProfileQuery} from '#/state/queries/profile' @@ -417,6 +418,7 @@ function Footer({ const {bottom: bottomInset} = useSafeAreaInsets() const {currentAccount} = useSession() const items = state.currentStep === 'Profiles' ? state.profiles : state.feeds + const enableSquareButtons = useEnableSquareButtons() const minimumItems = state.currentStep === 'Profiles' ? 8 : 0 @@ -459,7 +461,7 @@ function Footer({ { return enforceLen(decodeURIComponent(topic), 24, true, 'middle') }, [topic]) @@ -103,7 +106,7 @@ export default function TopicScreen({ 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/VideoFeed/components/Header.tsx b/src/screens/VideoFeed/components/Header.tsx index 34f2cb03f..ca1e55b9b 100644 --- a/src/screens/VideoFeed/components/Header.tsx +++ b/src/screens/VideoFeed/components/Header.tsx @@ -7,6 +7,7 @@ import {useNavigation} from '@react-navigation/native' import {HITSLOP_30} from '#/lib/constants' import {type NavigationProp} from '#/lib/routes/types' import {sanitizeHandle} from '#/lib/strings/handles' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {useFeedSourceInfoQuery} from '#/state/queries/feed' import {UserAvatar} from '#/view/com/util/UserAvatar' import {type VideoFeedSourceContext} from '#/screens/VideoFeed/types' @@ -144,6 +145,8 @@ export function BackButton({onPress, style, ...props}: Partial) { const {_} = useLingui() const navigation = useNavigation() + const enableSquareButtons = useEnableSquareButtons() + const onPressBack = useCallback( (evt: GestureResponderEvent) => { onPress?.(evt) @@ -164,7 +167,7 @@ export function BackButton({onPress, style, ...props}: Partial) { size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={onPressBack} hitSlop={HITSLOP_30} style={[ diff --git a/src/screens/VideoFeed/index.tsx b/src/screens/VideoFeed/index.tsx index 98f0f3d47..66e30439d 100644 --- a/src/screens/VideoFeed/index.tsx +++ b/src/screens/VideoFeed/index.tsx @@ -71,6 +71,7 @@ import { 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 @@ function EndMessage() { 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 index 9da460122..a504a2b9b 100644 --- a/src/state/preferences/index.tsx +++ b/src/state/preferences/index.tsx @@ -14,6 +14,7 @@ import {Provider as DisableRepostsMetricsProvider} from './disable-reposts-metri 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 @@ export function Provider({children}: React.PropsWithChildren<{}>) { - {children} + + {children} + diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 842ddb1d3..6521730a8 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -86,6 +86,7 @@ import { } 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 @@ let ComposerPost = React.memo(function ComposerPost({ : _(msg`What's up?`) const discardPromptControl = Prompt.usePromptControl() + const enableSquareButtons = useEnableSquareButtons() + const dispatchPost = useCallback( (action: PostAction) => { dispatch({ @@ -968,7 +971,7 @@ let ComposerPost = React.memo(function ComposerPost({ 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 @@ function ComposerTopBar({ }) { const pal = usePalette('default') const {_} = useLingui() + + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -1365,6 +1378,8 @@ function ComposerFooter({ let selectedAssetsCount = 0 let isMediaSelectionDisabled = false + const enableSquareButtons = useEnableSquareButtons() + if (media?.type === 'images') { isMediaSelectionDisabled = isMaxImages selectedAssetsCount = images.length @@ -1476,7 +1491,7 @@ function ComposerFooter({ label={_(msg`Open emoji picker`)} accessibilityHint={_(msg`Opens emoji picker`)} variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} color="primary"> @@ -1492,7 +1507,7 @@ function ComposerFooter({ onPress={onAddPost} style={[a.p_sm]} variant="ghost" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} color="primary"> @@ -1774,6 +1789,8 @@ function ErrorBanner({ const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() + const videoError = videoState.status === 'error' ? videoState.error : undefined const error = standardError || videoError @@ -1811,7 +1828,7 @@ function ErrorBanner({ 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 index 1e363d018..6a27596cd 100644 --- a/src/view/com/composer/ExternalEmbedRemoveBtn.tsx +++ b/src/view/com/composer/ExternalEmbedRemoveBtn.tsx @@ -2,6 +2,7 @@ import {View} from 'react-native' 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 @@ export function ExternalEmbedRemoveBtn({ 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 index 9401b7975..73373f06f 100644 --- a/src/view/com/composer/SelectMediaButton.tsx +++ b/src/view/com/composer/SelectMediaButton.tsx @@ -12,6 +12,7 @@ import { 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 @@ export function SelectMediaButton({ selectionCountRemaining, ]) + const enableSquareButtons = useEnableSquareButtons() + return ( ), - [control, _, pending], + [control, _, pending, enableSquareButtons], ) const saveButton = useCallback( @@ -69,7 +72,7 @@ function DialogInner({ 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 @@ function DialogInner({ {pending && } ), - [_, pending], + [_, pending, enableSquareButtons], ) return ( diff --git a/src/view/com/composer/photos/Gallery.tsx b/src/view/com/composer/photos/Gallery.tsx index ae31a9b07..ff8c42064 100644 --- a/src/view/com/composer/photos/Gallery.tsx +++ b/src/view/com/composer/photos/Gallery.tsx @@ -18,6 +18,7 @@ import {type Dimensions} from '#/lib/media/types' 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 GalleryItem = ({ const altTextControl = Dialog.useDialogControl() const editControl = Dialog.useDialogControl() + const enableSquareButtons = useEnableSquareButtons() + const onImageEdit = () => { if (isNative) { cropImage(image).then(next => { @@ -195,7 +198,11 @@ const GalleryItem = ({ accessibilityLabel={_(msg`Edit image`)} accessibilityHint="" onPress={onImageEdit} - style={styles.imageControl}> + style={ + enableSquareButtons + ? styles.imageControlSquare + : styles.imageControl + }> + style={ + enableSquareButtons + ? styles.imageControlSquare + : styles.imageControl + }> { try { if (!(await requestCameraAccessIfNeeded())) { @@ -71,7 +74,7 @@ export function OpenCameraBtn({disabled, onAdd}: Props) { 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 index 65e0ed8ce..e68acb07e 100644 --- a/src/view/com/composer/photos/SelectGifBtn.tsx +++ b/src/view/com/composer/photos/SelectGifBtn.tsx @@ -4,6 +4,7 @@ import {msg} from '@lingui/macro' 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 @@ export function SelectGifBtn({onClose, onSelectGif, disabled}: Props) { 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 @@ export function SelectGifBtn({onClose, onSelectGif, disabled}: Props) { 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 index 36d4b1ff9..42e61eb12 100644 --- a/src/view/com/composer/select-language/PostLanguageSelectDialog.tsx +++ b/src/view/com/composer/select-language/PostLanguageSelectDialog.tsx @@ -7,6 +7,7 @@ import {useLingui} from '@lingui/react' 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, @@ -93,6 +94,8 @@ export function DialogInner({ const t = useTheme() const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() + const handleClose = () => { control.close(() => { let langsString = checkedLanguagesCode2.join(',') @@ -200,7 +203,7 @@ export function DialogInner({ 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 index a3e8d62b5..f084f45cb 100644 --- a/src/view/com/composer/videos/SubtitleDialog.tsx +++ b/src/view/com/composer/videos/SubtitleDialog.tsx @@ -8,6 +8,7 @@ import {useEnforceMaxGraphemeCount} from '#/lib/strings/helpers' 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 @@ function SubtitleFileRow({ [setCaptions, language], ) + const enableSquareButtons = useEnableSquareButtons() + return ( diff --git a/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx b/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx index cdee8a826..888b4e1dc 100644 --- a/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx +++ b/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx @@ -12,6 +12,7 @@ import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {createHitslop} from '#/lib/constants' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' type Props = { onRequestClose: () => void @@ -21,10 +22,14 @@ const HIT_SLOP = createHitslop(16) const ImageDefaultHeader = ({onRequestClose}: Props) => { const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() return ( { let items: any[] = [] @@ -107,7 +109,7 @@ export function MyLists({ style={[ a.align_center, a.justify_center, - a.rounded_full, + enableSquareButtons ? a.rounded_sm : a.rounded_full, t.atoms.bg_contrast_25, { width: 32, @@ -159,7 +161,7 @@ export function MyLists({ ) }, - [t, renderItem, error, onRefresh, emptyText], + [t, renderItem, error, onRefresh, emptyText, enableSquareButtons], ) if (inline) { diff --git a/src/view/com/posts/PostFeedItemCarousel.tsx b/src/view/com/posts/PostFeedItemCarousel.tsx index cf66ac3ed..a6ba100ba 100644 --- a/src/view/com/posts/PostFeedItemCarousel.tsx +++ b/src/view/com/posts/PostFeedItemCarousel.tsx @@ -3,6 +3,7 @@ import {Dimensions, ScrollView, View} from 'react-native' import {msg, Plural} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import {type FeedPostSlice} from '#/state/queries/post-feed' import {BlockDrawerGesture} from '#/view/shell/BlockDrawerGesture' import {atoms as a, useTheme} from '#/alf' @@ -23,6 +24,8 @@ export function PostFeedItemCarousel({items}: {items: FeedPostSlice[]}) { const ref = React.useRef(null) const [scrollX, setScrollX] = React.useState(0) + const enableSquareButtons = useEnableSquareButtons() + const scrollTo = React.useCallback( (item: number) => { setScrollX(item) @@ -68,7 +71,7 @@ export function PostFeedItemCarousel({items}: {items: FeedPostSlice[]}) { size="tiny" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => scrollLeft()}> @@ -77,7 +80,7 @@ export function PostFeedItemCarousel({items}: {items: FeedPostSlice[]}) { size="tiny" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} onPress={() => scrollRight()}> @@ -135,6 +138,7 @@ export function PostFeedItemCarousel({items}: {items: FeedPostSlice[]}) { 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 index 9e84066e3..1bbbdf350 100644 --- a/src/view/com/profile/ProfileMenu.tsx +++ b/src/view/com/profile/ProfileMenu.tsx @@ -20,6 +20,7 @@ import { useDeerVerificationTrusted, useSetDeerVerificationTrust, } from '#/state/preferences/deer-verification' +import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons' import { RQKEY as profileQueryKey, useProfileBlockMutationQueue, @@ -235,6 +236,8 @@ let ProfileMenu = ({ const status = useActorStatus(profile) + const enableSquareButtons = useEnableSquareButtons() + return ( @@ -249,7 +252,7 @@ let ProfileMenu = ({ 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 index 3afba7f30..dcacac28a 100644 --- a/src/view/com/util/LoadingPlaceholder.tsx +++ b/src/view/com/util/LoadingPlaceholder.tsx @@ -8,6 +8,7 @@ import { } 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 @@ export function ChatListItemLoadingPlaceholder({ }) { const t = useTheme() const random = useMemo(() => Math.random(), []) + const enableSquareButtons = useEnableSquareButtons() return ( - + diff --git a/src/view/com/util/error/ErrorScreen.tsx b/src/view/com/util/error/ErrorScreen.tsx index d4cba5f48..0772fe317 100644 --- a/src/view/com/util/error/ErrorScreen.tsx +++ b/src/view/com/util/error/ErrorScreen.tsx @@ -7,6 +7,7 @@ import {msg, Trans} from '@lingui/macro' 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 @@ export function ErrorScreen({ const t = useTheme() const pal = usePalette('default') const {_} = useLingui() + const enableSquareButtons = useEnableSquareButtons() return ( @@ -49,7 +51,7 @@ export function ErrorScreen({ - + }) { 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 @@ export function FeedsScreen(_props: Props) { 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 index efad2c665..751b4af23 100644 --- a/src/view/screens/Notifications.tsx +++ b/src/view/screens/Notifications.tsx @@ -16,6 +16,7 @@ import {s} from '#/lib/styles' 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 { @@ -61,6 +62,8 @@ export function NotificationsScreen({}: Props) { const [activeTab, setActiveTab] = useState(initialActiveTab) const isLoading = activeTab === 0 ? isLoadingAll : isLoadingMentions + const enableSquareButtons = useEnableSquareButtons() + const onPageSelected = useCallback( (index: number) => { setActiveTab(index) @@ -137,7 +140,7 @@ export function NotificationsScreen({}: Props) { size="small" variant="ghost" color="secondary" - shape="round" + shape={enableSquareButtons ? 'square' : 'round'} style={[a.justify_center]}> diff --git a/src/view/screens/Storybook/Links.tsx b/src/view/screens/Storybook/Links.tsx index 37e316401..883373f4b 100644 --- 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 @@ import {H1, Text} from '#/components/Typography' export function Links() { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return (

Links

@@ -55,7 +57,7 @@ export function Links() { diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 053f2cb91..27dec9198 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -15,6 +15,7 @@ import {sanitizeHandle} from '#/lib/strings/handles' 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 @@ SettingsMenuItem = React.memo(SettingsMenuItem) function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) { const t = useTheme() + const enableSquareButtons = useEnableSquareButtons() return ( @@ -82,7 +85,7 @@ function Inner() { { logEvent('trendingTopic:click', {context: 'sidebar'}) }}> -- 2.51.2