mirror of https://github.com/tooot-app/app
Fixed #9
This commit is contained in:
parent
4c8003b533
commit
0c76fb642d
|
@ -49,11 +49,12 @@ declare namespace Nav {
|
|||
}
|
||||
| undefined
|
||||
'Screen-ImagesViewer': {
|
||||
imageUrls: (App.IImageInfo & {
|
||||
imageUrls: {
|
||||
url: Mastodon.AttachmentImage['url']
|
||||
preview_url: Mastodon.AttachmentImage['preview_url']
|
||||
remote_url?: Mastodon.AttachmentImage['remote_url']
|
||||
imageIndex: number
|
||||
})[]
|
||||
}[]
|
||||
imageIndex: number
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||
const { t } = useTranslation('common')
|
||||
const dispatch = useDispatch()
|
||||
const localActiveIndex = useSelector(getLocalActiveIndex)
|
||||
const { mode } = useTheme()
|
||||
const { mode, theme } = useTheme()
|
||||
enum barStyle {
|
||||
light = 'dark-content',
|
||||
dark = 'light-content'
|
||||
|
@ -137,7 +137,7 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||
|
||||
return (
|
||||
<>
|
||||
<StatusBar barStyle={barStyle[mode]} />
|
||||
<StatusBar barStyle={barStyle[mode]} backgroundColor={theme.background} />
|
||||
<NavigationContainer
|
||||
ref={navigationRef}
|
||||
theme={themes[mode]}
|
||||
|
@ -156,7 +156,8 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||
component={ScreenActions}
|
||||
options={{
|
||||
stackPresentation: 'transparentModal',
|
||||
stackAnimation: 'fade'
|
||||
stackAnimation: 'fade',
|
||||
headerShown: false // Android
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
|
@ -164,14 +165,16 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||
component={ScreenAnnouncements}
|
||||
options={{
|
||||
stackPresentation: 'transparentModal',
|
||||
stackAnimation: 'fade'
|
||||
stackAnimation: 'fade',
|
||||
headerShown: false // Android
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name='Screen-Compose'
|
||||
component={ScreenCompose}
|
||||
options={{
|
||||
stackPresentation: 'fullScreenModal'
|
||||
stackPresentation: 'fullScreenModal',
|
||||
headerShown: false // Android
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
|
@ -179,7 +182,8 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||
component={ScreenImagesViewer}
|
||||
options={{
|
||||
stackPresentation: 'fullScreenModal',
|
||||
stackAnimation: 'fade'
|
||||
stackAnimation: 'fade',
|
||||
headerShown: false // Android
|
||||
}}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
|
|
|
@ -76,7 +76,7 @@ const Timeline: React.FC<Props> = ({
|
|||
firstPage.links?.prev && {
|
||||
min_id: firstPage.links.prev,
|
||||
// https://github.com/facebook/react-native/issues/25239#issuecomment-731100372
|
||||
limit: '8'
|
||||
limit: '6'
|
||||
},
|
||||
|
||||
getNextPageParam: lastPage =>
|
||||
|
|
|
@ -50,8 +50,6 @@ const TimelineAttachment: React.FC<Props> = ({ status }) => {
|
|||
case 'image':
|
||||
imageUrls.push({
|
||||
url: attachment.url,
|
||||
width: attachment.meta?.original?.width,
|
||||
height: attachment.meta?.original?.height,
|
||||
preview_url: attachment.preview_url,
|
||||
remote_url: attachment.remote_url,
|
||||
imageIndex: index
|
||||
|
|
|
@ -12,6 +12,7 @@ import {
|
|||
PermissionsAndroid,
|
||||
Platform,
|
||||
Share,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
View
|
||||
} from 'react-native'
|
||||
|
@ -52,7 +53,7 @@ const ScreenImagesViewer = ({
|
|||
return
|
||||
}
|
||||
CameraRoll.save(
|
||||
imageUrls[imageIndex].originUrl ||
|
||||
imageUrls[imageIndex].url ||
|
||||
imageUrls[imageIndex].remote_url ||
|
||||
imageUrls[imageIndex].preview_url
|
||||
)
|
||||
|
@ -133,6 +134,7 @@ const ScreenImagesViewer = ({
|
|||
|
||||
return (
|
||||
<SafeAreaView style={styles.base} edges={['top']}>
|
||||
<StatusBar backgroundColor='rgb(0,0,0)' />
|
||||
<ImageView
|
||||
images={imageUrls.map(urls => ({ uri: urls.url }))}
|
||||
imageIndex={imageIndex}
|
||||
|
|
Loading…
Reference in New Issue