start removing image carousel modal in the likelihood discord will be removing it soon

pull/95/head
dperolio 2 years ago
parent 7a7e05e82b
commit 3a4622121f
No known key found for this signature in database
GPG Key ID: 4191689562D51409

@ -1,33 +0,0 @@
/**
* Applies attributes to image carousel modals.
* @module ImageCarousel
* @memberof Builtin.Attributes.Components.Modals
*/
import { getModuleByDisplayName } from '@vizality/webpack';
import { patch, unpatch } from '@vizality/patcher';
import { findInTree } from '@vizality/util/react';
export const labels = [ 'Components', 'Modals', 'ImageCarousel' ];
export default builtin => {
(async () => {
const ModalCarousel = await getModuleByDisplayName('ModalCarousel', true)
patch('vz-attributes-modal-image-carousel', ModalCarousel?.prototype, 'render', (_, res) => {
try {
const ogRef = res.ref;
res.ref = elem => {
const r = ogRef(elem);
if (elem?._reactInternals) {
const container = findInTree(elem._reactInternals?.return, el => el?.stateNode?.setAttribute, { walkable: [ 'return' ] });
container?.stateNode?.parentElement?.setAttribute('vz-modal', 'image-carousel');
}
return r;
};
} catch (err) {
return builtin.error(builtin._labels.concat(labels), err);
}
});
})()
return () => unpatch('vz-attributes-modal-image-carousel');
};

@ -3,7 +3,6 @@ import { getModule, getModuleByDisplayName } from '@vizality/webpack';
import AsyncComponent from './AsyncComponent';
import { Icons } from './Icon';
export const ApplicationStoreListingCarousel = AsyncComponent.fromDisplayName('ApplicationStoreListingCarousel');
export const ImageCarouselModal = AsyncComponent.fromDisplayName('componentDispatchSubscriber(ModalCarousel)');
export const GIFPickerSearchResults = AsyncComponent.fromDisplayName('GIFPickerSearchResults');
export const DiscoverySidebarHeader = AsyncComponent.fetchFromProps('DiscoverySidebarHeader');

Loading…
Cancel
Save