Skip to content

Commit 7fed047

Browse files
committed
Revert "Feed: three-tab UI (For You / Following / Uploads Only) (#14237)"
This reverts commit 6203998.
1 parent d39ce56 commit 7fed047

27 files changed

Lines changed: 420 additions & 518 deletions

File tree

packages/common/src/api/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export * from './tan-query/collection/useBestSellingAlbums'
3838

3939
// Lineups
4040
export * from './tan-query/lineups/useFeed'
41-
export * from './tan-query/lineups/useForYouFeed'
4241
export * from './tan-query/lineups/useExclusiveTracks'
4342
export * from './tan-query/lineups/useLibraryTracks'
4443
export * from './tan-query/lineups/useProfileReposts'

packages/common/src/api/tan-query/lineups/useForYouFeed.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

packages/common/src/api/tan-query/queryKeys.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export const QUERY_KEYS = {
6868
trackHistory: 'trackHistory',
6969
topTags: 'topTags',
7070
feed: 'feed',
71-
forYouFeed: 'forYouFeed',
7271
authorizedApps: 'authorizedApps',
7372
developerApps: 'developerApps',
7473
searchAutocomplete: 'searchAutocomplete',

packages/common/src/models/Analytics.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ChatPermission, Genre } from '@audius/sdk'
22

33
import { FeedFilter } from '~/models/FeedFilter'
4-
import { FeedTab } from '~/models/FeedTab'
54
import { ID, PlayableType } from '~/models/Identifiers'
65
import { TimeRange } from '~/models/TimeRange'
76
import { WalletAddress } from '~/models/Wallet'
@@ -1352,7 +1351,7 @@ type TrendingChangeView = {
13521351
// Feed
13531352
type FeedChangeView = {
13541353
eventName: Name.FEED_CHANGE_VIEW
1355-
view: FeedFilter | FeedTab
1354+
view: FeedFilter
13561355
}
13571356

13581357
// Notifications

packages/common/src/models/FeedTab.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/common/src/models/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export * from './DownloadQuality'
1212
export * from './ErrorReporting'
1313
export * from './Favorite'
1414
export * from './FeedFilter'
15-
export * from './FeedTab'
1615
export * from './Identifiers'
1716
export * from './ImageSizes'
1817
export * from './Kind'
Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { FeedFilter } from '~/models/FeedFilter'
2-
import { FeedTab } from '~/models/FeedTab'
32
import { ID } from '~/models/Identifiers'
43

54
export const FOLLOW_USERS = 'FEED/FOLLOW_USERS'
65
export const SET_FEED_FILTER = 'FEED/SET_FEED_FILTER'
7-
export const SET_FEED_TAB = 'FEED/SET_FEED_TAB'
86

97
export type FollowUsersAction = {
108
type: typeof FOLLOW_USERS
@@ -16,15 +14,7 @@ export type SetFeedFilterAction = {
1614
filter: FeedFilter
1715
}
1816

19-
export type SetFeedTabAction = {
20-
type: typeof SET_FEED_TAB
21-
tab: FeedTab
22-
}
23-
24-
export type FeedPageAction =
25-
| FollowUsersAction
26-
| SetFeedFilterAction
27-
| SetFeedTabAction
17+
export type FeedPageAction = FollowUsersAction | SetFeedFilterAction
2818

2919
export const followUsers = (userIds: ID[]): FollowUsersAction => ({
3020
type: FOLLOW_USERS,
@@ -35,8 +25,3 @@ export const setFeedFilter = (filter: FeedFilter): SetFeedFilterAction => ({
3525
type: SET_FEED_FILTER,
3626
filter
3727
})
38-
39-
export const setFeedTab = (tab: FeedTab): SetFeedTabAction => ({
40-
type: SET_FEED_TAB,
41-
tab
42-
})

packages/common/src/store/pages/feed/reducer.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ import { persistReducer } from 'redux-persist'
33

44
import {
55
SET_FEED_FILTER,
6-
SET_FEED_TAB,
76
SetFeedFilterAction,
8-
SetFeedTabAction,
97
FeedPageAction
108
} from '~/store/pages/feed/actions'
119

12-
import { FeedFilter, FeedTab } from '../../../models'
10+
import { FeedFilter } from '../../../models'
1311

1412
import { FeedPageState } from './types'
1513

16-
const initialState: FeedPageState = {
17-
feedFilter: FeedFilter.ALL,
18-
feedTab: FeedTab.FOR_YOU
14+
const initialState = {
15+
feedFilter: FeedFilter.ALL
1916
}
2017

2118
const actionsMap = {
@@ -24,26 +21,19 @@ const actionsMap = {
2421
...state,
2522
feedFilter: action.filter
2623
}
27-
},
28-
[SET_FEED_TAB](state: FeedPageState, action: SetFeedTabAction) {
29-
return {
30-
...state,
31-
feedTab: action.tab
32-
}
3324
}
3425
}
3526

3627
const feedPageReducer = (state = initialState, action: FeedPageAction) => {
37-
const matchingReduceFunction =
38-
actionsMap[action.type as keyof typeof actionsMap]
28+
const matchingReduceFunction = actionsMap[action.type]
3929
if (!matchingReduceFunction) return state
40-
return matchingReduceFunction(state, action as any)
30+
return matchingReduceFunction(state, action)
4131
}
4232

4333
export const feedPagePersistConfig = (storage: Storage) => ({
4434
key: 'feed-page',
4535
storage,
46-
whitelist: ['feedFilter', 'feedTab']
36+
whitelist: ['feedFilter']
4737
})
4838

4939
const persistedFeedPageReducer = (storage: Storage) => {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
import { CommonState } from '~/store/commonStore'
22

33
export const getFeedFilter = (state: CommonState) => state.pages.feed.feedFilter
4-
5-
export const getFeedTab = (state: CommonState) => state.pages.feed.feedTab
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { FeedFilter, FeedTab } from '../../../models'
1+
import { FeedFilter } from '../../../models'
22

33
export type FeedPageState = {
44
feedFilter: FeedFilter
5-
feedTab: FeedTab
65
}

0 commit comments

Comments
 (0)