The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/modals/FileUploadModal/FileUploadModal.stories.js

28 lines
632 B

import { Box } from '@rocket.chat/fuselage';
import React, { useState } from 'react';
import FileUploadModal from '.';
export default {
title: 'components/modals/FileUploadModal',
component: FileUploadModal,
};
const onClose = () => console.log('close');
const _file = new File(['lol'], 'lol', { type: 'image' });
export const Default = () => {
const [file, setFile] = useState(_file);
const handleFile = (e) => {
console.log(e.target.files);
setFile(e.target.files[0]);
};
return (
<Box>
<Box is='input' type='file' onChange={handleFile} />
<FileUploadModal file={file} onClose={onClose} />
</Box>
);
};