1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Fixes after upgrades

This commit is contained in:
Zhiyuan Zheng
2022-05-08 23:40:42 +02:00
parent 1d6790c76e
commit d9e1530b8b
23 changed files with 67 additions and 63 deletions

View File

@ -1,6 +1,6 @@
import Button from '@components/Button'
import { StyleConstants } from '@utils/styles/constants'
import { Video } from 'expo-av'
import { ResizeMode, Video, VideoFullscreenUpdate } from 'expo-av'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import {
AppState,
@ -110,15 +110,14 @@ const AttachmentVideo: React.FC<Props> = ({
source: { uri: video.url }
}
: {
resizeMode: 'cover',
resizeMode: ResizeMode.COVER,
posterSource: { uri: video.preview_url },
posterStyle: { resizeMode: 'cover' }
posterStyle: { resizeMode: ResizeMode.COVER }
})}
useNativeControls={false}
onFullscreenUpdate={async event => {
if (
event.fullscreenUpdate ===
Video.FULLSCREEN_UPDATE_PLAYER_DID_DISMISS
event.fullscreenUpdate === VideoFullscreenUpdate.PLAYER_DID_DISMISS
) {
if (gifv) {
await videoPlayer.current?.pauseAsync()

View File

@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
export interface Props {
status: Pick<
Mastodon.Status,
'content' | 'spoiler_text' | 'emojis' | 'mentions' | 'tags'
>
status: Pick<Mastodon.Status, 'content' | 'spoiler_text' | 'emojis'> & {
mentions?: Mastodon.Status['mentions']
tags?: Mastodon.Status['tags']
}
numberOfLines?: number
highlighted?: boolean
disableDetails?: boolean

View File

@ -9,11 +9,11 @@ import { FormattedDate, FormattedRelativeTime, FormattedTime } from 'react-intl'
export interface Props {
created_at: Mastodon.Status['created_at'] | number
edited_at?: Mastodon.Status['edited_at']
highlighted: boolean
highlighted?: boolean
}
const HeaderSharedCreated = React.memo(
({ created_at, edited_at, highlighted }: Props) => {
({ created_at, edited_at, highlighted = false }: Props) => {
const { t } = useTranslation('componentTimeline')
const { colors } = useTheme()

View File

@ -4,7 +4,6 @@ import haptics from '@components/haptics'
import Icon from '@components/Icon'
import { displayMessage } from '@components/Message'
import { ParseEmojis } from '@components/Parse'
import RelativeTime from '@components/RelativeTime'
import CustomText from '@components/Text'
import {
MutationVarsTimelineUpdateStatusProperty,

View File

@ -2,7 +2,10 @@ import analytics from '@components/analytics'
import { ActionSheetOptions } from '@expo/react-native-action-sheet'
import * as ImageManipulator from 'expo-image-manipulator'
import * as ImagePicker from 'expo-image-picker'
import { ImageInfo } from 'expo-image-picker/build/ImagePicker.types'
import {
ImageInfo,
UIImagePickerPresentationStyle
} from 'expo-image-picker/build/ImagePicker.types'
import i18next from 'i18next'
import { Alert, Linking, Platform } from 'react-native'
@ -39,7 +42,7 @@ const mediaSelector = async ({
{ resize }
])
}
resolve(newResult)
resolve({ ...newResult, cancelled: false })
} else {
resolve(result)
}
@ -94,8 +97,8 @@ const mediaSelector = async ({
exif: false,
presentationStyle:
Platform.OS === 'ios' && parseInt(Platform.Version) < 13
? 0
: -2
? UIImagePickerPresentationStyle.FULL_SCREEN
: UIImagePickerPresentationStyle.AUTOMATIC
})
if (!result.cancelled) {

View File

@ -34,6 +34,7 @@ const openLink = async (url: string, navigation?: any) => {
// @ts-ignore
navigation.push(page, options)
} else {
// @ts-ignore
navigationRef.navigate(page, options)
}
}