Skip to content

Commit

Permalink
fix: note icon registers clicks
Browse files Browse the repository at this point in the history
Signed-off-by: Prakhar Agarwal <[email protected]>
  • Loading branch information
Prakhar-Agarwal-byte committed Jun 12, 2024
1 parent 0509824 commit e57e930
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/components/note-input/note-input.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { View, TextInput, StyleProp, ViewStyle } from "react-native"
import React, { useRef } from "react"
import { View, TextInput, StyleProp, ViewStyle, TouchableOpacity } from "react-native"

import { useI18nContext } from "@app/i18n/i18n-react"
import { testProps } from "@app/utils/testProps"
Expand Down Expand Up @@ -29,7 +29,13 @@ export const NoteInput: React.FC<NoteInputProps> = ({
const {
theme: { colors },
} = useTheme()
const textInputRef = useRef<TextInput>(null)

const focusTextInput = () => {
if (textInputRef.current) {
textInputRef.current.focus()
}
}
return (
<View style={[styles.fieldBackground, style]}>
<View style={styles.noteContainer}>
Expand All @@ -44,10 +50,11 @@ export const NoteInput: React.FC<NoteInputProps> = ({
editable={editable}
selectTextOnFocus
maxLength={500}
ref={textInputRef}
/>
<View style={styles.noteIconContainer}>
<TouchableOpacity style={styles.noteIconContainer} onPress={focusTextInput}>
<GaloyIcon name={"note"} size={18} color={colors.primary} />
</View>
</TouchableOpacity>
</View>
</View>
)
Expand Down

0 comments on commit e57e930

Please sign in to comment.