Skip to content

Commit 573db46

Browse files
committed
style: enhance IterableEmbeddedBanner with shadow properties and elevation
1 parent 2cffe33 commit 573db46

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/embedded/components/IterableEmbeddedBanner/IterableEmbeddedBanner.styles.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { StyleSheet, Platform } from 'react-native';
33
// See https://support.iterable.com/hc/en-us/articles/23230946708244-Out-of-the-Box-Views-for-Embedded-Messages#banners
44
export const IMAGE_HEIGHT = Platform.OS === 'android' ? 80 : 100;
55
export const IMAGE_WIDTH = Platform.OS === 'android' ? 80 : 100;
6+
const SHADOW_COLOR_LIGHT = 'rgba(0, 0, 0, 0.06)';
7+
const SHADOW_COLOR_DARK = 'rgba(0, 0, 0, 0.08)';
68

79
export const styles = StyleSheet.create({
810
body: {
@@ -41,12 +43,17 @@ export const styles = StyleSheet.create({
4143
alignItems: 'flex-start',
4244
borderStyle: 'solid',
4345
boxShadow:
44-
'0 1px 1px 0 rgba(0, 0, 0, 0.06), 0 0 2px 0 rgba(0, 0, 0, 0.06), 0 0 1px 0 rgba(0, 0, 0, 0.08)',
46+
`0 1px 1px 0 ${SHADOW_COLOR_LIGHT}, 0 0 2px 0 ${SHADOW_COLOR_LIGHT}, 0 0 1px 0 ${SHADOW_COLOR_DARK}`,
4547
display: 'flex',
48+
elevation: 1,
4649
flexDirection: 'column',
4750
gap: 16,
4851
justifyContent: 'center',
4952
padding: 16,
53+
shadowColor: SHADOW_COLOR_LIGHT,
54+
shadowOffset: { width: 0, height: 1 },
55+
shadowOpacity: 0.9,
56+
shadowRadius: 2,
5057
width: '100%',
5158
},
5259
mediaContainer: {

src/embedded/components/IterableEmbeddedBanner/IterableEmbeddedBanner.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ import {
1818
IMAGE_WIDTH,
1919
} from './IterableEmbeddedBanner.styles';
2020

21+
const noop = () => {};
22+
2123
/**
2224
* TODO: figure out how default action works.
2325
*/
2426

2527
export const IterableEmbeddedBanner = ({
2628
config,
2729
message,
28-
onButtonClick = () => {},
29-
onMessageClick = () => {},
30+
onButtonClick = noop,
31+
onMessageClick = noop,
3032
}: IterableEmbeddedComponentProps) => {
3133
const { parsedStyles, media, handleButtonClick, handleMessageClick } =
3234
useEmbeddedView(IterableEmbeddedViewType.Banner, {
@@ -51,7 +53,6 @@ export const IterableEmbeddedBanner = ({
5153
} as ViewStyle,
5254
]}
5355
>
54-
{}
5556
<View
5657
// eslint-disable-next-line react-native/no-inline-styles
5758
style={[styles.bodyContainer, { gap: media.shouldShow ? 16 : 0 }]}

0 commit comments

Comments
 (0)