Skip to content

Commit

Permalink
Merge branch 'RSSNext:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cuikaipeng authored Sep 25, 2024
2 parents 6700dbf + 192d5bc commit bf2242f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 13 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
Next generation information browser.
<br />
<br />
<a href="https://discord.gg/xHCVQZ6wmZ">Discord</a>
<a href="https://discord.gg/followapp">Discord</a>
·
<a href="https://x.com/intent/follow?screen_name=follow_app_">Twitter</a>
·
<a href="https://github.com/RSSNext/Follow/releases">Releases</a>
<br />
<br />
<a href="https://trendshift.io/repositories/9938" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9938" alt="RSSNext%2Ffollow | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://trendshift.io/repositories/9938" target="_blank"><img src="https://github.com/user-attachments/assets/7d394847-f019-46e5-94ec-5bf4ccda6146" alt="RSSNext%2Ffollow | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://trendshift.io/repositories/9938" target="_blank"><img src="https://github.com/user-attachments/assets/0696530c-cfe3-4f2e-975f-07ef31521092" alt="RSSNext%2Ffollow | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://trendshift.io/repositories/9938" target="_blank"><img src="https://github.com/user-attachments/assets/c3c6ee92-f81a-4f0a-b9d7-c03832c8a3ee" alt="RSSNext%2Ffollow | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
</p>
</div>

Expand Down Expand Up @@ -73,7 +75,7 @@ The project is currently under active development. The following screenshots are

## Releases

[![Discord](https://img.shields.io/discord/1243823539426033696?logo=discord&label=Discord&style=flat-square&color=5865F2)](https://discord.gg/xHCVQZ6wmZ) [![](https://img.shields.io/badge/any_text-Follow-blue?color=2CA5E0&label=_&logo=x&cacheSeconds=3600&style=flat-square)](https://x.com/intent/follow?screen_name=follow_app_)
[![Discord](https://img.shields.io/discord/1243823539426033696?logo=discord&label=Discord&style=flat-square&color=5865F2)](https://discord.gg/followapp) [![](https://img.shields.io/badge/any_text-Follow-blue?color=2CA5E0&label=_&logo=x&cacheSeconds=3600&style=flat-square)](https://x.com/intent/follow?screen_name=follow_app_)

Currently, Follow is still in the early developer preview stage (alpha) and is only available to a limited number of users through an invitation system.

Expand Down
2 changes: 1 addition & 1 deletion apps/renderer/src/constants/social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const SocialMediaLinks = [
{
icon: "i-mgc-discord-cute-fi",
label: "Discord",
url: "https://discord.gg/xHCVQZ6wmZ",
url: "https://discord.gg/followapp",
},
{
icon: "i-mgc-social-x-cute-re",
Expand Down
7 changes: 7 additions & 0 deletions apps/renderer/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { memoize } from "lodash-es"
import { twMerge } from "tailwind-merge"
import { parse } from "tldts"

import type { MediaModel } from "~/models"
import type { RSSHubRoute } from "~/modules/discover/types"

import { FEED_COLLECTION_LIST, ROUTE_FEED_PENDING } from "../constants/app"
Expand Down Expand Up @@ -260,3 +261,9 @@ export const getUrlIcon = (url: string, fallback?: boolean | undefined) => {
}

export const isEmptyObject = (obj: Record<string, any>) => Object.keys(obj).length === 0

export const filterSmallMedia = (media: MediaModel) => {
return media?.filter(
(m) => !(m.type === "photo" && m.width && m.width < 65 && m.height && m.height < 65),
)
}
5 changes: 5 additions & 0 deletions apps/renderer/src/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,8 @@ export type RecommendationItem = ExtractBizResponse<
export type ActionOperation = "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"
export type ActionEntryField = "all" | "title" | "content" | "author" | "url" | "order"
export type ActionFeedField = "view" | "title" | "site_url" | "feed_url" | "category"

export type MediaModel = Exclude<
ExtractBizResponse<typeof apiClient.entries.$get>["data"],
undefined
>["entries"]["media"]
12 changes: 7 additions & 5 deletions apps/renderer/src/modules/entry-column/Items/picture-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ReactVirtuosoItemPlaceholder } from "~/components/ui/placeholder"
import { Skeleton } from "~/components/ui/skeleton"
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
import { FeedViewType } from "~/lib/enum"
import { cn } from "~/lib/utils"
import { cn, filterSmallMedia } from "~/lib/utils"
import { useEntry } from "~/store/entry/hooks"
import { useImageDimensions } from "~/store/image"

Expand Down Expand Up @@ -80,7 +80,7 @@ export const PictureWaterFallItem = memo(function PictureWaterFallItem({
const intersectionObserver = useContext(MasonryIntersectionContext)

useEffect(() => {
if (!ref) return
if (!ref || !intersectionObserver) return

intersectionObserver.observe(ref)

Expand All @@ -92,6 +92,8 @@ export const PictureWaterFallItem = memo(function PictureWaterFallItem({
const [isMouseEnter, setIsMouseEnter] = useState(false)
if (!entry) return null

const media = filterSmallMedia(entry.entries.media)

return (
<div
ref={setRef}
Expand All @@ -108,10 +110,10 @@ export const PictureWaterFallItem = memo(function PictureWaterFallItem({
width: itemWidth,
}}
>
{entry.entries.media && entry.entries.media.length > 0 ? (
<MasonryItemFixedDimensionWrapper url={entry.entries.media[0].url}>
{media && media.length > 0 ? (
<MasonryItemFixedDimensionWrapper url={media[0].url}>
<SwipeMedia
media={entry.entries.media}
media={media}
className={cn("w-full shrink-0 grow rounded-md", isActive && "rounded-b-none")}
proxySize={proxySize}
imgClassName="object-cover"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
import { getImageProxyUrl } from "~/lib/img-proxy"
import { jotaiStore } from "~/lib/jotai"
import { parseSocialMedia } from "~/lib/parsers"
import { cn } from "~/lib/utils"
import { cn, filterSmallMedia } from "~/lib/utils"
import { useEntry } from "~/store/entry/hooks"
import { useFeedById } from "~/store/feed"

Expand Down Expand Up @@ -45,6 +45,8 @@ export const SocialMediaItem: EntryListItemFC = ({ entryId, entryPreview, transl

const parsed = parseSocialMedia(entry.entries)

const media = filterSmallMedia(entry.entries.media)

return (
<div
className={cn(
Expand Down Expand Up @@ -94,9 +96,9 @@ export const SocialMediaItem: EntryListItemFC = ({ entryId, entryPreview, transl
{!!entry.collections && <StarIcon />}
</div>
</div>
{!!entry.entries.media?.length && (
{!!media?.length && (
<div className="mt-4 flex gap-[8px] overflow-x-auto pb-2">
{entry.entries.media.map((media, i, mediaList) => {
{media.map((media, i, mediaList) => {
const style: Partial<{
width: string
height: string
Expand Down
2 changes: 1 addition & 1 deletion locales/app/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"achievement.all_done": "大功告成!",
"achievement.first_claim_feed": "订阅源所有者",
"achievement.first_claim_feed_description": "在 Follow 上认证订阅源",
"achievement.mint_more_power": "成为核心玩家,赚取更多 <power />",
"achievement.mint_more_power": "成为硬核玩家,赚取更多 <power />",
"ai_daily.title": "热点 - {{title}}",
"ai_daily.tooltip.content": "AI 根据时间线(<From /> - <To />)提取的重点信息",
"ai_daily.tooltip.update_schedule": "每天 8:00 和 20:00 定时更新",
Expand Down

0 comments on commit bf2242f

Please sign in to comment.