diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-01-24 13:00:11 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 13:00:11 -0600 |
commit | f36c9565362b741c58672204fe0c155252affe28 (patch) | |
tree | 85d90f3caae2c8f2103ec50346f9274cf8b243c5 /src/view/com/notifications/Feed.tsx | |
parent | 3a90114f3afc66cfef70c71c2ee343c29e1f3e8d (diff) | |
download | voidsky-f36c9565362b741c58672204fe0c155252affe28.tar.zst |
Resolve all remaining lint issues (#88)
* Rework 'navIdx' variables from number arrays to strings to avoid equality-check failures in react hooks * Resolve all remaining lint issues * Fix tests * Use node v18 in gh action test
Diffstat (limited to 'src/view/com/notifications/Feed.tsx')
-rw-r--r-- | src/view/com/notifications/Feed.tsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/view/com/notifications/Feed.tsx b/src/view/com/notifications/Feed.tsx index ea7695d93..5f9cb129d 100644 --- a/src/view/com/notifications/Feed.tsx +++ b/src/view/com/notifications/Feed.tsx @@ -1,12 +1,13 @@ import React from 'react' import {observer} from 'mobx-react-lite' -import {View, FlatList} from 'react-native' +import {FlatList, StyleSheet, View} from 'react-native' import {NotificationsViewModel} from '../../../state/models/notifications-view' import {FeedItem} from './FeedItem' import {NotificationFeedLoadingPlaceholder} from '../util/LoadingPlaceholder' import {ErrorMessage} from '../util/error/ErrorMessage' import {EmptyState} from '../util/EmptyState' import {OnScrollCb} from '../../lib/hooks/useOnMainScroll' +import {s} from '../../lib/styles' const EMPTY_FEED_ITEM = {_reactKey: '__empty__'} @@ -29,7 +30,7 @@ export const Feed = observer(function Feed({ <EmptyState icon="bell" message="No notifications yet!" - style={{paddingVertical: 40}} + style={styles.emptyState} /> ) } @@ -58,14 +59,10 @@ export const Feed = observer(function Feed({ } } return ( - <View style={{flex: 1}}> + <View style={s.h100pct}> {view.isLoading && !data && <NotificationFeedLoadingPlaceholder />} {view.hasError && ( - <ErrorMessage - message={view.error} - style={{margin: 6}} - onPressTryAgain={onPressTryAgain} - /> + <ErrorMessage message={view.error} onPressTryAgain={onPressTryAgain} /> )} {data && ( <FlatList @@ -76,9 +73,13 @@ export const Feed = observer(function Feed({ onRefresh={onRefresh} onEndReached={onEndReached} onScroll={onScroll} - contentContainerStyle={{paddingBottom: 200}} + contentContainerStyle={s.contentContainer} /> )} </View> ) }) + +const styles = StyleSheet.create({ + emptyState: {paddingVertical: 40}, +}) |