diff --git a/src/screens/Settings/AppearanceSettings.tsx b/src/screens/Settings/AppearanceSettings.tsx index 017e7571f..60aba107c 100644 --- a/src/screens/Settings/AppearanceSettings.tsx +++ b/src/screens/Settings/AppearanceSettings.tsx @@ -17,11 +17,14 @@ import { useEnableSquareAvatars, useSetEnableSquareAvatars, } from '#/state/preferences/enable-square-avatars' -import {useCompactPosts, useSetCompactPosts} from '#/state/preferences' import { useEnableSquareButtons, useSetEnableSquareButtons, } from '#/state/preferences/enable-square-buttons' +import { + useRepostCarouselEnabled, + useSetRepostCarouselEnabled, +} from '#/state/preferences/repost-carousel-enabled' import {useKawaiiMode, useSetKawaiiMode} from '#/state/preferences/kawaii' import {useSetThemePrefs, useThemePrefs} from '#/state/shell' import {SettingsListItem as AppIconSettingsListItem} from '#/screens/Settings/AppIconSettings/SettingsListItem' @@ -34,9 +37,9 @@ import {type Props as SVGIconProps} from '#/components/icons/common' import {Moon_Stroke2_Corner0_Rounded as MoonIcon} from '#/components/icons/Moon' import {Person_Stroke2_Corner0_Rounded as PersonIcon} from '#/components/icons/Person' import {Phone_Stroke2_Corner0_Rounded as PhoneIcon} from '#/components/icons/Phone' +import {Repost_Stroke2_Corner3_Rounded as RepostIcon} from '#/components/icons/Repost' import {Sparkle_Stroke2_Corner0_Rounded as SparkleIcon} from '#/components/icons/Sparkle' import {TextSize_Stroke2_Corner0_Rounded as TextSize} from '#/components/icons/TextSize' -import {Tree_Stroke2_Corner0_Rounded as TreeIcon} from '#/components/icons/Tree' import {TitleCase_Stroke2_Corner0_Rounded as Aa} from '#/components/icons/TitleCase' import {Window_Stroke2_Corner2_Rounded as SquareIcon} from '#/components/icons/Window' import * as Layout from '#/components/Layout' @@ -59,8 +62,9 @@ export function AppearanceSettingsScreen({}: Props) { const enableSquareAvatars = useEnableSquareAvatars() const setEnableSquareAvatars = useSetEnableSquareAvatars() - const compactPosts = useCompactPosts() - const setCompactPosts = useSetCompactPosts() + + const repostCarouselEnabled = useRepostCarouselEnabled() + const setRepostCarouselEnabled = useSetRepostCarouselEnabled() const enableSquareButtons = useEnableSquareButtons() const setEnableSquareButtons = useSetEnableSquareButtons() @@ -216,14 +220,14 @@ export function AppearanceSettingsScreen({}: Props) { onChange={onChangeFontScale} /> setCompactPosts(value)}> + name="repost_carousel" + label={_(msg`Combine reposts into a horizontal carousel`)} + value={repostCarouselEnabled} + onChange={value => setRepostCarouselEnabled(value)}> - + - Use compact view for posts + Combine reposts into a horizontal carousel diff --git a/src/screens/Settings/RunesSettings/DensitySettings.tsx b/src/screens/Settings/RunesSettings/DensitySettings.tsx index 21d011bab..08bfec785 100644 --- a/src/screens/Settings/RunesSettings/DensitySettings.tsx +++ b/src/screens/Settings/RunesSettings/DensitySettings.tsx @@ -1,5 +1,6 @@ import {Trans, useLingui} from '@lingui/react/macro' +import {useCompactPosts, useSetCompactPosts} from '#/state/preferences' import { useAutoCompactAccountSwitcher, useSetAutoCompactAccountSwitcher, @@ -12,11 +13,15 @@ import * as SettingsList from '#/screens/Settings/components/SettingsList' import {atoms as a} from '#/alf' import * as Toggle from '#/components/forms/Toggle' import {PersonGroup_Stroke2_Corner2_Rounded as PersonGroupIcon} from '#/components/icons/Person' +import {UFO_Stroke2_Corner0_Rounded as UfoIcon} from '#/components/icons/UFO' import {RunesScreenLayout} from './components/RunesScreenLayout' export function RunesDisplayDensitySettingsScreen() { const {t: l} = useLingui() + const compactPosts = useCompactPosts() + const setCompactPosts = useSetCompactPosts() + const compactAccountSwitcher = useCompactAccountSwitcher() const setCompactAccountSwitcher = useSetCompactAccountSwitcher() @@ -43,19 +48,35 @@ export function RunesDisplayDensitySettingsScreen() { setAutoCompactAccountSwitcher(value)} style={[a.w_full]}> - Automatically use compact account switcher with more than 6 - accounts + Automatically use compact switcher with more than 6 accounts + + + + Anything else + + setCompactPosts(value)} + style={[a.w_full]}> + + Compact posts + + + + ) } diff --git a/src/screens/Settings/RunesSettings/DisplaySettings.tsx b/src/screens/Settings/RunesSettings/DisplaySettings.tsx index a77b88cd2..e90244aa2 100644 --- a/src/screens/Settings/RunesSettings/DisplaySettings.tsx +++ b/src/screens/Settings/RunesSettings/DisplaySettings.tsx @@ -9,6 +9,7 @@ import {type AppLanguage} from '#/locale/languages' import { useAlsoLikedCollapseByDefault, useAlsoLikedFeedEnabled, + useCompactPosts, } from '#/state/preferences' import {useAutoCompactAccountSwitcher} from '#/state/preferences/auto-compact-account-switcher' import {useCompactAccountSwitcher} from '#/state/preferences/compact-account-switcher' @@ -20,10 +21,6 @@ import { usePostReplacement, useSetPostReplacement, } from '#/state/preferences/post-name-replacement' -import { - useRepostCarouselEnabled, - useSetRepostCarouselEnabled, -} from '#/state/preferences/repost-carousel-enabled' import { useSetShowViaClient, useShowViaClient, @@ -38,7 +35,6 @@ import {Heart2_Stroke2_Corner0_Rounded as HeartIcon} from '#/components/icons/He import {Image_Stroke2_Corner0_Rounded as ImageIcon} from '#/components/icons/Image' import {Pencil_Stroke2_Corner0_Rounded as PencilIcon} from '#/components/icons/Pencil' import {PersonGroup_Stroke2_Corner2_Rounded as PersonGroupIcon} from '#/components/icons/Person' -import {Repost_Stroke2_Corner3_Rounded as RepostIcon} from '#/components/icons/Repost' import {Window_Stroke2_Corner2_Rounded as WindowIcon} from '#/components/icons/Window' import {Text} from '#/components/Typography' import {IS_WEB} from '#/env' @@ -48,9 +44,6 @@ import {RunesScreenLayout} from './components/RunesScreenLayout' export function RunesDisplaySettingsScreen() { const {t: l} = useLingui() - const repostCarouselEnabled = useRepostCarouselEnabled() - const setRepostCarouselEnabled = useSetRepostCarouselEnabled() - const alsoLikedFeedEnabled = useAlsoLikedFeedEnabled() const alsoLikedCollapseByDefault = useAlsoLikedCollapseByDefault() @@ -86,22 +79,9 @@ export function RunesDisplaySettingsScreen() { Density} - subtitleText={} + subtitleText={} /> - setRepostCarouselEnabled(value)}> - - - - Combine reposts into a horizontal carousel - - - - Shown in thread views, expanded by default } -function AccountSwitcherDeclaration() { +function DensityDeclaration() { + const compactPosts = useCompactPosts() const compactAccountSwitcher = useCompactAccountSwitcher() const autoCompactAccountSwitcher = useAutoCompactAccountSwitcher() + if (compactAccountSwitcher && compactPosts) { + return Always on compact switcher, compact posts + } + + if (autoCompactAccountSwitcher && compactPosts) { + return Auto-compact switcher, compact posts + } + + if (compactPosts) { + return Compact posts on + } + if (compactAccountSwitcher) { return Compact always on } if (autoCompactAccountSwitcher) { - return Auto-compact with 7+ accounts + return Auto-compact switcher with 7+ accounts } return Default layout only diff --git a/src/view/com/notifications/NotificationFeedItem.tsx b/src/view/com/notifications/NotificationFeedItem.tsx index 6445e5905..9d7f078cb 100644 --- a/src/view/com/notifications/NotificationFeedItem.tsx +++ b/src/view/com/notifications/NotificationFeedItem.tsx @@ -649,13 +649,7 @@ let NotificationFeedItem = ({ authors={authors} />