Skip to content

Commit 96c9fde

Browse files
Add mobile trending winners (#13732)
1 parent 3bf7f38 commit 96c9fde

28 files changed

Lines changed: 988 additions & 319 deletions

packages/common/src/store/pages/trending/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Genre } from '~/utils'
22

33
import { LineupState, TimeRange, Track } from '../../../models'
44

5-
export type TrendingCategory = 'tracks' | 'underground'
5+
export type TrendingCategory = 'tracks' | 'underground' | 'winners'
66

77
export type TrendingPageState = {
88
trendingWeek: LineupState<Track>

packages/common/src/store/ui/modals/parentSlice.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const initialState: BasicModalsState = {
2626
TrendingGenreSelection: { isOpen: false },
2727
TrendingCategory: { isOpen: false },
2828
TrendingTimeRange: { isOpen: false },
29+
TrendingFilter: { isOpen: false },
2930
TrendingRewardsExplainer: { isOpen: false },
3031
SocialProof: { isOpen: false },
3132
EditFolder: { isOpen: false },

packages/common/src/store/ui/modals/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export type Modals =
6161
| 'TrendingGenreSelection'
6262
| 'TrendingCategory'
6363
| 'TrendingTimeRange'
64+
| 'TrendingFilter'
6465
| 'TrendingRewardsExplainer'
6566
| 'SocialProof'
6667
| 'EditFolder'
Lines changed: 1 addition & 1 deletion
Loading

packages/mobile/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ PODS:
13291329
- React
13301330
- react-native-google-cast/NoBluetoothArm (= 4.6.2)
13311331
- react-native-google-cast/NoBluetoothArm (4.6.2):
1332-
- google-cast-sdk-dynamic-xcframework-no-bluetooth (= 4.7.1)
1332+
- google-cast-sdk-dynamic-xcframework-no-bluetooth
13331333
- React
13341334
- react-native-google-cast/RNGoogleCast
13351335
- react-native-google-cast/RNGoogleCast (4.6.2):
@@ -2532,7 +2532,7 @@ SPEC CHECKSUMS:
25322532
react-native-document-picker: 4f90a074d1eb269e32d5563c53b70d469180cece
25332533
react-native-fast-crypto: b30594570dab23aca7e74e206b2c03e28a006216
25342534
react-native-get-random-values: 384787fd76976f5aec9465aff6fa9e9129af1e74
2535-
react-native-google-cast: 0a82cf63114470403e41e04ffa2b13d6448b6112
2535+
react-native-google-cast: 18b9b2fc518caabfa65d309409e160b3fc6d1733
25362536
react-native-image-picker: f104798044ef2c9211c42a48025d0693b5f34981
25372537
react-native-in-app-review: db8bb167a5f238e7ceca5c242d6b36ce8c4404a4
25382538
react-native-keyboard-controller: 7c1271a9fe703b7ee588b75d6c486eda79e5081b

packages/mobile/src/app/Drawers.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ import { ConnectNewWalletDrawer } from 'app/screens/external-wallets/components/
5555
import { WelcomeDrawer } from 'app/screens/sign-on-screen/components/WelcomeDrawer'
5656
import { PickWinnersDrawer } from 'app/screens/track-screen/PickWinnersDrawer'
5757
import {
58-
TrendingCategoryDrawer,
59-
TrendingFilterDrawer,
60-
TrendingTimeRangeDrawer
58+
TrendingCombinedFilterDrawer,
59+
TrendingFilterDrawer
6160
} from 'app/screens/trending-screen'
6261
import { WalletRowOverflowMenu } from 'app/screens/wallet-screen/components/LinkedWallets'
6362

@@ -117,8 +116,7 @@ const commonDrawersMap: { [Modal in Modals]?: ComponentType } = {
117116
DeactivateAccountConfirmation: DeactivateAccountConfirmationDrawer,
118117
FeedFilter: FeedFilterDrawer,
119118
TrendingGenreSelection: TrendingFilterDrawer,
120-
TrendingCategory: TrendingCategoryDrawer,
121-
TrendingTimeRange: TrendingTimeRangeDrawer,
119+
TrendingFilter: TrendingCombinedFilterDrawer,
122120
Overflow: OverflowMenuDrawer,
123121
SignOutConfirmation: SignOutConfirmationDrawer,
124122
AddToCollection: AddToCollectionDrawer,

packages/mobile/src/components/core/Screen/ScreenSecondaryContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ScreenSecondaryContent = (props: ScreenSecondaryContentProps) => {
2626
return isPrimaryContentReady ? (
2727
<Animated.View
2828
entering={Platform.OS === 'ios' ? FadeIn : undefined}
29-
style={{ flex: 1 }}
29+
style={{ flex: 1, minHeight: 0 }}
3030
>
3131
{children}
3232
</Animated.View>

packages/mobile/src/components/drawer/Drawer.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ export type DrawerProps = {
208208
* Optional replacement component for the drawer header
209209
*/
210210
drawerHeader?: ComponentType<{ onClose: () => void }>
211+
/**
212+
* Show back arrow instead of close X in the header. For nested drawers.
213+
*/
214+
showBackButton?: boolean
211215

212216
translationAnim?: Animated.Value
213217
}
@@ -278,6 +282,7 @@ export const Drawer: DrawerComponent = ({
278282
shouldHaveRoundedBordersAtInitialOffset = false,
279283
zIndex = 5,
280284
drawerHeader: CustomDrawerHeader,
285+
showBackButton = false,
281286
drawerStyle,
282287
shouldShowShadow = true,
283288
shouldAnimateShadow,
@@ -705,6 +710,7 @@ export const Drawer: DrawerComponent = ({
705710
titleImage={titleImage}
706711
isFullscreen={isFullscreen}
707712
blockClose={blockClose}
713+
showBackButton={showBackButton}
708714
/>
709715
)}
710716
{children}

packages/mobile/src/components/drawer/DrawerHeader.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ImageSourcePropType } from 'react-native'
44
import { TouchableOpacity, View, Image } from 'react-native'
55

66
import type { IconComponent } from '@audius/harmony-native'
7-
import { Flex, IconClose, spacing } from '@audius/harmony-native'
7+
import { Flex, IconCaretLeft, IconClose, spacing } from '@audius/harmony-native'
88
import { Text } from 'app/components/core'
99
import { makeStyles } from 'app/styles'
1010
import { zIndex } from 'app/utils/zIndex'
@@ -15,6 +15,8 @@ type DrawerHeaderProps = {
1515
titleImage?: ImageSourcePropType
1616
isFullscreen?: boolean
1717
blockClose?: boolean
18+
/** Use back arrow instead of close X. For nested drawers that navigate "back". */
19+
showBackButton?: boolean
1820
}
1921

2022
export const useStyles = makeStyles(({ spacing }) => ({
@@ -46,9 +48,11 @@ export const DrawerHeader = (props: DrawerHeaderProps) => {
4648
titleIcon: TitleIcon,
4749
titleImage,
4850
isFullscreen,
49-
blockClose = false
51+
blockClose = false,
52+
showBackButton = false
5053
} = props
5154
const styles = useStyles()
55+
const DismissIcon = showBackButton ? IconCaretLeft : IconClose
5256

5357
return title || isFullscreen ? (
5458
<View style={styles.titleBarContainer}>
@@ -59,7 +63,7 @@ export const DrawerHeader = (props: DrawerHeaderProps) => {
5963
style={styles.dismissContainer}
6064
hitSlop={spacing.m}
6165
>
62-
<IconClose size='m' color='subdued' />
66+
<DismissIcon size='m' color='subdued' />
6367
</TouchableOpacity>
6468
) : null}
6569
{title ? (

packages/mobile/src/harmony-native/icons.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type IconComponent = FunctionComponent<IconProps>
1515

1616
export { default as IconAlbum } from '@audius/harmony/src/assets/icons/Album.svg'
1717
export { default as IconFilter } from '@audius/harmony/src/assets/icons/Filter.svg'
18+
export { default as IconLeading } from '@audius/harmony/src/assets/icons/Leading.svg'
1819
export { default as IconSearch } from '@audius/harmony/src/assets/icons/Search.svg'
1920
export { default as IconAllTime } from '@audius/harmony/src/assets/icons/AllTime.svg'
2021
export { default as IconFolder } from '@audius/harmony/src/assets/icons/Folder.svg'

0 commit comments

Comments
 (0)