@@ -4,7 +4,7 @@ import type { ImageSourcePropType } from 'react-native'
44import { TouchableOpacity , View , Image } from 'react-native'
55
66import 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'
88import { Text } from 'app/components/core'
99import { makeStyles } from 'app/styles'
1010import { 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
2022export 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 ? (
0 commit comments