@@ -14,7 +14,7 @@ const MAX_PAYLOAD_SIZE = 100 * 1024
1414 * @param {* } param0
1515 *
1616 */
17- function Media ( { setNoteMedia, mediaList = [ ] , style, className, disabled, noteId } ) {
17+ function Media ( { setNoteMedia, mediaList = [ ] , style, className, disabled, noteId, sizeData } ) {
1818 const { addMedia, removeMedia, getMediaById, getNoteById } = useContext ( NotesContext )
1919
2020 const limited = getNoteById ( noteId ) . media . length >= 3
@@ -79,23 +79,27 @@ function Media({ setNoteMedia, mediaList = [], style, className, disabled, noteI
7979
8080 { /**Форма media */ }
8181 < Modal { ...modalProps . bind ( ) } >
82- < div className = "p-1 d-flex flex-row flex- wrap justify -content-center align-items-center" >
82+ < div style = { { minHeight : ` ${ sizeData . current ? sizeData . current . parentElement . clientHeight : 100 } px` } } className = "p-1 d-flex flex-wrap align -content-between align-items-center justify-content -center" >
8383
84- < div className = "form-group container d-flex flex-row flex-wrap mb-0" >
85- { Array . isArray ( mediaList ) ? ( mediaList . map ( ( imgId , index ) => {
84+ < div className = "form-group container d-flex flex-row flex-wrap align-items-start mb-0" >
85+ { Array . isArray ( mediaList ) && mediaList . length ? ( mediaList . map ( ( imgId , index ) => {
8686 const media = getMediaById ( imgId )
8787 const src = typeof media === "object" && media && media . data
8888 return (
8989 < div className = "card p-1 m-1" key = { imgId } style = { { position : "relative" } } >
90- < img style = { { maxWidth : "8em " , maxHeight : "8em " } } src = { src } alt = "note img" > </ img >
90+ < img style = { { maxWidth : "13em " , maxHeight : "13em " } } src = { src } alt = "note img" > </ img >
9191 < button
9292 style = { { position : "absolute" , bottom : "0" , right : "0" , lineHeight : "1em" , padding : "0.05em" } }
9393 className = { `btn btn-danger m-1` }
9494 onClick = { ( ) => delImg ( imgId , index ) }
9595 > ✗</ button >
9696 </ div >
9797 )
98- } ) ) : null }
98+ } ) ) : (
99+ < div className = "p-1 m-1 text-center" style = { { minWidth : '100%' } } >
100+ No images
101+ </ div >
102+ ) }
99103 </ div >
100104
101105 < div className = "form-group container d-flex flex-wrap justify-content-between mb-0" >
0 commit comments