react-native-gifted-chat 2.8.2-alpha.6 → 2.9.0-alpha.0
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/README.md +26 -26
- package/package.json +2 -1
- package/src/Actions.tsx +1 -1
- package/src/Bubble/index.tsx +12 -14
- package/src/Bubble/styles.ts +1 -1
- package/src/Bubble/types.ts +4 -5
- package/src/Color.ts +1 -1
- package/src/Composer.tsx +1 -1
- package/src/Day/styles.ts +1 -1
- package/src/GiftedAvatar.tsx +1 -1
- package/src/GiftedChat/index.tsx +6 -38
- package/src/GiftedChat/types.ts +2 -2
- package/src/InputToolbar.tsx +22 -13
- package/src/LoadEarlierMessages.tsx +1 -1
- package/src/Message/index.tsx +6 -8
- package/src/MessageAudio.tsx +1 -1
- package/src/MessageContainer/components/DayAnimated/index.tsx +1 -3
- package/src/MessageContainer/components/Item/index.tsx +8 -10
- package/src/MessageContainer/index.tsx +4 -6
- package/src/MessageContainer/styles.ts +1 -1
- package/src/MessageVideo.tsx +1 -1
- package/src/QuickReplies.tsx +1 -1
- package/src/Send.tsx +1 -1
- package/src/SystemMessage.tsx +1 -1
- package/src/Time.tsx +5 -5
- package/src/TypingIndicator/index.tsx +1 -3
- package/src/TypingIndicator/styles.ts +1 -1
- package/src/__tests__/Actions.test.tsx +1 -1
- package/src/__tests__/Avatar.test.tsx +7 -2
- package/src/__tests__/Bubble.test.tsx +3 -7
- package/src/__tests__/Color.test.tsx +1 -1
- package/src/__tests__/Composer.test.tsx +1 -1
- package/src/__tests__/Day.test.tsx +3 -3
- package/src/__tests__/DayAnimated.test.tsx +5 -11
- package/src/__tests__/GiftedAvatar.test.tsx +1 -1
- package/src/__tests__/GiftedChat.test.tsx +1 -1
- package/src/__tests__/InputToolbar.test.tsx +1 -1
- package/src/__tests__/LoadEarlier.test.tsx +2 -2
- package/src/__tests__/Message.test.tsx +5 -11
- package/src/__tests__/MessageContainer.test.tsx +4 -4
- package/src/__tests__/MessageImage.test.tsx +2 -2
- package/src/__tests__/MessageText.test.tsx +3 -2
- package/src/__tests__/Send.test.tsx +1 -1
- package/src/__tests__/SystemMessage.test.tsx +1 -1
- package/src/__tests__/Time.test.tsx +1 -1
- package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +1 -1
- package/src/__tests__/__snapshots__/Day.test.tsx.snap +96 -2
- package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +1 -1
- package/src/__tests__/__snapshots__/Message.test.tsx.snap +41 -2
- package/src/__tests__/__snapshots__/MessageText.test.tsx.snap +1 -1
- package/src/__tests__/data.ts +1 -1
- package/src/index.ts +19 -1
- package/src/utils.ts +22 -1
package/src/MessageVideo.tsx
CHANGED
package/src/QuickReplies.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
ViewStyle,
|
|
8
8
|
TextStyle,
|
|
9
9
|
} from 'react-native'
|
|
10
|
-
import Color from './Color'
|
|
10
|
+
import { Color } from './Color'
|
|
11
11
|
import { TouchableOpacity } from './components/TouchableOpacity'
|
|
12
12
|
import { warning } from './logging'
|
|
13
13
|
import stylesCommon from './styles'
|
package/src/Send.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TextStyle,
|
|
9
9
|
useColorScheme,
|
|
10
10
|
} from 'react-native'
|
|
11
|
-
import Color from './Color'
|
|
11
|
+
import { Color } from './Color'
|
|
12
12
|
|
|
13
13
|
import { TouchableOpacity, TouchableOpacityProps } from './components/TouchableOpacity'
|
|
14
14
|
import { TEST_ID } from './Constant'
|
package/src/SystemMessage.tsx
CHANGED
package/src/Time.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
|
|
|
2
2
|
import { StyleSheet, Text, View, ViewStyle, TextStyle } from 'react-native'
|
|
3
3
|
import dayjs from 'dayjs'
|
|
4
4
|
|
|
5
|
-
import Color from './Color'
|
|
5
|
+
import { Color } from './Color'
|
|
6
6
|
import { TIME_FORMAT } from './Constant'
|
|
7
7
|
import { useChatContext } from './GiftedChatContext'
|
|
8
8
|
import { LeftRightStyle, IMessage } from './types'
|
|
@@ -51,23 +51,23 @@ export interface TimeProps<TMessage extends IMessage> {
|
|
|
51
51
|
timeFormat?: string
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export
|
|
54
|
+
export const Time = <TMessage extends IMessage = IMessage>({
|
|
55
55
|
position = 'left',
|
|
56
56
|
containerStyle,
|
|
57
57
|
currentMessage,
|
|
58
58
|
timeFormat = TIME_FORMAT,
|
|
59
59
|
timeTextStyle,
|
|
60
|
-
}: TimeProps<TMessage>) {
|
|
60
|
+
}: TimeProps<TMessage>) => {
|
|
61
61
|
const { getLocale } = useChatContext()
|
|
62
62
|
|
|
63
63
|
const formattedTime = useMemo(() => {
|
|
64
|
-
if (currentMessage
|
|
64
|
+
if (!currentMessage)
|
|
65
65
|
return null
|
|
66
66
|
|
|
67
67
|
return dayjs(currentMessage.createdAt).locale(getLocale()).format(timeFormat)
|
|
68
68
|
}, [currentMessage, getLocale, timeFormat])
|
|
69
69
|
|
|
70
|
-
if (currentMessage
|
|
70
|
+
if (!currentMessage)
|
|
71
71
|
return null
|
|
72
72
|
|
|
73
73
|
return (
|
|
@@ -89,7 +89,7 @@ const DotsAnimation = () => {
|
|
|
89
89
|
)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
const TypingIndicator = ({ isTyping, style }: TypingIndicatorProps) => {
|
|
92
|
+
export const TypingIndicator = ({ isTyping, style }: TypingIndicatorProps) => {
|
|
93
93
|
const yCoords = useSharedValue(200)
|
|
94
94
|
const heightScale = useSharedValue(0)
|
|
95
95
|
const marginScale = useSharedValue(0)
|
|
@@ -153,5 +153,3 @@ const TypingIndicator = ({ isTyping, style }: TypingIndicatorProps) => {
|
|
|
153
153
|
</Animated.View>
|
|
154
154
|
)
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
export default TypingIndicator
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { Actions } from '
|
|
4
|
+
import { Actions } from '..'
|
|
5
5
|
|
|
6
6
|
it('should render <Actions /> and compare with snapshot', () => {
|
|
7
7
|
const { toJSON } = render(<Actions />)
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { Avatar } from '
|
|
4
|
+
import { Avatar } from '..'
|
|
5
|
+
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
5
6
|
|
|
6
7
|
it('should render <Avatar /> and compare with snapshot', () => {
|
|
7
8
|
const { toJSON } = render(
|
|
8
|
-
<Avatar
|
|
9
|
+
<Avatar
|
|
10
|
+
renderAvatar={() => 'renderAvatar'}
|
|
11
|
+
position='left'
|
|
12
|
+
currentMessage={DEFAULT_TEST_MESSAGE}
|
|
13
|
+
/>
|
|
9
14
|
)
|
|
10
15
|
|
|
11
16
|
expect(toJSON()).toMatchSnapshot()
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { Bubble } from '
|
|
4
|
+
import { Bubble } from '..'
|
|
5
|
+
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
5
6
|
|
|
6
7
|
it('should render <Bubble /> and compare with snapshot', () => {
|
|
7
8
|
const { toJSON } = render(
|
|
8
9
|
<Bubble
|
|
9
10
|
user={{ _id: 1 }}
|
|
10
|
-
currentMessage={
|
|
11
|
-
_id: 1,
|
|
12
|
-
text: 'test',
|
|
13
|
-
createdAt: 1554744013721,
|
|
14
|
-
user: { _id: 1 },
|
|
15
|
-
}}
|
|
11
|
+
currentMessage={DEFAULT_TEST_MESSAGE}
|
|
16
12
|
position='left'
|
|
17
13
|
/>
|
|
18
14
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { Composer } from '
|
|
4
|
+
import { Composer } from '..'
|
|
5
5
|
|
|
6
6
|
it('should render <Composer /> and compare with snapshot', () => {
|
|
7
7
|
const { toJSON } = render(<Composer />)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { Day } from '
|
|
4
|
+
import { Day } from '..'
|
|
5
5
|
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
6
6
|
|
|
7
7
|
describe('Day', () => {
|
|
8
8
|
it('should not render <Day /> and compare with snapshot', () => {
|
|
9
|
-
const { toJSON } = render(<Day />)
|
|
9
|
+
const { toJSON } = render(<Day createdAt={DEFAULT_TEST_MESSAGE.createdAt} />)
|
|
10
10
|
|
|
11
11
|
expect(toJSON()).toMatchSnapshot()
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
it('should render <Day /> and compare with snapshot', () => {
|
|
15
15
|
const { toJSON } = render(
|
|
16
|
-
<Day
|
|
16
|
+
<Day createdAt={DEFAULT_TEST_MESSAGE.createdAt} />
|
|
17
17
|
)
|
|
18
18
|
expect(toJSON()).toMatchSnapshot()
|
|
19
19
|
})
|
|
@@ -2,19 +2,13 @@ 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 '../MessageContainer/components/DayAnimated'
|
|
5
|
+
import { DayAnimated } from '../MessageContainer/components/DayAnimated'
|
|
6
|
+
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
6
7
|
|
|
7
8
|
const mockDaysPositions = { value: {} }
|
|
8
9
|
const mockScrolledY = { value: 0 }
|
|
9
10
|
const mockListHeight = { value: 800 }
|
|
10
11
|
|
|
11
|
-
const mockMessage = {
|
|
12
|
-
_id: 1,
|
|
13
|
-
text: 'Hello',
|
|
14
|
-
createdAt: new Date('2023-01-01'),
|
|
15
|
-
user: { _id: 1, name: 'User 1' },
|
|
16
|
-
}
|
|
17
|
-
|
|
18
12
|
describe('DayAnimated', () => {
|
|
19
13
|
it('should render DayAnimated with default Day component', () => {
|
|
20
14
|
const { toJSON } = render(
|
|
@@ -22,7 +16,7 @@ describe('DayAnimated', () => {
|
|
|
22
16
|
scrolledY={mockScrolledY}
|
|
23
17
|
daysPositions={mockDaysPositions}
|
|
24
18
|
listHeight={mockListHeight}
|
|
25
|
-
messages={[
|
|
19
|
+
messages={[DEFAULT_TEST_MESSAGE]}
|
|
26
20
|
isLoading={false}
|
|
27
21
|
/>
|
|
28
22
|
)
|
|
@@ -32,7 +26,7 @@ describe('DayAnimated', () => {
|
|
|
32
26
|
it('should use custom renderDay when provided', () => {
|
|
33
27
|
const customRenderDay = jest.fn((props: DayProps) => (
|
|
34
28
|
<View testID='custom-day'>
|
|
35
|
-
<Text>Custom Day: {props.createdAt}</Text>
|
|
29
|
+
<Text>Custom Day: {props.createdAt.toLocaleString()}</Text>
|
|
36
30
|
</View>
|
|
37
31
|
))
|
|
38
32
|
|
|
@@ -41,7 +35,7 @@ describe('DayAnimated', () => {
|
|
|
41
35
|
scrolledY={mockScrolledY}
|
|
42
36
|
daysPositions={mockDaysPositions}
|
|
43
37
|
listHeight={mockListHeight}
|
|
44
|
-
messages={[
|
|
38
|
+
messages={[DEFAULT_TEST_MESSAGE]}
|
|
45
39
|
isLoading={false}
|
|
46
40
|
renderDay={customRenderDay}
|
|
47
41
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { GiftedAvatar } from '
|
|
4
|
+
import { GiftedAvatar } from '..'
|
|
5
5
|
|
|
6
6
|
it('should render <GiftedAvatar /> and compare with snapshot', () => {
|
|
7
7
|
const { toJSON } = render(<GiftedAvatar />)
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
4
|
import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller'
|
|
5
|
-
import { GiftedChat } from '
|
|
5
|
+
import { GiftedChat } from '..'
|
|
6
6
|
|
|
7
7
|
const messages = [
|
|
8
8
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { InputToolbar } from '
|
|
4
|
+
import { InputToolbar } from '..'
|
|
5
5
|
|
|
6
6
|
it('should render <InputToolbar /> and compare with snapshot', () => {
|
|
7
7
|
const { toJSON } = render(<InputToolbar />)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { LoadEarlierMessages } from '
|
|
4
|
+
import { LoadEarlierMessages } from '..'
|
|
5
5
|
|
|
6
6
|
it('should render <LoadEarlierMessages /> and compare with snapshot', () => {
|
|
7
|
-
const { toJSON } = render(<LoadEarlierMessages />)
|
|
7
|
+
const { toJSON } = render(<LoadEarlierMessages isAvailable isLoading={false} onPress={() => {}} />)
|
|
8
8
|
|
|
9
9
|
expect(toJSON()).toMatchSnapshot()
|
|
10
10
|
})
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { Message } from '
|
|
4
|
+
import { Message } from '..'
|
|
5
|
+
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
5
6
|
|
|
6
7
|
describe('Message component', () => {
|
|
7
8
|
it('should render <Message /> and compare with snapshot', () => {
|
|
@@ -35,12 +36,7 @@ describe('Message component', () => {
|
|
|
35
36
|
<Message
|
|
36
37
|
key='123'
|
|
37
38
|
user={{ _id: 1 }}
|
|
38
|
-
currentMessage={
|
|
39
|
-
_id: 1,
|
|
40
|
-
text: 'test',
|
|
41
|
-
createdAt: 1554744013721,
|
|
42
|
-
user: { _id: 1 },
|
|
43
|
-
}}
|
|
39
|
+
currentMessage={DEFAULT_TEST_MESSAGE}
|
|
44
40
|
position='left'
|
|
45
41
|
showUserAvatar
|
|
46
42
|
/>
|
|
@@ -55,12 +51,10 @@ describe('Message component', () => {
|
|
|
55
51
|
key='123'
|
|
56
52
|
user={{ _id: 1 }}
|
|
57
53
|
currentMessage={{
|
|
58
|
-
|
|
59
|
-
text: 'test',
|
|
60
|
-
createdAt: 1554744013721,
|
|
54
|
+
...DEFAULT_TEST_MESSAGE,
|
|
61
55
|
user: {
|
|
62
56
|
_id: 1,
|
|
63
|
-
avatar:
|
|
57
|
+
avatar: undefined,
|
|
64
58
|
},
|
|
65
59
|
}}
|
|
66
60
|
position='left'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { MessageContainer } from '
|
|
4
|
+
import { MessageContainer } from '..'
|
|
5
5
|
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
6
6
|
|
|
7
7
|
it('should render <MessageContainer /> without crashing', () => {
|
|
@@ -9,7 +9,7 @@ it('should render <MessageContainer /> without crashing', () => {
|
|
|
9
9
|
expect(() => render(
|
|
10
10
|
<MessageContainer
|
|
11
11
|
messages={[DEFAULT_TEST_MESSAGE]}
|
|
12
|
-
user={{ _id:
|
|
12
|
+
user={{ _id: 1 }}
|
|
13
13
|
/>
|
|
14
14
|
)).not.toThrow()
|
|
15
15
|
})
|
|
@@ -23,7 +23,7 @@ it('should render <MessageContainer /> with multiple messages', () => {
|
|
|
23
23
|
expect(() => render(
|
|
24
24
|
<MessageContainer
|
|
25
25
|
messages={messages}
|
|
26
|
-
user={{ _id:
|
|
26
|
+
user={{ _id: 1 }}
|
|
27
27
|
/>
|
|
28
28
|
)).not.toThrow()
|
|
29
29
|
})
|
|
@@ -32,7 +32,7 @@ it('should render <MessageContainer /> with empty messages', () => {
|
|
|
32
32
|
expect(() => render(
|
|
33
33
|
<MessageContainer
|
|
34
34
|
messages={[]}
|
|
35
|
-
user={{ _id:
|
|
35
|
+
user={{ _id: 1 }}
|
|
36
36
|
/>
|
|
37
37
|
)).not.toThrow()
|
|
38
38
|
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { MessageImage } from '
|
|
4
|
+
import { MessageImage } from '..'
|
|
5
5
|
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
6
6
|
|
|
7
7
|
describe('MessageImage', () => {
|
|
8
8
|
it('should not render <MessageImage /> and compare with snapshot', () => {
|
|
9
|
-
const { toJSON } = render(<MessageImage />)
|
|
9
|
+
const { toJSON } = render(<MessageImage currentMessage={null} />)
|
|
10
10
|
expect(toJSON()).toMatchSnapshot()
|
|
11
11
|
})
|
|
12
12
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react-native'
|
|
3
3
|
|
|
4
|
-
import { MessageText } from '
|
|
4
|
+
import { MessageText } from '..'
|
|
5
|
+
import { DEFAULT_TEST_MESSAGE } from './data'
|
|
5
6
|
|
|
6
7
|
it('should render <MessageText /> and compare with snapshot', () => {
|
|
7
8
|
const { toJSON } = render(
|
|
8
9
|
<MessageText
|
|
9
|
-
currentMessage={
|
|
10
|
+
currentMessage={DEFAULT_TEST_MESSAGE}
|
|
10
11
|
/>
|
|
11
12
|
)
|
|
12
13
|
|
|
@@ -1,5 +1,99 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Day should not render <Day /> and compare with snapshot 1`] = `
|
|
3
|
+
exports[`Day should not render <Day /> and compare with snapshot 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
[
|
|
7
|
+
{
|
|
8
|
+
"alignItems": "center",
|
|
9
|
+
"justifyContent": "center",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"marginBottom": 10,
|
|
13
|
+
"marginTop": 5,
|
|
14
|
+
},
|
|
15
|
+
undefined,
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
>
|
|
19
|
+
<View
|
|
20
|
+
style={
|
|
21
|
+
[
|
|
22
|
+
{
|
|
23
|
+
"backgroundColor": "rgba(0, 0, 0, 0.75)",
|
|
24
|
+
"borderRadius": 15,
|
|
25
|
+
"paddingBottom": 6,
|
|
26
|
+
"paddingLeft": 10,
|
|
27
|
+
"paddingRight": 10,
|
|
28
|
+
"paddingTop": 6,
|
|
29
|
+
},
|
|
30
|
+
undefined,
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
>
|
|
34
|
+
<Text
|
|
35
|
+
style={
|
|
36
|
+
[
|
|
37
|
+
{
|
|
38
|
+
"color": "#fff",
|
|
39
|
+
"fontSize": 12,
|
|
40
|
+
"fontWeight": "600",
|
|
41
|
+
},
|
|
42
|
+
undefined,
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
>
|
|
46
|
+
17 April 2022
|
|
47
|
+
</Text>
|
|
48
|
+
</View>
|
|
49
|
+
</View>
|
|
50
|
+
`;
|
|
4
51
|
|
|
5
|
-
exports[`Day should render <Day /> and compare with snapshot 1`] = `
|
|
52
|
+
exports[`Day should render <Day /> and compare with snapshot 1`] = `
|
|
53
|
+
<View
|
|
54
|
+
style={
|
|
55
|
+
[
|
|
56
|
+
{
|
|
57
|
+
"alignItems": "center",
|
|
58
|
+
"justifyContent": "center",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"marginBottom": 10,
|
|
62
|
+
"marginTop": 5,
|
|
63
|
+
},
|
|
64
|
+
undefined,
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
>
|
|
68
|
+
<View
|
|
69
|
+
style={
|
|
70
|
+
[
|
|
71
|
+
{
|
|
72
|
+
"backgroundColor": "rgba(0, 0, 0, 0.75)",
|
|
73
|
+
"borderRadius": 15,
|
|
74
|
+
"paddingBottom": 6,
|
|
75
|
+
"paddingLeft": 10,
|
|
76
|
+
"paddingRight": 10,
|
|
77
|
+
"paddingTop": 6,
|
|
78
|
+
},
|
|
79
|
+
undefined,
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
<Text
|
|
84
|
+
style={
|
|
85
|
+
[
|
|
86
|
+
{
|
|
87
|
+
"color": "#fff",
|
|
88
|
+
"fontSize": 12,
|
|
89
|
+
"fontWeight": "600",
|
|
90
|
+
},
|
|
91
|
+
undefined,
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
>
|
|
95
|
+
17 April 2022
|
|
96
|
+
</Text>
|
|
97
|
+
</View>
|
|
98
|
+
</View>
|
|
99
|
+
`;
|
|
@@ -362,7 +362,7 @@ exports[`Message component should render <Message /> with Avatar 1`] = `
|
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
364
|
>
|
|
365
|
-
|
|
365
|
+
12:00 AM
|
|
366
366
|
</Text>
|
|
367
367
|
</View>
|
|
368
368
|
</View>
|
|
@@ -396,6 +396,45 @@ exports[`Message component should render null if user has no Avatar 1`] = `
|
|
|
396
396
|
]
|
|
397
397
|
}
|
|
398
398
|
>
|
|
399
|
+
<View
|
|
400
|
+
style={
|
|
401
|
+
[
|
|
402
|
+
{
|
|
403
|
+
"marginRight": 8,
|
|
404
|
+
},
|
|
405
|
+
undefined,
|
|
406
|
+
undefined,
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
>
|
|
410
|
+
<View
|
|
411
|
+
accessibilityRole="image"
|
|
412
|
+
style={
|
|
413
|
+
[
|
|
414
|
+
{
|
|
415
|
+
"alignItems": "center",
|
|
416
|
+
"justifyContent": "center",
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"borderRadius": 20,
|
|
420
|
+
"height": 40,
|
|
421
|
+
"width": 40,
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"backgroundColor": "transparent",
|
|
425
|
+
},
|
|
426
|
+
[
|
|
427
|
+
{
|
|
428
|
+
"borderRadius": 18,
|
|
429
|
+
"height": 36,
|
|
430
|
+
"width": 36,
|
|
431
|
+
},
|
|
432
|
+
undefined,
|
|
433
|
+
],
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
/>
|
|
437
|
+
</View>
|
|
399
438
|
<View
|
|
400
439
|
style={
|
|
401
440
|
[
|
|
@@ -529,7 +568,7 @@ exports[`Message component should render null if user has no Avatar 1`] = `
|
|
|
529
568
|
]
|
|
530
569
|
}
|
|
531
570
|
>
|
|
532
|
-
|
|
571
|
+
12:00 AM
|
|
533
572
|
</Text>
|
|
534
573
|
</View>
|
|
535
574
|
</View>
|
package/src/__tests__/data.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
export * from './GiftedChat'
|
|
2
2
|
export * from './Constant'
|
|
3
|
-
export * from './utils'
|
|
3
|
+
export * as utils from './utils'
|
|
4
4
|
export * from './GiftedChatContext'
|
|
5
|
+
export * from './types'
|
|
6
|
+
export { Actions } from './Actions'
|
|
7
|
+
export { Avatar } from './Avatar'
|
|
8
|
+
export { Bubble } from './Bubble'
|
|
9
|
+
export { SystemMessage } from './SystemMessage'
|
|
10
|
+
export { MessageImage } from './MessageImage'
|
|
11
|
+
export { MessageText } from './MessageText'
|
|
12
|
+
export { Composer } from './Composer'
|
|
13
|
+
export { Day } from './Day'
|
|
14
|
+
export { InputToolbar } from './InputToolbar'
|
|
15
|
+
export { LoadEarlierMessages } from './LoadEarlierMessages'
|
|
16
|
+
export { Message } from './Message'
|
|
17
|
+
export { MessageContainer } from './MessageContainer'
|
|
18
|
+
export { Send } from './Send'
|
|
19
|
+
export { Time } from './Time'
|
|
20
|
+
export { GiftedAvatar } from './GiftedAvatar'
|
|
21
|
+
export { MessageAudio } from './MessageAudio'
|
|
22
|
+
export { MessageVideo } from './MessageVideo'
|