Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
275 changes: 0 additions & 275 deletions __tests__/__snapshots__/Storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29093,281 +29093,6 @@ exports[`Storyshots Message list message 1`] = `
</View>
</View>
</View>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
>
<View>
<View
style={
Array [
Object {
"flexDirection": "column",
"paddingHorizontal": 14,
"paddingVertical": 4,
"width": "100%",
},
undefined,
]
}
>
<View
style={
Object {
"flexDirection": "row",
}
}
>
<View
style={
Array [
Object {
"borderRadius": 4,
"height": 36,
"width": 36,
},
Object {
"marginTop": 4,
},
]
}
>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 4,
"height": 36,
"width": 36,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"headers": undefined,
"priority": "high",
"uri": "https://open.rocket.chat/avatar/diego.mello?format=png&size=36",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
</View>
<View
style={
Array [
Object {
"flex": 1,
"marginLeft": 46,
},
Object {
"marginLeft": 10,
},
]
}
>
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"opacity": 1,
}
}
>
<Text
numberOfLines={1}
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 16,
"fontWeight": "500",
"lineHeight": 22,
"textAlign": "left",
},
Object {
"color": "#0d0e12",
},
]
}
>
diego.mello
</Text>
</View>
<Text
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 12,
"fontWeight": "400",
"marginLeft": 8,
"textAlign": "left",
},
Object {
"color": "#9ca2a8",
},
]
}
>
10:00 AM
</Text>
</View>
<View>
<Text
numberOfLines={0}
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 16,
"fontWeight": "400",
"textAlign": "left",
},
undefined,
Object {
"color": "#2f343d",
},
]
}
>
<Text
accessibilityLabel="Image should not render"
numberOfLines={0}
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 16,
"fontWeight": "400",
"textAlign": "left",
},
Array [
Object {},
Object {
"alignItems": "flex-start",
"flexDirection": "row",
"flexWrap": "wrap",
"justifyContent": "flex-start",
"marginBottom": 0,
"marginTop": 0,
},
],
]
}
>
Image should not render
</Text>
</Text>
</View>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "#f3f4f5",
"borderColor": "#e1e5e8",
"borderRadius": 4,
"borderWidth": 1,
"flex": 1,
"flexDirection": "row",
"marginTop": 6,
"opacity": 1,
}
}
>
<View
style={
Object {
"borderRadius": 4,
"flex": 1,
"flexDirection": "column",
"padding": 15,
}
}
/>
</View>
</View>
</View>
</View>
</View>
</View>
<Text
style={
Array [
Expand Down
6 changes: 3 additions & 3 deletions app/containers/message/Attachments.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const Attachments = React.memo(({
}

return attachments.map((file, index) => {
if (file.type === 'file' && file.image_url) {
if (file.image_url) {
return <Image key={file.image_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
}
if (file.type === 'file' && file.audio_url) {
if (file.audio_url) {
return <Audio key={file.audio_url} file={file} getCustomEmoji={getCustomEmoji} theme={theme} />;
}
if (file.type === 'file' && file.video_url) {
if (file.video_url) {
return <Video key={file.video_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
}

Expand Down
31 changes: 8 additions & 23 deletions storybook/stories/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,21 +346,13 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
image_url: '/dummypath',
type: 'file'
image_url: '/dummypath'
}]}
/>
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
image_url: '/dummypath',
type: 'file'
}]}
/>
<Message
msg='Image should not render'
attachments={[{
image_url: '/dummypath'
}]}
/>
Expand All @@ -370,15 +362,13 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
video_url: '/dummypath',
type: 'file'
video_url: '/dummypath'
}]}
/>
<Message
attachments={[{
title: 'This is a title',
video_url: '/dummypath',
type: 'file'
video_url: '/dummypath'
}]}
/>

Expand All @@ -387,33 +377,29 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
/>
<Message msg='First message' isHeader={false} />
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
isHeader={false}
/>
<Message
attachments={[{
title: 'This is a title',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
isHeader={false}
/>
<Message
attachments={[{
title: 'This is a title',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
isHeader={false}
/>
Expand Down Expand Up @@ -579,8 +565,7 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac',
type: 'file'
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
tmid='1'
isThreadSequential
Expand Down