feat: remove pictureViewFilterNoImage
This commit is contained in:
@@ -17,10 +17,6 @@ export const createDefaultSettings = (): UISettings => ({
|
||||
guessCodeLanguage: true,
|
||||
hideRecentReader: false,
|
||||
customCSS: "",
|
||||
|
||||
// View
|
||||
|
||||
pictureViewFilterNoImage: false,
|
||||
})
|
||||
|
||||
export const {
|
||||
|
||||
@@ -10,8 +10,4 @@ export interface UISettings {
|
||||
guessCodeLanguage: boolean
|
||||
hideRecentReader: boolean
|
||||
customCSS: string
|
||||
|
||||
// view
|
||||
|
||||
pictureViewFilterNoImage: boolean
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { ScrollView, Text, View } from "react-native"
|
||||
import Animated, { useSharedValue, withTiming } from "react-native-reanimated"
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context"
|
||||
|
||||
import { useUISettingKey } from "@/src/atoms/settings/ui"
|
||||
import { EntryContentWebView } from "@/src/components/native/webview/EntryContentWebView"
|
||||
import { MediaCarousel } from "@/src/components/ui/carousel/MediaCarousel"
|
||||
import { RelativeDateTime } from "@/src/components/ui/datetime/RelativeDateTime"
|
||||
@@ -27,16 +26,12 @@ export function EntryGridItem({ id }: { id: string }) {
|
||||
const item = useEntry(id)
|
||||
const view = useEntryListContextView()
|
||||
|
||||
const pictureViewFilterNoImage = useUISettingKey("pictureViewFilterNoImage")
|
||||
if (!item || !item.media) {
|
||||
return null
|
||||
}
|
||||
|
||||
const hasMedia = item.media.length > 0
|
||||
|
||||
if (pictureViewFilterNoImage && !hasMedia && view === FeedViewType.Pictures) {
|
||||
return null
|
||||
}
|
||||
if (!hasMedia) {
|
||||
return (
|
||||
<View className="aspect-video w-full items-center justify-center">
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { FeedViewType } from "@follow/constants"
|
||||
import { useLocalSearchParams } from "expo-router"
|
||||
import { useMemo } from "react"
|
||||
import { Share, useAnimatedValue, View } from "react-native"
|
||||
@@ -12,7 +11,6 @@ import { UIBarButton } from "@/src/components/ui/button/UIBarButton"
|
||||
import { Share3CuteReIcon } from "@/src/icons/share_3_cute_re"
|
||||
import { getWebUrl } from "@/src/lib/env"
|
||||
import {
|
||||
HideNoMediaActionButton,
|
||||
HomeLeftAction,
|
||||
HomeSharedRightAction,
|
||||
UnreadOnlyActionButton,
|
||||
@@ -20,13 +18,12 @@ import {
|
||||
import { TimelineViewSelector } from "@/src/modules/screen/TimelineViewSelector"
|
||||
import { getFeed } from "@/src/store/feed/getter"
|
||||
|
||||
import { useEntryListContext, useSelectedFeedTitle, useSelectedView } from "./atoms"
|
||||
import { useEntryListContext, useSelectedFeedTitle } from "./atoms"
|
||||
|
||||
export function TimelineSelectorProvider({ children }: { children: React.ReactNode }) {
|
||||
const scrollY = useAnimatedValue(0)
|
||||
const viewTitle = useSelectedFeedTitle()
|
||||
const screenType = useEntryListContext().type
|
||||
const view = useSelectedView()
|
||||
const params = useLocalSearchParams()
|
||||
const isFeed = screenType === "feed"
|
||||
const isTimeline = screenType === "timeline"
|
||||
@@ -42,32 +39,22 @@ export function TimelineSelectorProvider({ children }: { children: React.ReactNo
|
||||
)}
|
||||
headerRight={useMemo(() => {
|
||||
const buttonVariant = isFeed ? "secondary" : "primary"
|
||||
const extraActions = (
|
||||
<>
|
||||
{view === FeedViewType.Pictures && (
|
||||
<HideNoMediaActionButton variant={buttonVariant} />
|
||||
)}
|
||||
</>
|
||||
)
|
||||
if (isTimeline)
|
||||
return () => (
|
||||
<HomeSharedRightAction>
|
||||
<UnreadOnlyActionButton variant={buttonVariant} />
|
||||
{extraActions}
|
||||
</HomeSharedRightAction>
|
||||
)
|
||||
if (isSubscriptions)
|
||||
return () => <HomeSharedRightAction>{extraActions}</HomeSharedRightAction>
|
||||
if (isSubscriptions) return () => <HomeSharedRightAction />
|
||||
if (isFeed)
|
||||
return () => (
|
||||
<View className="-mr-2 flex-row gap-2">
|
||||
{extraActions}
|
||||
<UnreadOnlyActionButton variant={buttonVariant} />
|
||||
<FeedShareAction params={params} />
|
||||
</View>
|
||||
)
|
||||
return
|
||||
}, [isFeed, view, isTimeline, isSubscriptions, params])}
|
||||
}, [isFeed, isTimeline, isSubscriptions, params])}
|
||||
headerHideableBottom={isTimeline || isSubscriptions ? TimelineViewSelector : undefined}
|
||||
/>
|
||||
{children}
|
||||
|
||||
@@ -4,13 +4,10 @@ import type { PropsWithChildren } from "react"
|
||||
import { TouchableOpacity, View } from "react-native"
|
||||
|
||||
import { setGeneralSetting, useGeneralSettingKey } from "@/src/atoms/settings/general"
|
||||
import { setUISetting, useUISettingKey } from "@/src/atoms/settings/ui"
|
||||
import { UserAvatar } from "@/src/components/ui/avatar/UserAvatar"
|
||||
import { UIBarButton } from "@/src/components/ui/button/UIBarButton"
|
||||
import { AddCuteReIcon } from "@/src/icons/add_cute_re"
|
||||
import { CheckCircleCuteReIcon } from "@/src/icons/check_circle_cute_re"
|
||||
import { PhotoAlbumCuteFiIcon } from "@/src/icons/photo_album_cute_fi"
|
||||
import { PhotoAlbumCuteReIcon } from "@/src/icons/photo_album_cute_re"
|
||||
import { RoundCuteFiIcon } from "@/src/icons/round_cute_fi"
|
||||
import { RoundCuteReIcon } from "@/src/icons/round_cute_re"
|
||||
import { Dialog } from "@/src/lib/dialog"
|
||||
@@ -80,26 +77,7 @@ export const UnreadOnlyActionButton = ({ variant = "primary" }: HeaderActionButt
|
||||
/>
|
||||
)
|
||||
}
|
||||
export function HideNoMediaActionButton({
|
||||
variant = "primary",
|
||||
}: {
|
||||
variant?: "primary" | "secondary"
|
||||
}) {
|
||||
const pictureViewFilterNoImage = useUISettingKey("pictureViewFilterNoImage")
|
||||
const { size, color } = useButtonVariant({ variant })
|
||||
|
||||
return (
|
||||
<UIBarButton
|
||||
label="Hide No Media Item"
|
||||
normalIcon={<PhotoAlbumCuteReIcon height={size} width={size} color={color} />}
|
||||
selectedIcon={<PhotoAlbumCuteFiIcon height={size} width={size} color={color} />}
|
||||
onPress={() => {
|
||||
setUISetting("pictureViewFilterNoImage", !pictureViewFilterNoImage)
|
||||
}}
|
||||
selected={pictureViewFilterNoImage}
|
||||
/>
|
||||
)
|
||||
}
|
||||
export const AddFeedButton = () => {
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user