Reorganize custom feeds in the view layer
parent
b672006f7e
commit
3d09008bfd
|
@ -1,5 +1,4 @@
|
||||||
import {makeAutoObservable} from 'mobx'
|
import {makeAutoObservable} from 'mobx'
|
||||||
import {AppBskyFeedDefs} from '@atproto/api'
|
|
||||||
import {RootStoreModel} from '../root-store'
|
import {RootStoreModel} from '../root-store'
|
||||||
import {ProfileModel} from '../content/profile'
|
import {ProfileModel} from '../content/profile'
|
||||||
import {PostsFeedModel} from '../feeds/posts'
|
import {PostsFeedModel} from '../feeds/posts'
|
||||||
|
@ -90,9 +89,6 @@ export class ProfileUiModel {
|
||||||
get selectedView() {
|
get selectedView() {
|
||||||
return this.selectorItems[this.selectedViewIndex]
|
return this.selectorItems[this.selectedViewIndex]
|
||||||
}
|
}
|
||||||
isGeneratorView(v: any) {
|
|
||||||
return AppBskyFeedDefs.isGeneratorView(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
get uiItems() {
|
get uiItems() {
|
||||||
let arr: any[] = []
|
let arr: any[] = []
|
||||||
|
|
|
@ -21,7 +21,7 @@ import {pluralize} from 'lib/strings/helpers'
|
||||||
import {AtUri} from '@atproto/api'
|
import {AtUri} from '@atproto/api'
|
||||||
import {isWeb} from 'platform/detection'
|
import {isWeb} from 'platform/detection'
|
||||||
|
|
||||||
const AlgoItem = observer(
|
const CustomFeed = observer(
|
||||||
({
|
({
|
||||||
item,
|
item,
|
||||||
style,
|
style,
|
||||||
|
@ -112,7 +112,7 @@ const AlgoItem = observer(
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
export default AlgoItem
|
export default CustomFeed
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
|
@ -5,7 +5,7 @@ import {colors} from 'lib/styles'
|
||||||
import {observer} from 'mobx-react-lite'
|
import {observer} from 'mobx-react-lite'
|
||||||
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
||||||
import {SavedFeedsModel} from 'state/models/ui/saved-feeds'
|
import {SavedFeedsModel} from 'state/models/ui/saved-feeds'
|
||||||
import AlgoItem from './AlgoItem'
|
import CustomFeed from './CustomFeed'
|
||||||
|
|
||||||
export const SavedFeedItem = observer(
|
export const SavedFeedItem = observer(
|
||||||
({
|
({
|
||||||
|
@ -19,7 +19,7 @@ export const SavedFeedItem = observer(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.itemContainer}>
|
<View style={styles.itemContainer}>
|
||||||
<AlgoItem
|
<CustomFeed
|
||||||
key={item.data.uri}
|
key={item.data.uri}
|
||||||
item={item}
|
item={item}
|
||||||
showBottom={false}
|
showBottom={false}
|
|
@ -25,7 +25,7 @@ import {ExternalLinkEmbed} from './ExternalLinkEmbed'
|
||||||
import {getYoutubeVideoId} from 'lib/strings/url-helpers'
|
import {getYoutubeVideoId} from 'lib/strings/url-helpers'
|
||||||
import QuoteEmbed from './QuoteEmbed'
|
import QuoteEmbed from './QuoteEmbed'
|
||||||
import {AutoSizedImage} from '../images/AutoSizedImage'
|
import {AutoSizedImage} from '../images/AutoSizedImage'
|
||||||
import AlgoItem from 'view/com/algos/AlgoItem'
|
import CustomFeed from 'view/com/feeds/CustomFeed'
|
||||||
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
||||||
|
|
||||||
type Embed =
|
type Embed =
|
||||||
|
@ -171,7 +171,7 @@ export function PostEmbeds({
|
||||||
AppBskyFeedDefs.isGeneratorView(embed.record)
|
AppBskyFeedDefs.isGeneratorView(embed.record)
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<AlgoItem
|
<CustomFeed
|
||||||
item={new CustomFeedModel(store, embed.record)}
|
item={new CustomFeedModel(store, embed.record)}
|
||||||
style={[pal.view, pal.border, styles.extOuter]}
|
style={[pal.view, pal.border, styles.extOuter]}
|
||||||
reloadOnFocus={true}
|
reloadOnFocus={true}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React, {useMemo, useRef} from 'react'
|
||||||
import {FlatList, StyleSheet, TouchableOpacity, View} from 'react-native'
|
import {FlatList, StyleSheet, TouchableOpacity, View} from 'react-native'
|
||||||
import {useStores} from 'state/index'
|
import {useStores} from 'state/index'
|
||||||
import {PostsFeedModel} from 'state/models/feeds/posts'
|
import {PostsFeedModel} from 'state/models/feeds/posts'
|
||||||
import {useCustomFeed} from 'view/com/algos/useCustomFeed'
|
import {useCustomFeed} from 'lib/hooks/useCustomFeed'
|
||||||
import {withAuthRequired} from 'view/com/auth/withAuthRequired'
|
import {withAuthRequired} from 'view/com/auth/withAuthRequired'
|
||||||
import {Feed} from 'view/com/posts/Feed'
|
import {Feed} from 'view/com/posts/Feed'
|
||||||
import {Link} from 'view/com/util/Link'
|
import {Link} from 'view/com/util/Link'
|
||||||
|
|
|
@ -24,7 +24,7 @@ import DraggableFlatList, {
|
||||||
ShadowDecorator,
|
ShadowDecorator,
|
||||||
ScaleDecorator,
|
ScaleDecorator,
|
||||||
} from 'react-native-draggable-flatlist'
|
} from 'react-native-draggable-flatlist'
|
||||||
import {SavedFeedItem} from 'view/com/algos/SavedFeedItem'
|
import {SavedFeedItem} from 'view/com/feeds/SavedFeedItem'
|
||||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||||
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import {FAB} from '../com/util/fab/FAB'
|
||||||
import {s, colors} from 'lib/styles'
|
import {s, colors} from 'lib/styles'
|
||||||
import {useAnalytics} from 'lib/analytics'
|
import {useAnalytics} from 'lib/analytics'
|
||||||
import {ComposeIcon2} from 'lib/icons'
|
import {ComposeIcon2} from 'lib/icons'
|
||||||
import AlgoItem from 'view/com/algos/AlgoItem'
|
import CustomFeed from 'view/com/feeds/CustomFeed'
|
||||||
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
import {CustomFeedModel} from 'state/models/feeds/custom-feed'
|
||||||
import {useSetTitle} from 'lib/hooks/useSetTitle'
|
import {useSetTitle} from 'lib/hooks/useSetTitle'
|
||||||
import {combinedDisplayName} from 'lib/strings/display-names'
|
import {combinedDisplayName} from 'lib/strings/display-names'
|
||||||
|
@ -189,7 +189,7 @@ export const ProfileScreen = withAuthRequired(
|
||||||
<FeedSlice slice={item} ignoreMuteFor={uiState.profile.did} />
|
<FeedSlice slice={item} ignoreMuteFor={uiState.profile.did} />
|
||||||
)
|
)
|
||||||
} else if (item instanceof CustomFeedModel) {
|
} else if (item instanceof CustomFeedModel) {
|
||||||
return <AlgoItem item={item} />
|
return <CustomFeed item={item} />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return <View />
|
return <View />
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {s} from 'lib/styles'
|
||||||
import {SavedFeedsModel} from 'state/models/ui/saved-feeds'
|
import {SavedFeedsModel} from 'state/models/ui/saved-feeds'
|
||||||
import {Link} from 'view/com/util/Link'
|
import {Link} from 'view/com/util/Link'
|
||||||
import {UserAvatar} from 'view/com/util/UserAvatar'
|
import {UserAvatar} from 'view/com/util/UserAvatar'
|
||||||
import {SavedFeedItem} from 'view/com/algos/SavedFeedItem'
|
import {SavedFeedItem} from 'view/com/feeds/SavedFeedItem'
|
||||||
import {AtUri} from '@atproto/api'
|
import {AtUri} from '@atproto/api'
|
||||||
|
|
||||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'SavedFeeds'>
|
type Props = NativeStackScreenProps<CommonNavigatorParams, 'SavedFeeds'>
|
||||||
|
|
Loading…
Reference in New Issue