Reorganize state models for clarity (#378)

This commit is contained in:
Paul Frazee 2023-04-03 15:21:17 -05:00 committed by GitHub
parent 9652d994dd
commit 2045c615a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 163 additions and 171 deletions

View file

@ -2,7 +2,7 @@ import React, {MutableRefObject} from 'react'
import {observer} from 'mobx-react-lite'
import {CenteredView, FlatList} from '../util/Views'
import {ActivityIndicator, RefreshControl, StyleSheet, View} from 'react-native'
import {NotificationsViewModel} from 'state/models/notifications-view'
import {NotificationsFeedModel} from 'state/models/feeds/notifications'
import {FeedItem} from './FeedItem'
import {NotificationFeedLoadingPlaceholder} from '../util/LoadingPlaceholder'
import {ErrorMessage} from '../util/error/ErrorMessage'
@ -19,7 +19,7 @@ export const Feed = observer(function Feed({
onPressTryAgain,
onScroll,
}: {
view: NotificationsViewModel
view: NotificationsFeedModel
scrollElRef?: MutableRefObject<FlatList<any> | null>
onPressTryAgain?: () => void
onScroll?: OnScrollCb

View file

@ -14,8 +14,8 @@ import {
FontAwesomeIconStyle,
Props,
} from '@fortawesome/react-native-fontawesome'
import {NotificationsViewItemModel} from 'state/models/notifications-view'
import {PostThreadViewModel} from 'state/models/post-thread-view'
import {NotificationsFeedItemModel} from 'state/models/feeds/notifications'
import {PostThreadModel} from 'state/models/content/post-thread'
import {s, colors} from 'lib/styles'
import {ago} from 'lib/strings/time'
import {pluralize} from 'lib/strings/helpers'
@ -42,7 +42,7 @@ interface Author {
export const FeedItem = observer(function FeedItem({
item,
}: {
item: NotificationsViewItemModel
item: NotificationsFeedItemModel
}) {
const pal = usePalette('default')
const [isAuthorsExpanded, setAuthorsExpanded] = React.useState<boolean>(false)
@ -338,7 +338,7 @@ function ExpandedAuthorsList({
function AdditionalPostText({
additionalPost,
}: {
additionalPost?: PostThreadViewModel
additionalPost?: PostThreadModel
}) {
const pal = usePalette('default')
if (