diff --git a/apps/AEPSampleAppNewArchEnabled/app/ContentCardView.tsx b/apps/AEPSampleAppNewArchEnabled/app/ContentCardView.tsx index de97053a..a4de40ce 100644 --- a/apps/AEPSampleAppNewArchEnabled/app/ContentCardView.tsx +++ b/apps/AEPSampleAppNewArchEnabled/app/ContentCardView.tsx @@ -66,13 +66,13 @@ const ContentCardView = () => { }; useEffect(() => { - Messaging.updatePropositionsForSurfaces(["rn/ios/small_image"]); + Messaging.updatePropositionsForSurfaces(["rn/ios/remote_image"]); // Note: // - Call above to update the propositions and cache the content locally // - Customers may call this function when launching the app // MobileCore.trackAction("xyz"); // const provider = new ContentProvider("card/ms"); - const provider = new ContentProvider("rn/ios/small_image"); + const provider = new ContentProvider("rn/ios/remote_image"); provider .getContent() .then((content) => { @@ -246,7 +246,7 @@ const ContentCardView = () => { }, }} > - { }, }} > - { {selectedView === "ImageOnly" && ( {renderStyledText("1. All fields")} - { - console.log("Event triggered: - for imageOnly image 1", event, identifier); + console.log( + "Event triggered: - for imageOnly image 1", + event, + identifier + ); }} /> - - {renderStyledText("2. Images with Action url, dismiss style simple - card height 800")} - { - console.log("Event triggered: - for imageOnly image 2", event, identifier); + console.log( + "Event triggered: - for imageOnly image 2", + event, + identifier + ); }} /> - {renderStyledText("3.Adobe default image, dismiss style circle - card height 400")} - { - console.log("Event triggered: - for imageOnly image 3", event, identifier); + console.log( + "Event triggered: - for imageOnly image 3", + event, + identifier + ); }} /> {renderStyledText("4. No dismiss button - no card height")} - + {renderStyledText("5. [image] Invalid")} { cardHeight={200} /> - {renderStyledText("6.[action] No actionUrl")} { styleOverrides={{ imageOnlyStyle: { image: { - aspectRatio: 1/ 1, + aspectRatio: 1 / 1, }, }, }} listener={(event, identifier) => { - console.log("Event triggered: - for imageOnly image 7", event, identifier); + console.log( + "Event triggered: - for imageOnly image 7", + event, + identifier + ); }} /> {renderStyledText("8.[style] Custom height (150)")} + }, + }} + /> - {renderStyledText("9. [style] Custom width (80%), set image container backgroud color")} + {renderStyledText( + "9. [style] Custom width (80%), set image container backgroud color" + )} { borderRadius: 80, margin: 30, }, - image: { - width: '50%', - resizeMode: 'stretch' + image: { + width: "50%", + resizeMode: "stretch", }, }, }} @@ -620,7 +638,7 @@ const ContentCardView = () => { borderColor: "#FF69B4", maxHeight: 100, }, - image: { + image: { resizeMode: "center", backgroundColor: "#79f4bbff", }, @@ -657,7 +675,9 @@ const ContentCardView = () => { cardHeight={200} /> - {renderStyledText("1.[image] No Light Mode (only dark mode) - no actionUrl")} + {renderStyledText( + "1.[image] No Light Mode (only dark mode) - no actionUrl" + )} void ): React.ReactElement => { const style = { ...component.style }; - const viewStyle = { + const viewStyle: ViewStyle = { ...(style as ViewStyle), - backgroundColor: theme.colors.background, + ...(theme.colors.background != null + ? { backgroundColor: theme.colors.background } + : {}), }; return ( @@ -144,9 +146,11 @@ const renderTextComponent = ( theme: Theme ): React.ReactElement => { const style = { ...component.style }; - const textStyle = { + const textStyle: ComponentTextStyle = { ...(style as ComponentTextStyle), - color: theme.colors.text_primary, + ...(theme.colors.text_primary != null + ? { color: theme.colors.text_primary } + : {}), }; return ( @@ -172,9 +176,11 @@ const renderTitleComponent = ( theme: Theme ): React.ReactElement => { const style = { ...component.style }; - const titleStyle = { + const titleStyle: ComponentTextStyle = { ...(style as ComponentTextStyle), - color: theme.colors.text_primary, + ...(theme.colors.text_primary != null + ? { color: theme.colors.text_primary } + : {}), }; return ( @@ -200,9 +206,11 @@ const renderBodyComponent = ( theme: Theme ): React.ReactElement => { const style = { ...component.style }; - const bodyStyle = { + const bodyStyle: ComponentTextStyle = { ...(style as ComponentTextStyle), - color: theme.colors.text_secondary, + ...(theme.colors.text_secondary != null + ? { color: theme.colors.text_secondary } + : {}), }; return ( @@ -236,9 +244,11 @@ const renderImageComponent = ( ? component.darkUrl : component.url; - const imageStyle = { + const imageStyle: ImageStyle = { ...(style as ImageStyle), - backgroundColor: theme.colors.image_placeholder, + ...(theme.colors.image_placeholder != null + ? { backgroundColor: theme.colors.image_placeholder } + : {}), }; return ( @@ -276,7 +286,7 @@ const renderButtonComponent = (