diff --git a/.eslintrc.js b/.eslintrc.js index dbc07bd..f64cea2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,6 +21,7 @@ module.exports = { 'react/prop-types': 'off', 'react/react-in-jsx-scope': 'off', '@typescript-eslint/strict-boolean-expressions': 'off', + '@typescript-eslint/no-confusing-void-expression': 'off', '@typescript-eslint/no-dynamic-delete': 'off', '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-misused-promises': 'off', diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index e4fa3e4..e6d4c8d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -19,7 +19,7 @@ android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true"> - + diff --git a/frontend/Components/NostrosAvatar/index.tsx b/frontend/Components/NostrosAvatar/index.tsx index 3cbeef5..e0fcd8f 100644 --- a/frontend/Components/NostrosAvatar/index.tsx +++ b/frontend/Components/NostrosAvatar/index.tsx @@ -3,6 +3,7 @@ import { StyleSheet, View } from 'react-native' import { Avatar as PaperAvatar, useTheme } from 'react-native-paper' import { validImageUrl } from '../../Functions/NativeFunctions' import FastImage from 'react-native-fast-image' +import { formatPubKey } from '../../Functions/RelayFunctions/Users' interface NostrosAvatarProps { pubKey?: string @@ -20,7 +21,7 @@ export const NostrosAvatar: React.FC = ({ lud06, }) => { const theme = useTheme() - const displayName = name && name !== '' ? name : pubKey ?? '' + const displayName = name && name !== '' ? name : formatPubKey(pubKey) ?? '' const hasLud06 = lud06 && lud06 !== '' const lud06IconSize = size / 2.85 diff --git a/frontend/Components/NoteCard/index.tsx b/frontend/Components/NoteCard/index.tsx index 6d3f81d..9aa54fa 100644 --- a/frontend/Components/NoteCard/index.tsx +++ b/frontend/Components/NoteCard/index.tsx @@ -8,7 +8,7 @@ import { Note, NoteRelay, } from '../../Functions/DatabaseFunctions/Notes' -import { StyleSheet, View } from 'react-native' +import { StyleSheet, TouchableNativeFeedback, View } from 'react-native' import { RelayPoolContext } from '../../Contexts/RelayPoolContext' import { AppContext } from '../../Contexts/AppContext' import { t } from 'i18next' @@ -34,14 +34,12 @@ import { import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' import { REGEX_SOCKET_LINK } from '../../Constants/Relay' import { push } from '../../lib/Navigation' -import { User } from '../../Functions/DatabaseFunctions/Users' import { Kind } from 'nostr-tools' import ProfileData from '../ProfileData' import { relayToColor } from '../../Functions/NativeFunctions' interface NoteCardProps { note?: Note - onPressUser?: (user: User) => void showAvatarImage?: boolean showAnswerData?: boolean showAction?: boolean @@ -60,14 +58,13 @@ export const NoteCard: React.FC = ({ showActionCount = true, showPreview = true, showRepostPreview = true, - onPressUser = () => {}, numberOfLines, mode = 'elevated', }) => { const theme = useTheme() const { publicKey, privateKey } = React.useContext(UserContext) - const { relayPool, lastEventId } = useContext(RelayPoolContext) - const { database, showSensitive } = useContext(AppContext) + const { relayPool, lastEventId, setDisplayrelayDrawer } = useContext(RelayPoolContext) + const { database, showSensitive, setDisplayUserDrawer } = useContext(AppContext) const [relayAdded, setRelayAdded] = useState(false) const [positiveReactions, setPositiveReactions] = useState(0) const [negaiveReactions, setNegativeReactions] = useState(0) @@ -171,7 +168,7 @@ export const NoteCard: React.FC = ({ ) : ( setDisplayUserDrawer(user.id)} showPreview={showPreview} numberOfLines={numberOfLines} /> @@ -266,7 +263,7 @@ export const NoteCard: React.FC = ({ return note ? ( - onPressUser({ id: note.pubkey, name: note.name })}> + setDisplayUserDrawer(note.pubkey)}> = ({ onPressUser({ id: note.pubkey, name: note.name })} + onPress={() => setDisplayUserDrawer(note.pubkey)} /> )} {getNoteContent()} - {showAction && !note?.blocked > 0 && ( + {showAction && (