Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3298524
D9359.id31658.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9359.id31658.diff
View Options
diff --git a/native/components/full-screen-view-modal.react.js b/native/components/full-screen-view-modal.react.js
--- a/native/components/full-screen-view-modal.react.js
+++ b/native/components/full-screen-view-modal.react.js
@@ -24,7 +24,6 @@
import SWMansionIcon from './swmansion-icon.react.js';
import ConnectedStatusBar from '../connected-status-bar.react.js';
-import Multimedia from '../media/multimedia.react.js';
import {
useIntentionalSaveMedia,
type IntentionalSaveMedia,
@@ -147,6 +146,7 @@
type BaseProps = {
+navigation: AppNavigationProp<'ImageModal'>,
+route: NavigationRoute<'ImageModal'>,
+ +children: React.Node,
};
type Props = {
...BaseProps,
@@ -1009,7 +1009,6 @@
}
render() {
- const { mediaInfo } = this.props.route.params;
const statusBar = FullScreenViewModal.isActive(this.props) ? (
<ConnectedStatusBar hidden />
) : null;
@@ -1041,7 +1040,7 @@
<Animated.View style={[styles.backdrop, backdropStyle]} />
<View style={this.contentContainerStyle}>
<Animated.View style={this.imageContainerStyle}>
- <Multimedia mediaInfo={mediaInfo} spinnerColor="white" />
+ {this.props.children}
</Animated.View>
</View>
<SafeAreaView style={styles.buttonsOverlay}>
diff --git a/native/media/image-modal.react.js b/native/media/image-modal.react.js
--- a/native/media/image-modal.react.js
+++ b/native/media/image-modal.react.js
@@ -4,6 +4,7 @@
import { type MediaInfo } from 'lib/types/media-types.js';
+import Multimedia from './multimedia.react.js';
import FullScreenViewModal from '../components/full-screen-view-modal.react.js';
import type { AppNavigationProp } from '../navigation/app-navigator.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
@@ -29,7 +30,16 @@
function ImageModal(props: Props): React.Node {
const { navigation, route } = props;
- return <FullScreenViewModal navigation={navigation} route={route} />;
+ const imageModal = React.useMemo(
+ () => (
+ <FullScreenViewModal navigation={navigation} route={route}>
+ <Multimedia mediaInfo={route.params.mediaInfo} spinnerColor="white" />
+ </FullScreenViewModal>
+ ),
+ [navigation, route],
+ );
+
+ return imageModal;
}
export default ImageModal;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 6:44 AM (21 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2534181
Default Alt Text
D9359.id31658.diff (2 KB)
Attached To
Mode
D9359: [native] introduce children prop to FullScreenViewModal
Attached
Detach File
Event Timeline
Log In to Comment