diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-03-18 16:14:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 16:14:00 +0000 |
commit | 1dcd5c116fd9e1b3ef3d5218a2e8d0728f3d44fa (patch) | |
tree | b22ba91bea017cb98db5e1c48404a553334817c4 /src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx | |
parent | 88ab83bd52a76fb08a51970831f5ff1e86edd326 (diff) | |
parent | 574c8b913d42fe94832b19645ff67e77f6b02bec (diff) | |
download | voidsky-1dcd5c116fd9e1b3ef3d5218a2e8d0728f3d44fa.tar.zst |
Merge pull request #3247 from bluesky-social/samuel/dynamic-translations
Fix instances of static translations (`t` macro)
Diffstat (limited to 'src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx')
-rw-r--r-- | src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx b/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx index 3401adaff..3872919de 100644 --- a/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx +++ b/src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx @@ -6,9 +6,11 @@ * */ import React from 'react' -import {createHitslop} from 'lib/constants' import {SafeAreaView, Text, TouchableOpacity, StyleSheet} from 'react-native' -import {t} from '@lingui/macro' +import {msg} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {createHitslop} from '#/lib/constants' type Props = { onRequestClose: () => void @@ -16,20 +18,23 @@ type Props = { const HIT_SLOP = createHitslop(16) -const ImageDefaultHeader = ({onRequestClose}: Props) => ( - <SafeAreaView style={styles.root}> - <TouchableOpacity - style={styles.closeButton} - onPress={onRequestClose} - hitSlop={HIT_SLOP} - accessibilityRole="button" - accessibilityLabel={t`Close image`} - accessibilityHint={t`Closes viewer for header image`} - onAccessibilityEscape={onRequestClose}> - <Text style={styles.closeText}>✕</Text> - </TouchableOpacity> - </SafeAreaView> -) +const ImageDefaultHeader = ({onRequestClose}: Props) => { + const {_} = useLingui() + return ( + <SafeAreaView style={styles.root}> + <TouchableOpacity + style={styles.closeButton} + onPress={onRequestClose} + hitSlop={HIT_SLOP} + accessibilityRole="button" + accessibilityLabel={_(msg`Close image`)} + accessibilityHint={_(msg`Closes viewer for header image`)} + onAccessibilityEscape={onRequestClose}> + <Text style={styles.closeText}>✕</Text> + </TouchableOpacity> + </SafeAreaView> + ) +} const styles = StyleSheet.create({ root: { |