diff --git a/ts/components/conversation/media-gallery/AttachmentSection.tsx b/ts/components/conversation/media-gallery/AttachmentSection.tsx index e1fc384f2..ef515293a 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.tsx @@ -48,7 +48,8 @@ export class AttachmentSection extends React.Component { private renderItems() { const { i18n, messages, type } = this.props; - return messages.map(message => { + return messages.map((message, index, array) => { + const isLast = index === array.length - 1; const { attachments } = message; const firstAttachment = attachments[0]; @@ -66,11 +67,12 @@ export class AttachmentSection extends React.Component { return ( ); default: diff --git a/ts/components/conversation/media-gallery/DocumentListItem.tsx b/ts/components/conversation/media-gallery/DocumentListItem.tsx index b8e83bcec..f73809af2 100644 --- a/ts/components/conversation/media-gallery/DocumentListItem.tsx +++ b/ts/components/conversation/media-gallery/DocumentListItem.tsx @@ -7,6 +7,7 @@ interface Props { fileName?: string | null; fileSize?: number; i18n: (key: string, values?: Array) => string; + isLast: boolean; onClick?: () => void; timestamp: number; } @@ -15,6 +16,8 @@ const styles = { container: { width: '100%', height: 72, + }, + containerSeparator: { borderBottomWidth: 1, borderBottomColor: '#ccc', borderBottomStyle: 'solid', @@ -78,6 +81,16 @@ export class DocumentListItem extends React.Component { } public render() { - return
{this.renderContent()}
; + const { isLast } = this.props; + return ( +
+ {this.renderContent()} +
+ ); } } diff --git a/ts/components/conversation/media-gallery/MediaGallery.md b/ts/components/conversation/media-gallery/MediaGallery.md index ee65d6cda..6a41ff7e2 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.md +++ b/ts/components/conversation/media-gallery/MediaGallery.md @@ -74,3 +74,14 @@ const messages = _.sortBy( ; ``` + +## Media gallery with one document + +```jsx +const messages = [ + { + attachments: [{ fileName: 'foo.jpg', contentType: 'application/json' }], + }, +]; +; +```