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 {
20
20
21
21
export default function useUpload (
22
22
editor : SlateEditor ,
23
- body : JSX . Element
23
+ body : JSX . Element ,
24
24
) : JSX . Element {
25
25
const dropzoneRef = useRef < Dropzone > ( null ) ;
26
26
const { actions, project_id, path } = useFrameContext ( ) ;
@@ -50,7 +50,7 @@ export default function useUpload(
50
50
if ( file != null ) {
51
51
const blob = file . slice ( 0 , - 1 , item . type ) ;
52
52
dropzoneRef ?. current ?. addFile (
53
- new File ( [ blob ] , `paste-${ Math . random ( ) } ` , { type : item . type } )
53
+ new File ( [ blob ] , `paste-${ Math . random ( ) } ` , { type : item . type } ) ,
54
54
) ;
55
55
}
56
56
return ; // what if more than one ?
@@ -95,8 +95,6 @@ export default function useUpload(
95
95
} ;
96
96
} , [ ] ) ;
97
97
98
- // Note: using show_upload={false} since showing the upload right in the
99
- // wysiwyg editor is really disconcerting.
100
98
return (
101
99
< FileUploadWrapper
102
100
className = "smc-vfill"
Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ const CHUNK_SIZE_MB = 8;
35
35
36
36
const TIMEOUT_S = 100 ;
37
37
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
+
38
46
/*
39
47
CHUNK_SIZE_MB being set properly is critical for cloudflare to work --
40
48
we want this to be as big as possible, but MUST be smaller than
@@ -123,7 +131,7 @@ export const FileUpload: React.FC<FileUploadProps> = (props) => {
123
131
124
132
function render_close_button ( ) {
125
133
return (
126
- < div className = "close-button pull-right" >
134
+ < div className = "close-button" style = { CLOSE_BUTTON_STYLE } >
127
135
< span
128
136
onClick = { props . close_button_onclick }
129
137
className = "close-button-x"
@@ -311,7 +319,7 @@ export const FileUploadWrapper: React.FC<FileUploadWrapperProps> = (props) => {
311
319
312
320
return (
313
321
< div style = { style } >
314
- < div className = "close-button pull-right" >
322
+ < div className = "close-button" style = { CLOSE_BUTTON_STYLE } >
315
323
< span
316
324
onClick = { ( ) => {
317
325
close_preview ( ) ;
You can’t perform that action at this time.
0 commit comments