@@ -4,14 +4,10 @@ import {View} from 'react-native';
44import { useMemoizedLazyExpensifyIcons , useMemoizedLazyIllustrations } from '@hooks/useLazyAsset' ;
55import useLocalize from '@hooks/useLocalize' ;
66import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
7- import useTheme from '@hooks/useTheme' ;
87import useThemeStyles from '@hooks/useThemeStyles' ;
98import BillingBanner from '@pages/settings/Subscription/CardSection/BillingBanner/BillingBanner' ;
10- import CONST from '@src/CONST' ;
119import Badge from './Badge' ;
1210import Button from './Button' ;
13- import Icon from './Icon' ;
14- import { PressableWithoutFeedback } from './Pressable' ;
1511import Text from './Text' ;
1612
1713type AgentPromotionalBannerProps = {
@@ -42,7 +38,6 @@ type AgentPromotionalBannerProps = {
4238
4339function AgentPromotionalBanner ( { title, subtitle, onDismiss, dismissSentryLabel, ctaText, onCtaPress, ctaSentryLabel, style} : AgentPromotionalBannerProps ) {
4440 const styles = useThemeStyles ( ) ;
45- const theme = useTheme ( ) ;
4641 const { translate} = useLocalize ( ) ;
4742 const { shouldUseNarrowLayout, isInLandscapeMode} = useResponsiveLayout ( ) ;
4843 const illustrations = useMemoizedLazyIllustrations ( [ 'AiBot' ] ) ;
@@ -68,57 +63,33 @@ function AgentPromotionalBanner({title, subtitle, onDismiss, dismissSentryLabel,
6863 [ title , styles , translate ] ,
6964 ) ;
7065
71- const dismissIcon = useMemo (
72- ( ) => (
73- < PressableWithoutFeedback
74- onPress = { onDismiss }
75- style = { [ styles . touchableButtonImage ] }
76- role = { CONST . ROLE . BUTTON }
77- accessibilityLabel = { translate ( 'common.dismiss' ) }
78- sentryLabel = { dismissSentryLabel }
79- >
80- < Icon
81- src = { expensifyIcons . Close }
82- fill = { theme . icon }
83- />
84- </ PressableWithoutFeedback >
85- ) ,
86- [ onDismiss , styles . touchableButtonImage , translate , dismissSentryLabel , expensifyIcons . Close , theme . icon ] ,
87- ) ;
88-
8966 const rightComponent = useMemo ( ( ) => {
9067 if ( ! hasCta ) {
91- return dismissIcon ;
68+ return null ;
9269 }
9370 if ( shouldUseNarrowLayout && ! isInLandscapeMode ) {
9471 return (
95- < >
96- { dismissIcon }
97- < View style = { [ styles . flex0 , styles . flexBasis100 , styles . maxWidth100Percentage , styles . justifyContentCenter ] } >
98- < Button
99- success
100- medium
101- text = { ctaText }
102- onPress = { onCtaPress }
103- sentryLabel = { ctaSentryLabel }
104- />
105- </ View >
106- </ >
72+ < View style = { [ styles . flex0 , styles . flexBasis100 , styles . maxWidth100Percentage , styles . justifyContentCenter ] } >
73+ < Button
74+ success
75+ medium
76+ text = { ctaText }
77+ onPress = { onCtaPress }
78+ sentryLabel = { ctaSentryLabel }
79+ />
80+ </ View >
10781 ) ;
10882 }
10983 return (
110- < View style = { [ styles . flexRow , styles . gap4 , styles . alignItemsCenter ] } >
111- < Button
112- success
113- medium
114- text = { ctaText }
115- onPress = { onCtaPress }
116- sentryLabel = { ctaSentryLabel }
117- />
118- { dismissIcon }
119- </ View >
84+ < Button
85+ success
86+ medium
87+ text = { ctaText }
88+ onPress = { onCtaPress }
89+ sentryLabel = { ctaSentryLabel }
90+ />
12091 ) ;
121- } , [ hasCta , shouldUseNarrowLayout , isInLandscapeMode , ctaText , onCtaPress , ctaSentryLabel , styles , dismissIcon ] ) ;
92+ } , [ hasCta , shouldUseNarrowLayout , isInLandscapeMode , ctaText , onCtaPress , ctaSentryLabel , styles ] ) ;
12293
12394 return (
12495 < View style = { style } >
@@ -128,6 +99,10 @@ function AgentPromotionalBanner({title, subtitle, onDismiss, dismissSentryLabel,
12899 subtitle = { subtitle }
129100 subtitleStyle = { [ styles . mt1 , styles . textLabel ] }
130101 style = { [ styles . borderRadiusComponentLarge ] }
102+ rightIcon = { expensifyIcons . Close }
103+ onRightIconPress = { onDismiss }
104+ rightIconAccessibilityLabel = { translate ( 'common.dismiss' ) }
105+ rightIconSentryLabel = { dismissSentryLabel }
131106 rightComponent = { rightComponent }
132107 />
133108 </ View >
0 commit comments