mirror of
https://github.com/tooot-app/app
synced 2024-12-21 23:24:29 +01:00
Fix #741
This commit is contained in:
parent
33709f8fa6
commit
4b2b701cea
@ -1,2 +1 @@
|
|||||||
Enjoy toooting! This version includes following improvements and fixes:
|
Enjoy toooting! This version includes following improvements and fixes:
|
||||||
- Fixed functionality version check (e.g. cannot edit own toots)
|
|
@ -1,2 +1,2 @@
|
|||||||
tooot-ing愉快!此版本包括以下改进和修复:
|
tooot-ing愉快!此版本包括以下改进和修复:
|
||||||
- 修复版本功能检查(如无法编辑嘟文)
|
- 新增neodb.social演出卡片
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tooot",
|
"name": "tooot",
|
||||||
"version": "4.9.6",
|
"version": "4.9.7",
|
||||||
"description": "tooot for Mastodon",
|
"description": "tooot for Mastodon",
|
||||||
"author": "xmflsct <me@xmflsct.com>",
|
"author": "xmflsct <me@xmflsct.com>",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
|
@ -16,18 +16,19 @@ export type Props = {
|
|||||||
export const CardNeodb: React.FC<Props> = ({ card }) => {
|
export const CardNeodb: React.FC<Props> = ({ card }) => {
|
||||||
const { colors } = useTheme()
|
const { colors } = useTheme()
|
||||||
|
|
||||||
const segments = Linking.parse(card.url).path?.split('/')
|
const path = Linking.parse(card.url).path
|
||||||
if (!segments || !['movie', 'book', 'tv', 'game', 'album', 'podcast'].includes(segments[0]))
|
if (!path) return null
|
||||||
|
|
||||||
|
const segments = path?.split('/')
|
||||||
|
if (
|
||||||
|
!segments ||
|
||||||
|
!['movie', 'book', 'tv', 'game', 'album', 'podcast', 'performance'].includes(segments[0])
|
||||||
|
)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
const [headingLines, setHeadingLines] = useState(3)
|
const [headingLines, setHeadingLines] = useState(3)
|
||||||
|
|
||||||
const { data } = useNeodbQuery({
|
const { data } = useNeodbQuery({ path })
|
||||||
path:
|
|
||||||
segments[0] === 'tv' && segments[1] === 'season'
|
|
||||||
? `${segments[0]}${segments[1]}/${segments[2]}`
|
|
||||||
: `${segments[0]}/${segments[1]}`
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!data) return null
|
if (!data) return null
|
||||||
|
|
||||||
@ -44,7 +45,13 @@ export const CardNeodb: React.FC<Props> = ({ card }) => {
|
|||||||
>
|
>
|
||||||
{data.cover_image_url ? (
|
{data.cover_image_url ? (
|
||||||
<GracefullyImage
|
<GracefullyImage
|
||||||
sources={{ default: { uri: data.cover_image_url } }}
|
sources={{
|
||||||
|
default: {
|
||||||
|
uri: data.cover_image_url.startsWith('/')
|
||||||
|
? `https://neodb.social${data.cover_image_url}`
|
||||||
|
: data.cover_image_url
|
||||||
|
}
|
||||||
|
}}
|
||||||
dimension={{
|
dimension={{
|
||||||
width: StyleConstants.Font.LineHeight.M * 4,
|
width: StyleConstants.Font.LineHeight.M * 4,
|
||||||
height: StyleConstants.Font.LineHeight.M * 5
|
height: StyleConstants.Font.LineHeight.M * 5
|
||||||
@ -162,6 +169,27 @@ export const CardNeodb: React.FC<Props> = ({ card }) => {
|
|||||||
return (
|
return (
|
||||||
<Content heading={[data.title]} details={[data.hosts.join(' '), data.genre.join(' ')]} />
|
<Content heading={[data.title]} details={[data.hosts.join(' '), data.genre.join(' ')]} />
|
||||||
)
|
)
|
||||||
|
case 'performance':
|
||||||
|
if (segments[1] === 'production') {
|
||||||
|
return (
|
||||||
|
<Content
|
||||||
|
heading={[data.display_title]}
|
||||||
|
details={[
|
||||||
|
data.opening_date,
|
||||||
|
data.director.join(' '),
|
||||||
|
data.playwright.join(' '),
|
||||||
|
data.composer.join(' ')
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<Content
|
||||||
|
heading={[data.title, data.orig_title]}
|
||||||
|
details={[data.genre.join(' '), data.playwright.join(' '), data.director.join(' ')]}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user