@@ -12,21 +12,15 @@ import {
12
12
Constants ,
13
13
Spacings
14
14
} from 'react-native-ui-lib' ;
15
+ import _ from 'lodash' ;
16
+
15
17
const KeyboardTrackingView = Keyboard . KeyboardTrackingView ;
16
18
17
- const URIs = [
18
- {
19
- uri :
20
- 'https://static.pexels.com/photos/50721/pencils-crayons-colourful-rainbow-50721.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260'
21
- } ,
22
- {
23
- uri :
24
- 'https://static.pexels.com/photos/60628/flower-garden-blue-sky-hokkaido-japan-60628.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260'
25
- } ,
26
- {
27
- uri :
28
- 'https://images.pexels.com/photos/140234/pexels-photo-140234.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260'
29
- }
19
+ const messages = [
20
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' ,
21
+ 'integer feugiat scelerisque varius morbi enim nunc faucibus a pellentesque sit amet porttitor eget dolor' ,
22
+ 'turpis cursus in hac habitasse' ,
23
+ 'neque gravida in fermentum et sollicitudin ac orci phasellus egestas'
30
24
] ;
31
25
32
26
export default class KeyboardTrackingViewScreen extends PureComponent {
@@ -40,6 +34,32 @@ export default class KeyboardTrackingViewScreen extends PureComponent {
40
34
} ) ;
41
35
} ;
42
36
37
+ renderChatBubbles ( ) {
38
+ return (
39
+ < View flex >
40
+ { _ . map ( messages , ( message , i ) => {
41
+ const isLeftBubble = i % 2 === 0 ;
42
+ return (
43
+ < View right = { ! isLeftBubble } >
44
+ < View
45
+ bg-blue40 = { isLeftBubble }
46
+ bg-white = { ! isLeftBubble }
47
+ br20
48
+ marginB-s4
49
+ padding-s2
50
+ width = { '70%' }
51
+ >
52
+ < Text white = { isLeftBubble } grey10 = { ! isLeftBubble } text80 >
53
+ { message }
54
+ </ Text >
55
+ </ View >
56
+ </ View >
57
+ ) ;
58
+ } ) }
59
+ </ View >
60
+ ) ;
61
+ }
62
+
43
63
render ( ) {
44
64
const { trackInteractive} = this . state ;
45
65
@@ -63,9 +83,7 @@ export default class KeyboardTrackingViewScreen extends PureComponent {
63
83
marginL-10
64
84
/>
65
85
</ View >
66
- { URIs . map ( ( uri , index ) => (
67
- < Image style = { styles . image } source = { uri } key = { index } />
68
- ) ) }
86
+ { this . renderChatBubbles ( ) }
69
87
</ ScrollView >
70
88
< KeyboardTrackingView
71
89
style = { styles . trackingToolbarContainer }
0 commit comments