From c31ffdac1b970d8d51c538f931cc64a942670740 Mon Sep 17 00:00:00 2001 From: John Fawcett Date: Sun, 19 Mar 2023 17:39:37 -0500 Subject: [PATCH] Fixes the lightbox not having a close button on web (#306) (#323) --- src/view/com/lightbox/Lightbox.web.tsx | 58 ++++++++++++++++++-------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/src/view/com/lightbox/Lightbox.web.tsx b/src/view/com/lightbox/Lightbox.web.tsx index a79d2ba0..f12839fb 100644 --- a/src/view/com/lightbox/Lightbox.web.tsx +++ b/src/view/com/lightbox/Lightbox.web.tsx @@ -11,6 +11,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {useStores} from 'state/index' import * as models from 'state/models/ui/shell' import {colors} from 'lib/styles' +import ImageDefaultHeader from './ImageViewing/components/ImageDefaultHeader' interface Img { uri: string @@ -59,25 +60,38 @@ function LightboxInner({imgs, onClose}: {imgs: Img[]; onClose: () => void}) { } return ( - - - - {canGoLeft && ( - - - - )} - {canGoRight && ( - - - - )} + + + + + {canGoLeft && ( + + + + )} + {canGoRight && ( + + + + )} + + + + - + ) } @@ -89,6 +103,9 @@ const styles = StyleSheet.create({ width: '100%', height: '100%', backgroundColor: '#000c', + }, + imageCenterer: { + flex: 1, alignItems: 'center', justifyContent: 'center', }, @@ -100,6 +117,11 @@ const styles = StyleSheet.create({ icon: { color: colors.white, }, + closeBtn: { + position: 'absolute', + top: 10, + right: 10, + }, btn: { position: 'absolute', backgroundColor: '#000',