Show media modal on public pages (#6801)
This commit is contained in:
		
					parent
					
						
							
								1c15329cce
							
						
					
				
			
			
				commit
				
					
						ff7941e652
					
				
			
		
					 8 changed files with 178 additions and 116 deletions
				
			
		|  | @ -25,7 +25,6 @@ function main() { | |||
|   const { getLocale } = require('../mastodon/locales'); | ||||
|   const { localeData } = getLocale(); | ||||
|   const VideoContainer = require('../mastodon/containers/video_container').default; | ||||
|   const MediaGalleryContainer = require('../mastodon/containers/media_gallery_container').default; | ||||
|   const CardContainer = require('../mastodon/containers/card_container').default; | ||||
|   const React = require('react'); | ||||
|   const ReactDOM = require('react-dom'); | ||||
|  | @ -76,15 +75,20 @@ function main() { | |||
|       ReactDOM.render(<VideoContainer locale={locale} {...props} />, content); | ||||
|     }); | ||||
| 
 | ||||
|     [].forEach.call(document.querySelectorAll('[data-component="MediaGallery"]'), (content) => { | ||||
|       const props = JSON.parse(content.getAttribute('data-props')); | ||||
|       ReactDOM.render(<MediaGalleryContainer locale={locale} {...props} />, content); | ||||
|     }); | ||||
| 
 | ||||
|     [].forEach.call(document.querySelectorAll('[data-component="Card"]'), (content) => { | ||||
|       const props = JSON.parse(content.getAttribute('data-props')); | ||||
|       ReactDOM.render(<CardContainer locale={locale} {...props} />, content); | ||||
|     }); | ||||
| 
 | ||||
|     const mediaGalleries = document.querySelectorAll('[data-component="MediaGallery"]'); | ||||
| 
 | ||||
|     if (mediaGalleries.length > 0) { | ||||
|       const MediaGalleriesContainer = require('../mastodon/containers/media_galleries_container').default; | ||||
|       const content = document.createElement('div'); | ||||
| 
 | ||||
|       ReactDOM.render(<MediaGalleriesContainer locale={locale} galleries={mediaGalleries} />, content); | ||||
|       document.body.appendChild(content); | ||||
|     } | ||||
|   }); | ||||
| 
 | ||||
|   delegate(document, '.webapp-btn', 'click', ({ target, button }) => { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue