Fix types
This commit is contained in:
@@ -389,6 +389,7 @@ let Card = ({
|
|||||||
{data && moderationOpts ? (
|
{data && moderationOpts ? (
|
||||||
status.isActive ? (
|
status.isActive ? (
|
||||||
<LiveStatus
|
<LiveStatus
|
||||||
|
status={status}
|
||||||
profile={data}
|
profile={data}
|
||||||
embed={status.embed}
|
embed={status.embed}
|
||||||
padding="lg"
|
padding="lg"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export function LiveStatusDialog({
|
|||||||
control,
|
control,
|
||||||
profile,
|
profile,
|
||||||
embed,
|
embed,
|
||||||
|
status,
|
||||||
}: {
|
}: {
|
||||||
control: Dialog.DialogControlProps
|
control: Dialog.DialogControlProps
|
||||||
profile: bsky.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
@@ -41,7 +42,12 @@ export function LiveStatusDialog({
|
|||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control} nativeOptions={{preventExpansion: true}}>
|
<Dialog.Outer control={control} nativeOptions={{preventExpansion: true}}>
|
||||||
<Dialog.Handle difference={!!embed.external.thumb} />
|
<Dialog.Handle difference={!!embed.external.thumb} />
|
||||||
<DialogInner profile={profile} embed={embed} navigation={navigation} />
|
<DialogInner
|
||||||
|
status={status}
|
||||||
|
profile={profile}
|
||||||
|
embed={embed}
|
||||||
|
navigation={navigation}
|
||||||
|
/>
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -50,10 +56,12 @@ function DialogInner({
|
|||||||
profile,
|
profile,
|
||||||
embed,
|
embed,
|
||||||
navigation,
|
navigation,
|
||||||
|
status,
|
||||||
}: {
|
}: {
|
||||||
profile: bsky.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
embed: AppBskyEmbedExternal.View
|
embed: AppBskyEmbedExternal.View
|
||||||
navigation: NavigationProp
|
navigation: NavigationProp
|
||||||
|
status: AppBskyActorDefs.StatusView
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const control = Dialog.useDialogContext()
|
const control = Dialog.useDialogContext()
|
||||||
@@ -72,6 +80,7 @@ function DialogInner({
|
|||||||
contentContainerStyle={[a.pt_0, a.px_0]}
|
contentContainerStyle={[a.pt_0, a.px_0]}
|
||||||
style={[web({maxWidth: 420}), a.overflow_hidden]}>
|
style={[web({maxWidth: 420}), a.overflow_hidden]}>
|
||||||
<LiveStatus
|
<LiveStatus
|
||||||
|
status={status}
|
||||||
profile={profile}
|
profile={profile}
|
||||||
embed={embed}
|
embed={embed}
|
||||||
onPressOpenProfile={onPressOpenProfile}
|
onPressOpenProfile={onPressOpenProfile}
|
||||||
@@ -82,11 +91,13 @@ function DialogInner({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function LiveStatus({
|
export function LiveStatus({
|
||||||
|
status,
|
||||||
profile,
|
profile,
|
||||||
embed,
|
embed,
|
||||||
padding = 'xl',
|
padding = 'xl',
|
||||||
onPressOpenProfile,
|
onPressOpenProfile,
|
||||||
}: {
|
}: {
|
||||||
|
status: AppBskyActorDefs.StatusView
|
||||||
profile: bsky.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
embed: AppBskyEmbedExternal.View
|
embed: AppBskyEmbedExternal.View
|
||||||
padding?: 'lg' | 'xl'
|
padding?: 'lg' | 'xl'
|
||||||
@@ -99,7 +110,6 @@ export function LiveStatus({
|
|||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
const reportDialogControl = useGlobalReportDialogControl()
|
const reportDialogControl = useGlobalReportDialogControl()
|
||||||
const dialogContext = Dialog.useDialogContext()
|
const dialogContext = Dialog.useDialogContext()
|
||||||
const hasLiveStatus = 'status' in profile
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -225,15 +235,14 @@ export function LiveStatus({
|
|||||||
<Trans>Live feature is in beta</Trans>
|
<Trans>Live feature is in beta</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
{hasLiveStatus && (
|
{status && (
|
||||||
<SimpleInlineLinkText
|
<SimpleInlineLinkText
|
||||||
label={_(msg`Report this livestream`)}
|
label={_(msg`Report this livestream`)}
|
||||||
{...createStaticClick(() => {
|
{...createStaticClick(() => {
|
||||||
function open() {
|
function open() {
|
||||||
if (!hasLiveStatus) return // already checked above
|
|
||||||
reportDialogControl.open({
|
reportDialogControl.open({
|
||||||
subject: {
|
subject: {
|
||||||
...profile.status,
|
...status,
|
||||||
$type: 'app.bsky.actor.defs#statusView',
|
$type: 'app.bsky.actor.defs#statusView',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user