fix: show episode cover for podcast (#315)

* fix: show episode cover for podcast

* chore: make typecheck pass

* chore: update
This commit is contained in:
Stephen Zhou 2024-09-10 14:21:21 +08:00 committed by GitHub
parent 7d4260a614
commit 4ef7f8cbd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 31 additions and 27 deletions

View File

@ -104,7 +104,7 @@
"msedge-tts": "1.3.4",
"nanoid": "5.0.7",
"ofetch": "1.3.4",
"path-to-regexp": "7.1.0",
"path-to-regexp": "7.2.0",
"posthog-js": "1.161.0",
"posthog-node": "4.2.0",
"re-resizable": "6.9.17",

View File

@ -193,7 +193,7 @@ importers:
version: 0.2.38(react@18.3.1)
framer-motion:
specifier: 11.0.10
version: 11.5.4(@emotion/is-prop-valid@1.3.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
version: 11.0.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
franc-min:
specifier: 6.2.0
version: 6.2.0
@ -237,8 +237,8 @@ importers:
specifier: 1.3.4
version: 1.3.4
path-to-regexp:
specifier: 7.1.0
version: 8.0.0
specifier: 7.2.0
version: 7.2.0
posthog-js:
specifier: 1.161.0
version: 1.161.0
@ -1344,11 +1344,11 @@ packages:
engines: {node: '>=14.14'}
hasBin: true
'@emotion/is-prop-valid@1.3.0':
resolution: {integrity: sha512-SHetuSLvJDzuNbOdtPVbq6yMMMlLoW5Q94uDqJZqy50gcmAjxFkVqmzqSGEFq9gT2iMuIeKV1PXVWmvUhuZLlQ==}
'@emotion/is-prop-valid@0.8.8':
resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==}
'@emotion/memoize@0.9.0':
resolution: {integrity: sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==}
'@emotion/memoize@0.7.4':
resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==}
'@es-joy/jsdoccomment@0.48.0':
resolution: {integrity: sha512-G6QUWIcC+KvSwXNsJyDTHvqUdNoAVJPPgkc3+Uk4WBKqZvoXhlvazOgm9aL0HwihJLQf0l+tOE2UFzXBqCqgDw==}
@ -4948,15 +4948,12 @@ packages:
react:
optional: true
framer-motion@11.5.4:
resolution: {integrity: sha512-E+tb3/G6SO69POkdJT+3EpdMuhmtCh9EWuK4I1DnIC23L7tFPrl8vxP+LSovwaw6uUr73rUbpb4FgK011wbRJQ==}
framer-motion@11.0.10:
resolution: {integrity: sha512-aaImib9FQlfno2yiZAdkvN6zLXLr8a9uGsGFlQO64hSm8NoCeiUng2//5ok7RHCW2ufzT74uuPsmWzUsrHPYDQ==}
peerDependencies:
'@emotion/is-prop-valid': '*'
react: ^18.0.0
react-dom: ^18.0.0
peerDependenciesMeta:
'@emotion/is-prop-valid':
optional: true
react:
optional: true
react-dom:
@ -6474,8 +6471,8 @@ packages:
resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==}
engines: {node: 20 || >=22}
path-to-regexp@8.0.0:
resolution: {integrity: sha512-GAWaqWlTjYK/7SVpIUA6CTxmcg65SP30sbjdCvyYReosRkk7Z/LyHWwkK3Vu0FcIi0FNTADUs4eh1AsU5s10cg==}
path-to-regexp@7.2.0:
resolution: {integrity: sha512-0W4AcUxPpFlcS8ql8ZEmFwaI0X5WshUVAFdXe3PBurrt18DK8bvSS+UKHvJUAfGILco/nTtc/E4LcPNfVysfwQ==}
engines: {node: '>=16'}
path-type@2.0.0:
@ -9513,12 +9510,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@emotion/is-prop-valid@1.3.0':
'@emotion/is-prop-valid@0.8.8':
dependencies:
'@emotion/memoize': 0.9.0
'@emotion/memoize': 0.7.4
optional: true
'@emotion/memoize@0.9.0':
'@emotion/memoize@0.7.4':
optional: true
'@es-joy/jsdoccomment@0.48.0':
@ -13790,11 +13787,11 @@ snapshots:
optionalDependencies:
react: 18.3.1
framer-motion@11.5.4(@emotion/is-prop-valid@1.3.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
framer-motion@11.0.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
tslib: 2.6.3
tslib: 2.7.0
optionalDependencies:
'@emotion/is-prop-valid': 1.3.0
'@emotion/is-prop-valid': 0.8.8
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
@ -15736,7 +15733,7 @@ snapshots:
lru-cache: 11.0.0
minipass: 7.1.2
path-to-regexp@8.0.0: {}
path-to-regexp@7.2.0: {}
path-type@2.0.0:
dependencies:
@ -16189,7 +16186,7 @@ snapshots:
dependencies:
react: 18.3.1
react-style-singleton: 2.2.1(@types/react@18.3.5)(react@18.3.1)
tslib: 2.6.3
tslib: 2.7.0
optionalDependencies:
'@types/react': 18.3.5
@ -16244,7 +16241,7 @@ snapshots:
get-nonce: 1.0.1
invariant: 2.2.4
react: 18.3.1
tslib: 2.6.3
tslib: 2.7.0
optionalDependencies:
'@types/react': 18.3.5
@ -17220,7 +17217,7 @@ snapshots:
use-callback-ref@1.3.2(@types/react@18.3.5)(react@18.3.1):
dependencies:
react: 18.3.1
tslib: 2.6.3
tslib: 2.7.0
optionalDependencies:
'@types/react': 18.3.5
@ -17239,7 +17236,7 @@ snapshots:
dependencies:
detect-node-es: 1.1.0
react: 18.3.1
tslib: 2.6.3
tslib: 2.7.0
optionalDependencies:
'@types/react': 18.3.5

View File

@ -72,6 +72,7 @@ export function FeedIcon({
size = 20,
fallback = true,
siteUrl,
useMedia,
}: {
feed?: FeedModel
entry?: CombinedEntryModel["entries"]
@ -83,8 +84,13 @@ export function FeedIcon({
* Image loading error fallback to site icon
*/
fallback?: boolean
useMedia?: boolean
}) {
const image = entry?.authorAvatar || feed?.image
const image =
(useMedia
? entry?.media?.find((i) => i.type === "photo")?.url || entry?.authorAvatar
: entry?.authorAvatar) || feed?.image
if (!feed && !siteUrl) {
throw new Error("You must provide either a feed or a siteUrl")

View File

@ -137,6 +137,7 @@ export function ListItem({
entry={entry.entries}
size={80}
className="m-0 rounded"
useMedia
/>
}
/>