react-native-gifted-chat 3.0.0-alpha.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +295 -0
- package/README.md +12 -30
- package/package.json +1 -1
- package/src/Actions.tsx +27 -18
- package/src/Composer.tsx +60 -80
- package/src/Constant.ts +0 -9
- package/src/GiftedChat/index.tsx +13 -38
- package/src/GiftedChat/types.ts +8 -6
- package/src/InputToolbar.tsx +6 -11
- package/src/MessageImage.tsx +94 -57
- package/src/{MessageContainer → MessagesContainer}/components/Item/index.tsx +21 -17
- package/src/{MessageContainer → MessagesContainer}/components/Item/types.ts +3 -2
- package/src/{MessageContainer → MessagesContainer}/index.tsx +16 -14
- package/src/{MessageContainer → MessagesContainer}/types.ts +4 -2
- package/src/Send.tsx +40 -22
- package/src/__tests__/DayAnimated.test.tsx +1 -1
- package/src/__tests__/{MessageContainer.test.tsx → MessagesContainer.test.tsx} +7 -7
- package/src/__tests__/__snapshots__/Actions.test.tsx.snap +31 -23
- package/src/__tests__/__snapshots__/Composer.test.tsx.snap +39 -30
- package/src/__tests__/__snapshots__/Constant.test.tsx.snap +0 -2
- package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +112 -31
- package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +251 -0
- package/src/__tests__/__snapshots__/Send.test.tsx.snap +189 -49
- package/src/index.ts +1 -1
- package/src/styles.ts +5 -0
- package/src/types.ts +1 -1
- package/CHANGELOG_2.8.1_to_2.8.2-alpha.5.md +0 -374
- /package/src/{MessageContainer → MessagesContainer}/components/DayAnimated/index.tsx +0 -0
- /package/src/{MessageContainer → MessagesContainer}/components/DayAnimated/styles.ts +0 -0
- /package/src/{MessageContainer → MessagesContainer}/components/DayAnimated/types.ts +0 -0
- /package/src/{MessageContainer → MessagesContainer}/styles.ts +0 -0
|
@@ -103,6 +103,7 @@ export const Item = <TMessage extends IMessage>(props: ItemProps<TMessage>) => {
|
|
|
103
103
|
scrolledY,
|
|
104
104
|
daysPositions,
|
|
105
105
|
listHeight,
|
|
106
|
+
isDayAnimationEnabled,
|
|
106
107
|
...rest
|
|
107
108
|
} = props
|
|
108
109
|
|
|
@@ -121,23 +122,26 @@ export const Item = <TMessage extends IMessage>(props: ItemProps<TMessage>) => {
|
|
|
121
122
|
}, [dayContainerHeight])
|
|
122
123
|
|
|
123
124
|
const style = useAnimatedStyle(() => ({
|
|
124
|
-
opacity:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
125
|
+
opacity:
|
|
126
|
+
isDayAnimationEnabled
|
|
127
|
+
? interpolate(
|
|
128
|
+
relativeScrolledPositionToBottomOfDay.value,
|
|
129
|
+
[
|
|
130
|
+
-dayTopOffset,
|
|
131
|
+
-0.0001,
|
|
132
|
+
0,
|
|
133
|
+
dayContainerHeight.value + dayTopOffset,
|
|
134
|
+
],
|
|
135
|
+
[
|
|
136
|
+
0,
|
|
137
|
+
0,
|
|
138
|
+
1,
|
|
139
|
+
1,
|
|
140
|
+
],
|
|
141
|
+
'clamp'
|
|
142
|
+
)
|
|
143
|
+
: 1,
|
|
144
|
+
}), [relativeScrolledPositionToBottomOfDay, dayContainerHeight, dayTopOffset, isDayAnimationEnabled])
|
|
141
145
|
|
|
142
146
|
return (
|
|
143
147
|
// do not remove key. it helps to get correct position of the day container
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IMessage } from '../../../Models'
|
|
2
|
-
import {
|
|
2
|
+
import { MessagesContainerProps, DaysPositions } from '../../types'
|
|
3
3
|
|
|
4
|
-
export interface ItemProps<TMessage extends IMessage> extends
|
|
4
|
+
export interface ItemProps<TMessage extends IMessage> extends MessagesContainerProps<TMessage> {
|
|
5
5
|
currentMessage: TMessage
|
|
6
6
|
previousMessage?: TMessage
|
|
7
7
|
nextMessage?: TMessage
|
|
@@ -9,4 +9,5 @@ export interface ItemProps<TMessage extends IMessage> extends MessageContainerPr
|
|
|
9
9
|
scrolledY: { value: number }
|
|
10
10
|
daysPositions: { value: DaysPositions }
|
|
11
11
|
listHeight: { value: number }
|
|
12
|
+
isDayAnimationEnabled?: boolean
|
|
12
13
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
|
-
Pressable,
|
|
5
4
|
Text,
|
|
6
5
|
LayoutChangeEvent,
|
|
7
6
|
ListRenderItemInfo,
|
|
8
7
|
CellRendererProps,
|
|
9
8
|
} from 'react-native'
|
|
10
|
-
import { FlatList } from 'react-native-gesture-handler'
|
|
9
|
+
import { FlatList, Pressable } from 'react-native-gesture-handler'
|
|
11
10
|
import Animated, { runOnJS, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated'
|
|
12
11
|
import { LoadEarlierMessages } from '../LoadEarlierMessages'
|
|
13
12
|
import { warning } from '../logging'
|
|
@@ -21,14 +20,13 @@ import { DayAnimated } from './components/DayAnimated'
|
|
|
21
20
|
import { Item } from './components/Item'
|
|
22
21
|
import { ItemProps } from './components/Item/types'
|
|
23
22
|
import styles from './styles'
|
|
24
|
-
import {
|
|
23
|
+
import { MessagesContainerProps, DaysPositions } from './types'
|
|
25
24
|
|
|
26
25
|
export * from './types'
|
|
27
26
|
|
|
28
|
-
|
|
29
27
|
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) as React.ComponentType<any>
|
|
30
28
|
|
|
31
|
-
export const
|
|
29
|
+
export const MessagesContainer = <TMessage extends IMessage>(props: MessagesContainerProps<TMessage>) => {
|
|
32
30
|
const {
|
|
33
31
|
messages = [],
|
|
34
32
|
user,
|
|
@@ -47,6 +45,7 @@ export const MessageContainer = <TMessage extends IMessage>(props: MessageContai
|
|
|
47
45
|
forwardRef,
|
|
48
46
|
scrollToBottomComponent: scrollToBottomComponentProp,
|
|
49
47
|
renderDay: renderDayProp,
|
|
48
|
+
isDayAnimationEnabled = true,
|
|
50
49
|
} = props
|
|
51
50
|
|
|
52
51
|
const listPropsOnScrollProp = listProps?.onScroll
|
|
@@ -182,6 +181,7 @@ export const MessageContainer = <TMessage extends IMessage>(props: MessageContai
|
|
|
182
181
|
scrolledY,
|
|
183
182
|
daysPositions,
|
|
184
183
|
listHeight,
|
|
184
|
+
isDayAnimationEnabled,
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
return (
|
|
@@ -190,7 +190,7 @@ export const MessageContainer = <TMessage extends IMessage>(props: MessageContai
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
return null
|
|
193
|
-
}, [messages, restProps, isInverted, scrolledY, daysPositions, listHeight, user])
|
|
193
|
+
}, [messages, restProps, isInverted, scrolledY, daysPositions, listHeight, isDayAnimationEnabled, user])
|
|
194
194
|
|
|
195
195
|
const emptyContent = useMemo(() => {
|
|
196
196
|
if (!renderChatEmptyProp)
|
|
@@ -409,14 +409,16 @@ export const MessageContainer = <TMessage extends IMessage>(props: MessageContai
|
|
|
409
409
|
CellRendererComponent={renderCell}
|
|
410
410
|
/>
|
|
411
411
|
<ScrollToBottomWrapper />
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
412
|
+
{isDayAnimationEnabled && (
|
|
413
|
+
<DayAnimated
|
|
414
|
+
scrolledY={scrolledY}
|
|
415
|
+
daysPositions={daysPositions}
|
|
416
|
+
listHeight={listHeight}
|
|
417
|
+
renderDay={renderDayProp}
|
|
418
|
+
messages={messages}
|
|
419
|
+
isLoading={loadEarlierMessagesProps?.isLoading ?? false}
|
|
420
|
+
/>
|
|
421
|
+
)}
|
|
420
422
|
</View>
|
|
421
423
|
)
|
|
422
424
|
}
|
|
@@ -16,7 +16,7 @@ export type ListProps<TMessage extends IMessage = IMessage> = Partial<FlatListPr
|
|
|
16
16
|
|
|
17
17
|
export type AnimatedList<TMessage> = FlatList<TMessage>
|
|
18
18
|
|
|
19
|
-
export interface
|
|
19
|
+
export interface MessagesContainerProps<TMessage extends IMessage = IMessage>
|
|
20
20
|
extends Omit<TypingIndicatorProps, 'style'> {
|
|
21
21
|
/** Ref for the FlatList message container */
|
|
22
22
|
forwardRef?: RefObject<AnimatedList<TMessage>>
|
|
@@ -39,7 +39,7 @@ export interface MessageContainerProps<TMessage extends IMessage = IMessage>
|
|
|
39
39
|
/** Custom component to render when messages are empty */
|
|
40
40
|
renderChatEmpty?: () => React.ReactNode
|
|
41
41
|
/** Custom footer component on the ListView, e.g. 'User is typing...' */
|
|
42
|
-
renderFooter?: (props:
|
|
42
|
+
renderFooter?: (props: MessagesContainerProps<TMessage>) => React.ReactNode
|
|
43
43
|
/** Custom message container */
|
|
44
44
|
renderMessage?: (props: MessageProps<TMessage>) => React.ReactElement
|
|
45
45
|
/** Custom day above a message */
|
|
@@ -56,6 +56,8 @@ export interface MessageContainerProps<TMessage extends IMessage = IMessage>
|
|
|
56
56
|
loadEarlierMessagesProps?: LoadEarlierMessagesProps
|
|
57
57
|
/** Style for TypingIndicator component */
|
|
58
58
|
typingIndicatorStyle?: StyleProp<ViewStyle>
|
|
59
|
+
/** Enable animated day label that appears on scroll; default is true */
|
|
60
|
+
isDayAnimationEnabled?: boolean
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
export interface State {
|
package/src/Send.tsx
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import React, { useMemo, useCallback } from 'react'
|
|
1
|
+
import React, { useMemo, useCallback, useEffect } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
StyleSheet,
|
|
4
4
|
Text,
|
|
5
|
-
View,
|
|
6
5
|
StyleProp,
|
|
7
6
|
ViewStyle,
|
|
8
7
|
TextStyle,
|
|
9
8
|
useColorScheme,
|
|
10
9
|
} from 'react-native'
|
|
10
|
+
import Animated, { useSharedValue, useAnimatedStyle, withTiming } from 'react-native-reanimated'
|
|
11
11
|
import { Color } from './Color'
|
|
12
12
|
|
|
13
13
|
import { TouchableOpacity, TouchableOpacityProps } from './components/TouchableOpacity'
|
|
14
14
|
import { TEST_ID } from './Constant'
|
|
15
15
|
import { IMessage } from './Models'
|
|
16
|
+
import { getColorSchemeStyle } from './styles'
|
|
16
17
|
|
|
17
18
|
export interface SendProps<TMessage extends IMessage> {
|
|
18
19
|
text?: string
|
|
@@ -39,6 +40,7 @@ export const Send = <TMessage extends IMessage = IMessage>({
|
|
|
39
40
|
onSend,
|
|
40
41
|
}: SendProps<TMessage>) => {
|
|
41
42
|
const colorScheme = useColorScheme()
|
|
43
|
+
const opacity = useSharedValue(0)
|
|
42
44
|
|
|
43
45
|
const handleOnPress = useCallback(() => {
|
|
44
46
|
const message = { text: text?.trim() } as Partial<TMessage>
|
|
@@ -47,34 +49,51 @@ export const Send = <TMessage extends IMessage = IMessage>({
|
|
|
47
49
|
onSend(message, true)
|
|
48
50
|
}, [text, onSend])
|
|
49
51
|
|
|
50
|
-
const
|
|
52
|
+
const isVisible = useMemo(
|
|
51
53
|
() => isSendButtonAlwaysVisible || !!text?.trim().length,
|
|
52
54
|
[isSendButtonAlwaysVisible, text]
|
|
53
55
|
)
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
opacity.value = withTiming(isVisible ? 1 : 0, { duration: 200 })
|
|
59
|
+
}, [isVisible, opacity])
|
|
60
|
+
|
|
61
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
62
|
+
opacity: opacity.value,
|
|
63
|
+
}), [opacity])
|
|
57
64
|
|
|
58
65
|
return (
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
<Animated.View style={[styles.container, containerStyle, animatedStyle]} pointerEvents={isVisible ? 'auto' : 'none'}>
|
|
67
|
+
<TouchableOpacity
|
|
68
|
+
testID={TEST_ID.SEND_TOUCHABLE}
|
|
69
|
+
style={styles.touchable}
|
|
70
|
+
onPress={handleOnPress}
|
|
71
|
+
accessible
|
|
72
|
+
accessibilityLabel='send'
|
|
73
|
+
accessibilityRole='button'
|
|
74
|
+
{...sendButtonProps}
|
|
75
|
+
>
|
|
76
|
+
{
|
|
77
|
+
children ||
|
|
78
|
+
<Text
|
|
79
|
+
style={[
|
|
80
|
+
getColorSchemeStyle(styles, 'text', colorScheme),
|
|
81
|
+
textStyle,
|
|
82
|
+
]}
|
|
83
|
+
>
|
|
84
|
+
{label}
|
|
85
|
+
</Text>
|
|
86
|
+
}
|
|
87
|
+
</TouchableOpacity>
|
|
88
|
+
</Animated.View>
|
|
72
89
|
)
|
|
73
90
|
}
|
|
74
91
|
|
|
75
92
|
const styles = StyleSheet.create({
|
|
76
93
|
container: {
|
|
77
|
-
|
|
94
|
+
justifyContent: 'flex-end',
|
|
95
|
+
},
|
|
96
|
+
touchable: {
|
|
78
97
|
justifyContent: 'flex-end',
|
|
79
98
|
},
|
|
80
99
|
text: {
|
|
@@ -82,9 +101,8 @@ const styles = StyleSheet.create({
|
|
|
82
101
|
fontWeight: '600',
|
|
83
102
|
fontSize: 17,
|
|
84
103
|
backgroundColor: Color.backgroundTransparent,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
marginRight: 10,
|
|
104
|
+
paddingVertical: 10,
|
|
105
|
+
paddingHorizontal: 10,
|
|
88
106
|
},
|
|
89
107
|
text_dark: {
|
|
90
108
|
color: '#4da6ff',
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { View, Text } from 'react-native'
|
|
3
3
|
import { render } from '@testing-library/react-native'
|
|
4
4
|
import { DayProps } from '../Day'
|
|
5
|
-
import { DayAnimated } from '../
|
|
5
|
+
import { DayAnimated } from '../MessagesContainer/components/DayAnimated'
|
|
6
6
|
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
7
7
|
|
|
8
8
|
const mockDaysPositions = { value: {} }
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { MessagesContainer } from '..'
|
|
5
5
|
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
6
6
|
|
|
7
|
-
it('should render <
|
|
7
|
+
it('should render <MessagesContainer /> without crashing', () => {
|
|
8
8
|
// Just verify it renders without throwing
|
|
9
9
|
expect(() => render(
|
|
10
|
-
<
|
|
10
|
+
<MessagesContainer
|
|
11
11
|
messages={[DEFAULT_TEST_MESSAGE]}
|
|
12
12
|
user={{ _id: 1 }}
|
|
13
13
|
/>
|
|
14
14
|
)).not.toThrow()
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
it('should render <
|
|
17
|
+
it('should render <MessagesContainer /> with multiple messages', () => {
|
|
18
18
|
const messages = [
|
|
19
19
|
{ ...DEFAULT_TEST_MESSAGE, _id: 'test1' },
|
|
20
20
|
{ ...DEFAULT_TEST_MESSAGE, _id: 'test2' },
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
expect(() => render(
|
|
24
|
-
<
|
|
24
|
+
<MessagesContainer
|
|
25
25
|
messages={messages}
|
|
26
26
|
user={{ _id: 1 }}
|
|
27
27
|
/>
|
|
28
28
|
)).not.toThrow()
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
-
it('should render <
|
|
31
|
+
it('should render <MessagesContainer /> with empty messages', () => {
|
|
32
32
|
expect(() => render(
|
|
33
|
-
<
|
|
33
|
+
<MessagesContainer
|
|
34
34
|
messages={[]}
|
|
35
35
|
user={{ _id: 1 }}
|
|
36
36
|
/>
|
|
@@ -2,31 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`should render <Actions /> and compare with snapshot 1`] = `
|
|
4
4
|
<View
|
|
5
|
-
|
|
5
|
+
style={
|
|
6
6
|
{
|
|
7
|
-
"
|
|
8
|
-
"checked": undefined,
|
|
9
|
-
"disabled": false,
|
|
10
|
-
"expanded": undefined,
|
|
11
|
-
"selected": undefined,
|
|
7
|
+
"alignItems": "flex-end",
|
|
12
8
|
}
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
>
|
|
11
|
+
<View
|
|
12
|
+
accessibilityState={
|
|
13
|
+
{
|
|
14
|
+
"busy": undefined,
|
|
15
|
+
"checked": undefined,
|
|
16
|
+
"disabled": false,
|
|
17
|
+
"expanded": undefined,
|
|
18
|
+
"selected": undefined,
|
|
19
|
+
}
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
accessibilityValue={
|
|
22
|
+
{
|
|
23
|
+
"max": undefined,
|
|
24
|
+
"min": undefined,
|
|
25
|
+
"now": undefined,
|
|
26
|
+
"text": undefined,
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
accessible={true}
|
|
30
|
+
focusable={true}
|
|
31
|
+
onClick={[Function]}
|
|
32
|
+
onResponderGrant={[Function]}
|
|
33
|
+
onResponderMove={[Function]}
|
|
34
|
+
onResponderRelease={[Function]}
|
|
35
|
+
onResponderTerminate={[Function]}
|
|
36
|
+
onResponderTerminationRequest={[Function]}
|
|
37
|
+
onStartShouldSetResponder={[Function]}
|
|
38
|
+
/>
|
|
39
|
+
</View>
|
|
32
40
|
`;
|
|
@@ -1,36 +1,45 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`should render <Composer /> and compare with snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
accessibilityLabel="Type a message..."
|
|
6
|
-
accessible={true}
|
|
7
|
-
enablesReturnKeyAutomatically={true}
|
|
8
|
-
keyboardAppearance="default"
|
|
9
|
-
multiline={true}
|
|
10
|
-
onContentSizeChange={[Function]}
|
|
11
|
-
placeholder="Type a message..."
|
|
12
|
-
placeholderTextColor="#b2b2b2"
|
|
4
|
+
<View
|
|
13
5
|
style={
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"fontSize": 16,
|
|
20
|
-
"lineHeight": 22,
|
|
21
|
-
"marginBottom": 5,
|
|
22
|
-
"marginLeft": 10,
|
|
23
|
-
"marginTop": 6,
|
|
24
|
-
},
|
|
25
|
-
undefined,
|
|
26
|
-
undefined,
|
|
27
|
-
{
|
|
28
|
-
"height": 33,
|
|
29
|
-
},
|
|
30
|
-
]
|
|
6
|
+
{
|
|
7
|
+
"flex": 1,
|
|
8
|
+
}
|
|
31
9
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
10
|
+
>
|
|
11
|
+
<TextInput
|
|
12
|
+
accessibilityLabel="Type a message..."
|
|
13
|
+
accessible={true}
|
|
14
|
+
enablesReturnKeyAutomatically={true}
|
|
15
|
+
keyboardAppearance="default"
|
|
16
|
+
multiline={true}
|
|
17
|
+
onChange={[Function]}
|
|
18
|
+
placeholder="Type a message..."
|
|
19
|
+
placeholderTextColor="#b2b2b2"
|
|
20
|
+
style={
|
|
21
|
+
[
|
|
22
|
+
[
|
|
23
|
+
{
|
|
24
|
+
"fontSize": 16,
|
|
25
|
+
"lineHeight": 22,
|
|
26
|
+
"paddingBottom": 10,
|
|
27
|
+
"paddingTop": 8,
|
|
28
|
+
},
|
|
29
|
+
undefined,
|
|
30
|
+
],
|
|
31
|
+
{
|
|
32
|
+
"outlineStyle": "none",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"height": undefined,
|
|
36
|
+
},
|
|
37
|
+
undefined,
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
testID="Type a message..."
|
|
41
|
+
underlineColorAndroid="transparent"
|
|
42
|
+
value=""
|
|
43
|
+
/>
|
|
44
|
+
</View>
|
|
36
45
|
`;
|
|
@@ -4,12 +4,14 @@ exports[`should render <InputToolbar /> and compare with snapshot 1`] = `
|
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
6
|
[
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
[
|
|
8
|
+
{
|
|
9
|
+
"backgroundColor": "#fff",
|
|
10
|
+
"borderTopColor": "#b2b2b2",
|
|
11
|
+
"borderTopWidth": 0.5,
|
|
12
|
+
},
|
|
13
|
+
undefined,
|
|
14
|
+
],
|
|
13
15
|
undefined,
|
|
14
16
|
]
|
|
15
17
|
}
|
|
@@ -17,46 +19,125 @@ exports[`should render <InputToolbar /> and compare with snapshot 1`] = `
|
|
|
17
19
|
<View
|
|
18
20
|
style={
|
|
19
21
|
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
[
|
|
23
|
+
{
|
|
24
|
+
"alignItems": "flex-end",
|
|
25
|
+
"flexDirection": "row",
|
|
26
|
+
},
|
|
27
|
+
undefined,
|
|
28
|
+
],
|
|
24
29
|
undefined,
|
|
25
30
|
]
|
|
26
31
|
}
|
|
27
32
|
>
|
|
28
|
-
<
|
|
29
|
-
accessibilityLabel="Type a message..."
|
|
30
|
-
accessible={true}
|
|
31
|
-
enablesReturnKeyAutomatically={true}
|
|
32
|
-
keyboardAppearance="default"
|
|
33
|
-
multiline={true}
|
|
34
|
-
onContentSizeChange={[Function]}
|
|
35
|
-
placeholder="Type a message..."
|
|
36
|
-
placeholderTextColor="#b2b2b2"
|
|
33
|
+
<View
|
|
37
34
|
style={
|
|
35
|
+
{
|
|
36
|
+
"flex": 1,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
>
|
|
40
|
+
<TextInput
|
|
41
|
+
accessibilityLabel="Type a message..."
|
|
42
|
+
accessible={true}
|
|
43
|
+
enablesReturnKeyAutomatically={true}
|
|
44
|
+
keyboardAppearance="default"
|
|
45
|
+
multiline={true}
|
|
46
|
+
onChange={[Function]}
|
|
47
|
+
placeholder="Type a message..."
|
|
48
|
+
placeholderTextColor="#b2b2b2"
|
|
49
|
+
style={
|
|
50
|
+
[
|
|
51
|
+
[
|
|
52
|
+
{
|
|
53
|
+
"fontSize": 16,
|
|
54
|
+
"lineHeight": 22,
|
|
55
|
+
"paddingBottom": 10,
|
|
56
|
+
"paddingTop": 8,
|
|
57
|
+
},
|
|
58
|
+
undefined,
|
|
59
|
+
],
|
|
60
|
+
{
|
|
61
|
+
"outlineStyle": "none",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"height": undefined,
|
|
65
|
+
},
|
|
66
|
+
undefined,
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
testID="Type a message..."
|
|
70
|
+
underlineColorAndroid="transparent"
|
|
71
|
+
value=""
|
|
72
|
+
/>
|
|
73
|
+
</View>
|
|
74
|
+
<View
|
|
75
|
+
collapsable={false}
|
|
76
|
+
jestAnimatedProps={
|
|
77
|
+
{
|
|
78
|
+
"value": {},
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
jestAnimatedStyle={
|
|
82
|
+
{
|
|
83
|
+
"value": {
|
|
84
|
+
"opacity": 0,
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
jestInlineStyle={
|
|
38
89
|
[
|
|
39
90
|
{
|
|
40
|
-
"
|
|
91
|
+
"justifyContent": "flex-end",
|
|
41
92
|
},
|
|
93
|
+
undefined,
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
pointerEvents="none"
|
|
97
|
+
style={
|
|
98
|
+
[
|
|
42
99
|
{
|
|
43
|
-
"
|
|
44
|
-
"lineHeight": 22,
|
|
45
|
-
"marginBottom": 5,
|
|
46
|
-
"marginLeft": 10,
|
|
47
|
-
"marginTop": 6,
|
|
100
|
+
"justifyContent": "flex-end",
|
|
48
101
|
},
|
|
49
102
|
undefined,
|
|
50
|
-
undefined,
|
|
51
103
|
{
|
|
52
|
-
"
|
|
104
|
+
"opacity": 0,
|
|
53
105
|
},
|
|
54
106
|
]
|
|
55
107
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
108
|
+
>
|
|
109
|
+
<View
|
|
110
|
+
accessibilityLabel="send"
|
|
111
|
+
accessibilityRole="button"
|
|
112
|
+
accessibilityState={
|
|
113
|
+
{
|
|
114
|
+
"busy": undefined,
|
|
115
|
+
"checked": undefined,
|
|
116
|
+
"disabled": false,
|
|
117
|
+
"expanded": undefined,
|
|
118
|
+
"selected": undefined,
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
accessibilityValue={
|
|
122
|
+
{
|
|
123
|
+
"max": undefined,
|
|
124
|
+
"min": undefined,
|
|
125
|
+
"now": undefined,
|
|
126
|
+
"text": undefined,
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
accessible={true}
|
|
130
|
+
focusable={true}
|
|
131
|
+
onClick={[Function]}
|
|
132
|
+
onResponderGrant={[Function]}
|
|
133
|
+
onResponderMove={[Function]}
|
|
134
|
+
onResponderRelease={[Function]}
|
|
135
|
+
onResponderTerminate={[Function]}
|
|
136
|
+
onResponderTerminationRequest={[Function]}
|
|
137
|
+
onStartShouldSetResponder={[Function]}
|
|
138
|
+
testID="GC_SEND_TOUCHABLE"
|
|
139
|
+
/>
|
|
140
|
+
</View>
|
|
60
141
|
</View>
|
|
61
142
|
</View>
|
|
62
143
|
`;
|