about summary refs log tree commit diff
path: root/src/view/com/lightbox/ImageViewing/components
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-03-19 15:18:29 +0000
committerSamuel Newman <mozzius@protonmail.com>2024-03-19 15:18:29 +0000
commitf491bd89cc28cba46a92b443e1f07ff73e8f7128 (patch)
tree8f7c34372afe1f600a5626ef72dd9c8b28b930a6 /src/view/com/lightbox/ImageViewing/components
parentd2a11f3344149a299372f0a7dcd01de9f58ef9a1 (diff)
parent9c49b209ca9eda8e6fab0942f7046d335c955c1a (diff)
downloadvoidsky-f491bd89cc28cba46a92b443e1f07ff73e8f7128.tar.zst
Merge remote-tracking branch 'origin/main' into samuel/alf-login
Diffstat (limited to 'src/view/com/lightbox/ImageViewing/components')
-rw-r--r--src/view/com/lightbox/ImageViewing/components/ImageDefaultHeader.tsx37
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: {