|
|
|
@ -16,6 +16,7 @@ import {
|
|
|
|
|
removeStagedAttachmentInConversation,
|
|
|
|
|
} from '../../state/ducks/stagedAttachments';
|
|
|
|
|
import { getSelectedConversationKey } from '../../state/selectors/conversations';
|
|
|
|
|
import styled from 'styled-components';
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
attachments: Array<AttachmentType>;
|
|
|
|
@ -26,6 +27,17 @@ type Props = {
|
|
|
|
|
const IMAGE_WIDTH = 120;
|
|
|
|
|
const IMAGE_HEIGHT = 120;
|
|
|
|
|
|
|
|
|
|
const StyledRail = styled.div`
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
margin-inline-start: 16px;
|
|
|
|
|
padding-inline-end: 16px;
|
|
|
|
|
overflow-x: scroll;
|
|
|
|
|
max-height: 142px;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
overflow-y: hidden;
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StagedAttachmentList = (props: Props) => {
|
|
|
|
|
const { attachments, onAddAttachment, onClickAttachment } = props;
|
|
|
|
|
|
|
|
|
@ -63,7 +75,7 @@ export const StagedAttachmentList = (props: Props) => {
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
|
|
|
|
<div className="module-attachments__rail">
|
|
|
|
|
<StyledRail>
|
|
|
|
|
{(attachments || []).map((attachment, index) => {
|
|
|
|
|
const { contentType } = attachment;
|
|
|
|
|
if (isImageTypeSupported(contentType) || isVideoTypeSupported(contentType)) {
|
|
|
|
@ -103,7 +115,7 @@ export const StagedAttachmentList = (props: Props) => {
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
{allVisualAttachments ? <StagedPlaceholderAttachment onClick={onAddAttachment} /> : null}
|
|
|
|
|
</div>
|
|
|
|
|
</StyledRail>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|