Hide header bottom shadow

This commit is contained in:
Zhiyuan Zheng 2020-12-25 21:51:46 +01:00
parent 087f50577f
commit 9d1c366eda
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
9 changed files with 23 additions and 12 deletions

View File

@ -5,7 +5,7 @@ import {
NavigationContainerRef
} from '@react-navigation/native'
import React, { useEffect, useMemo, useRef } from 'react'
import React, { useEffect, useRef } from 'react'
import { StatusBar } from 'react-native'
import Toast from 'react-native-toast-message'
import { Feather } from '@expo/vector-icons'
@ -27,8 +27,7 @@ import {
updateLocalAccountPreferences,
updateNotification
} from '@utils/slices/instancesSlice'
import { useInfiniteQuery, useQuery } from 'react-query'
import { announcementFetch } from './utils/fetches/announcementsFetch'
import { useInfiniteQuery } from 'react-query'
import client from './api/client'
import { timelineFetch } from './utils/fetches/timelineFetch'
@ -80,7 +79,9 @@ export const Index: React.FC<Props> = ({ localCorrupt }) => {
})
.then(({ body }: { body?: Mastodon.Announcement[] }) => {
if (body?.filter(announcement => !announcement.read).length) {
navigationRef.current?.navigate('Screen-Shared-Announcements')
navigationRef.current?.navigate('Screen-Shared-Announcements', {
showAll: false
})
}
})
.catch(() => {})

View File

@ -67,7 +67,7 @@ const Timelines: React.FC<Props> = ({ name, content }) => {
)
return (
<Stack.Navigator>
<Stack.Navigator screenOptions={{ headerHideShadow: true }}>
<Stack.Screen
name={name}
options={{

View File

@ -133,9 +133,9 @@ const Timeline: React.FC<Props> = ({
() => <TimelineEmpty status={status} refetch={refetch} />,
[status]
)
const onEndReached = useCallback(() => fetchNextPage(), [])
const onEndReached = useCallback(() => !disableRefresh && fetchNextPage(), [])
const ListFooterComponent = useCallback(
() => <TimelineEnd hasNextPage={hasNextPage} />,
() => <TimelineEnd hasNextPage={!disableRefresh ? hasNextPage : false} />,
[hasNextPage]
)
const refreshControl = useMemo(

View File

@ -19,7 +19,7 @@ const ScreenMe: React.FC = () => {
const { t } = useTranslation()
return (
<Stack.Navigator>
<Stack.Navigator screenOptions={{ headerHideShadow: true }}>
<Stack.Screen
name='Screen-Me-Root'
component={ScreenMeRoot}

View File

@ -24,7 +24,10 @@ const ScreenNotifications: React.FC = () => {
return (
<Stack.Navigator
screenOptions={{ headerTitle: t('notifications:heading') }}
screenOptions={{
headerTitle: t('notifications:heading'),
headerHideShadow: true
}}
>
<Stack.Screen name='Screen-Notifications-Root'>
{() => (localRegistered ? <Timeline page='Notifications' /> : null)}

View File

@ -3,6 +3,7 @@ import client from '@root/api/client'
import { ButtonRow } from '@root/components/Button'
import ParseContent from '@root/components/ParseContent'
import { announcementFetch } from '@root/utils/fetches/announcementsFetch'
import relativeTime from '@root/utils/relativeTime'
import { StyleConstants } from '@root/utils/styles/constants'
import { useTheme } from '@root/utils/styles/ThemeManager'
import React, { useCallback, useEffect, useState } from 'react'
@ -90,6 +91,9 @@ const ScreenSharedAnnouncements: React.FC = ({
}
]}
>
<Text style={[styles.published, { color: theme.secondary }]}>
{relativeTime(item.published_at)}
</Text>
<ScrollView style={styles.scrollView} showsVerticalScrollIndicator>
<ParseContent
content={item.content}
@ -220,6 +224,10 @@ const styles = StyleSheet.create({
padding: StyleConstants.Spacing.Global.PagePadding,
justifyContent: 'center'
},
published: {
fontSize: StyleConstants.Font.Size.S,
marginBottom: StyleConstants.Spacing.S
},
pressable: { ...StyleSheet.absoluteFillObject },
announcement: {
flexShrink: 1,

View File

@ -224,7 +224,7 @@ const ComposeEditAttachment: React.FC<Props> = ({
return (
<KeyboardAvoidingView behavior='padding' style={{ flex: 1 }}>
<SafeAreaView style={{ flex: 1 }} edges={['right', 'bottom', 'left']}>
<Stack.Navigator>
<Stack.Navigator screenOptions={{ headerHideShadow: true }}>
<Stack.Screen
name='Screen-Shared-Compose-EditAttachment-Root'
options={{

View File

@ -85,7 +85,7 @@ const ScreenSharedImagesViewer: React.FC<Props> = ({
[]
)
return (
<Stack.Navigator>
<Stack.Navigator screenOptions={{ headerHideShadow: true }}>
<Stack.Screen
name='Screen-Shared-ImagesViewer-Root'
component={component}

View File

@ -117,7 +117,6 @@ export const timelineFetch = async ({
toots = uniqBy([...toots, ...res.body], 'id')
return Promise.resolve({ toots: toots, pinnedLength })
}
break
case 'Account_All':
res = await client({