Skip to content

Commit 9097428

Browse files
authored
Merge pull request #819 from Iterable/loren/embedded/SDK-245-banner-component-stretch
[SDK-245] banner-component
2 parents 7c4f984 + c72f9d1 commit 9097428

6 files changed

Lines changed: 579 additions & 32 deletions

File tree

src/embedded/components/IterableEmbeddedBanner.tsx

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import { StyleSheet, Platform } from 'react-native';
2+
3+
// See https://support.iterable.com/hc/en-us/articles/23230946708244-Out-of-the-Box-Views-for-Embedded-Messages#banners
4+
export const IMAGE_HEIGHT = Platform.OS === 'android' ? 80 : 100;
5+
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)';
8+
9+
export const styles = StyleSheet.create({
10+
body: {
11+
alignSelf: 'stretch',
12+
fontSize: 14,
13+
fontWeight: '400',
14+
lineHeight: 20,
15+
},
16+
bodyContainer: {
17+
alignItems: 'center',
18+
alignSelf: 'stretch',
19+
display: 'flex',
20+
flexDirection: 'row',
21+
paddingTop: 4,
22+
},
23+
button: {
24+
borderRadius: 32,
25+
gap: 8,
26+
},
27+
buttonContainer: {
28+
alignItems: 'flex-start',
29+
alignSelf: 'stretch',
30+
display: 'flex',
31+
flexDirection: 'row',
32+
gap: 12,
33+
width: '100%',
34+
},
35+
buttonText: {
36+
fontSize: 14,
37+
fontWeight: '400',
38+
lineHeight: 20,
39+
paddingHorizontal: 12,
40+
paddingVertical: 8,
41+
},
42+
container: {
43+
alignItems: 'flex-start',
44+
borderStyle: 'solid',
45+
boxShadow:
46+
`0 1px 1px 0 ${SHADOW_COLOR_LIGHT}, 0 0 2px 0 ${SHADOW_COLOR_LIGHT}, 0 0 1px 0 ${SHADOW_COLOR_DARK}`,
47+
display: 'flex',
48+
elevation: 1,
49+
flexDirection: 'column',
50+
gap: 16,
51+
justifyContent: 'center',
52+
padding: 16,
53+
shadowColor: SHADOW_COLOR_LIGHT,
54+
shadowOffset: { width: 0, height: 1 },
55+
shadowOpacity: 0.9,
56+
shadowRadius: 2,
57+
width: '100%',
58+
},
59+
mediaContainer: {
60+
alignItems: 'flex-start',
61+
alignSelf: 'stretch',
62+
display: 'flex',
63+
flexDirection: 'row',
64+
},
65+
mediaImage: {
66+
borderRadius: 6,
67+
borderStyle: 'solid',
68+
borderWidth: 1,
69+
height: IMAGE_HEIGHT,
70+
paddingHorizontal: 0,
71+
paddingVertical: 0,
72+
width: IMAGE_WIDTH,
73+
},
74+
textContainer: {
75+
alignSelf: 'center',
76+
display: 'flex',
77+
flexDirection: 'column',
78+
flexGrow: 1,
79+
flexShrink: 1,
80+
gap: 4,
81+
width: '100%',
82+
},
83+
title: {
84+
fontSize: 16,
85+
fontWeight: '700',
86+
lineHeight: 16,
87+
paddingBottom: 4,
88+
},
89+
});

0 commit comments

Comments
 (0)