mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-20 00:18:45 +01:00
Poll create modal
This commit is contained in:
@@ -25,11 +25,19 @@ export type PropsType = {
|
||||
files: ReadonlyArray<File>;
|
||||
flags: number | null;
|
||||
}) => unknown;
|
||||
acceptMediaOnly?: boolean;
|
||||
testId?: string;
|
||||
};
|
||||
|
||||
export const CompositionUpload = forwardRef<HTMLInputElement, PropsType>(
|
||||
function CompositionUploadInner(
|
||||
{ conversationId, draftAttachments, processAttachments },
|
||||
{
|
||||
conversationId,
|
||||
draftAttachments,
|
||||
processAttachments,
|
||||
acceptMediaOnly,
|
||||
testId,
|
||||
},
|
||||
ref
|
||||
) {
|
||||
const onFileInputChange: ChangeEventHandler<
|
||||
@@ -48,13 +56,14 @@ export const CompositionUpload = forwardRef<HTMLInputElement, PropsType>(
|
||||
return isImageAttachment(attachment) || isVideoAttachment(attachment);
|
||||
});
|
||||
|
||||
const acceptContentTypes = anyVideoOrImageAttachments
|
||||
? [...getSupportedImageTypes(), ...getSupportedVideoTypes()]
|
||||
: null;
|
||||
const acceptContentTypes =
|
||||
acceptMediaOnly || anyVideoOrImageAttachments
|
||||
? [...getSupportedImageTypes(), ...getSupportedVideoTypes()]
|
||||
: null;
|
||||
|
||||
return (
|
||||
<input
|
||||
data-testid="attachfile-input"
|
||||
data-testid={testId ?? 'attachfile-input'}
|
||||
hidden
|
||||
multiple
|
||||
onChange={onFileInputChange}
|
||||
|
||||
Reference in New Issue
Block a user