File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function uploadTarget(path: string, file: { name: string }): string {
2020
2121export default function useUpload (
2222 editor : SlateEditor ,
23- body : JSX . Element
23+ body : JSX . Element ,
2424) : JSX . Element {
2525 const dropzoneRef = useRef < Dropzone > ( null ) ;
2626 const { actions, project_id, path } = useFrameContext ( ) ;
@@ -50,7 +50,7 @@ export default function useUpload(
5050 if ( file != null ) {
5151 const blob = file . slice ( 0 , - 1 , item . type ) ;
5252 dropzoneRef ?. current ?. addFile (
53- new File ( [ blob ] , `paste-${ Math . random ( ) } ` , { type : item . type } )
53+ new File ( [ blob ] , `paste-${ Math . random ( ) } ` , { type : item . type } ) ,
5454 ) ;
5555 }
5656 return ; // what if more than one ?
@@ -95,8 +95,6 @@ export default function useUpload(
9595 } ;
9696 } , [ ] ) ;
9797
98- // Note: using show_upload={false} since showing the upload right in the
99- // wysiwyg editor is really disconcerting.
10098 return (
10199 < FileUploadWrapper
102100 className = "smc-vfill"
Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ const CHUNK_SIZE_MB = 8;
3535
3636const TIMEOUT_S = 100 ;
3737
38+ const CLOSE_BUTTON_STYLE = {
39+ position : "absolute" ,
40+ right : 0 ,
41+ zIndex : 1 , // so it floats above text/markdown buttons
42+ background : "white" ,
43+ cursor : "pointer" ,
44+ } as const ;
45+
3846/*
3947CHUNK_SIZE_MB being set properly is critical for cloudflare to work --
4048we want this to be as big as possible, but MUST be smaller than
@@ -123,7 +131,7 @@ export const FileUpload: React.FC<FileUploadProps> = (props) => {
123131
124132 function render_close_button ( ) {
125133 return (
126- < div className = "close-button pull-right" >
134+ < div className = "close-button" style = { CLOSE_BUTTON_STYLE } >
127135 < span
128136 onClick = { props . close_button_onclick }
129137 className = "close-button-x"
@@ -311,7 +319,7 @@ export const FileUploadWrapper: React.FC<FileUploadWrapperProps> = (props) => {
311319
312320 return (
313321 < div style = { style } >
314- < div className = "close-button pull-right" >
322+ < div className = "close-button" style = { CLOSE_BUTTON_STYLE } >
315323 < span
316324 onClick = { ( ) => {
317325 close_preview ( ) ;
You can’t perform that action at this time.
0 commit comments