Skip to content

Commit c8710bd

Browse files
committed
feat(mobile): lightbox
1 parent 4d7c01c commit c8710bd

9 files changed

Lines changed: 1924 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright (c) JOB TODAY S.A. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
*/
8+
9+
import {TransformsStyle} from 'react-native'
10+
import {MeasuredDimensions} from 'react-native-reanimated'
11+
12+
export type Dimensions = {
13+
width: number
14+
height: number
15+
}
16+
17+
export type Position = {
18+
x: number
19+
y: number
20+
}
21+
22+
export type ImageSource = {
23+
uri: string
24+
dimensions: Dimensions | null
25+
thumbUri: string
26+
thumbDimensions: Dimensions | null
27+
thumbRect: MeasuredDimensions | null
28+
alt?: string
29+
type: 'image' | 'circle-avi' | 'rect-avi'
30+
}
31+
32+
export type Transform = Exclude<
33+
TransformsStyle['transform'],
34+
string | undefined
35+
>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* Copyright (c) JOB TODAY S.A. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
*/
8+
import type { ViewStyle } from "react-native"
9+
import { SafeAreaView, StyleSheet, TouchableOpacity } from "react-native"
10+
11+
import { CloseCuteReIcon } from "@/src/icons/close_cute_re"
12+
13+
type Props = {
14+
onRequestClose: () => void
15+
}
16+
17+
const ImageDefaultHeader = ({ onRequestClose }: Props) => {
18+
return (
19+
<SafeAreaView style={styles.root}>
20+
<TouchableOpacity
21+
style={[styles.closeButton, styles.blurredBackground]}
22+
onPress={onRequestClose}
23+
hitSlop={16}
24+
accessibilityRole="button"
25+
accessibilityLabel={`Close image`}
26+
accessibilityHint={`Closes viewer for header image`}
27+
onAccessibilityEscape={onRequestClose}
28+
>
29+
<CloseCuteReIcon />
30+
</TouchableOpacity>
31+
</SafeAreaView>
32+
)
33+
}
34+
35+
const styles = StyleSheet.create({
36+
root: {
37+
alignItems: "flex-end",
38+
pointerEvents: "box-none",
39+
},
40+
closeButton: {
41+
marginRight: 10,
42+
marginTop: 10,
43+
width: 44,
44+
height: 44,
45+
alignItems: "center",
46+
justifyContent: "center",
47+
borderRadius: 22,
48+
backgroundColor: "#00000077",
49+
},
50+
blurredBackground: {
51+
backdropFilter: "blur(10px)",
52+
WebkitBackdropFilter: "blur(10px)",
53+
} as ViewStyle,
54+
})
55+
56+
export default ImageDefaultHeader

0 commit comments

Comments
 (0)