mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at uiwork 58 lines 1.4 kB view raw
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 */ 8import React from 'react' 9import {createHitslop} from 'lib/constants' 10import {SafeAreaView, Text, TouchableOpacity, StyleSheet} from 'react-native' 11import {t} from '@lingui/macro' 12 13type Props = { 14 onRequestClose: () => void 15} 16 17const HIT_SLOP = createHitslop(16) 18 19const ImageDefaultHeader = ({onRequestClose}: Props) => ( 20 <SafeAreaView style={styles.root}> 21 <TouchableOpacity 22 style={styles.closeButton} 23 onPress={onRequestClose} 24 hitSlop={HIT_SLOP} 25 accessibilityRole="button" 26 accessibilityLabel={t`Close image`} 27 accessibilityHint="Closes viewer for header image" 28 onAccessibilityEscape={onRequestClose}> 29 <Text style={styles.closeText}></Text> 30 </TouchableOpacity> 31 </SafeAreaView> 32) 33 34const styles = StyleSheet.create({ 35 root: { 36 alignItems: 'flex-end', 37 pointerEvents: 'box-none', 38 }, 39 closeButton: { 40 marginRight: 8, 41 marginTop: 8, 42 width: 44, 43 height: 44, 44 alignItems: 'center', 45 justifyContent: 'center', 46 borderRadius: 22, 47 backgroundColor: '#00000077', 48 }, 49 closeText: { 50 lineHeight: 22, 51 fontSize: 19, 52 textAlign: 'center', 53 color: '#FFF', 54 includeFontPadding: false, 55 }, 56}) 57 58export default ImageDefaultHeader