Skip to content

Commit

Permalink
fix: add inject headerRight into Screen Contacts (#1459)
Browse files Browse the repository at this point in the history
Signed-off-by: ClaudeArs <claudears2474@gmail.com>
  • Loading branch information
ClaudeArs authored Feb 26, 2025
1 parent a56c6f6 commit 51c2a67
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/legacy/core/App/screens/ListContacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ const ListContacts: React.FC<ListContactsProps> = ({ navigation }) => {
const { t } = useTranslation()
const { agent } = useAgent()
const [connections, setConnections] = useState<ConnectionRecord[]>([])
const {records: connectionRecords} = useConnections()
const { records: connectionRecords } = useConnections()
const [store] = useStore()
const [{ contactHideList }, ContactListItem] = useServices([TOKENS.CONFIG, TOKENS.COMPONENT_CONTACT_LIST_ITEM])
const [{ contactHideList }, ContactListItem, defaultScreenOptionsDict] = useServices([
TOKENS.CONFIG,
TOKENS.COMPONENT_CONTACT_LIST_ITEM,
TOKENS.OBJECT_SCREEN_CONFIG,
])
const style = StyleSheet.create({
list: {
backgroundColor: ColorPallet.brand.secondaryBackground,
Expand Down Expand Up @@ -85,10 +89,10 @@ const ListContacts: React.FC<ListContactsProps> = ({ navigation }) => {
})
} else {
navigation.setOptions({
headerRight: () => false,
headerRight: defaultScreenOptionsDict[Screens.Contacts]?.headerRight,
})
}
}, [store.preferences.useConnectionInviterCapability, navigation, t, onPressAddContact])
}, [store.preferences.useConnectionInviterCapability, navigation, t, onPressAddContact, defaultScreenOptionsDict])

return (
<View>
Expand Down

0 comments on commit 51c2a67

Please sign in to comment.