mattermost-mobile/app/components/autocomplete/at_mention_item/index.tsx
Daniel Espino García a8ee3a1b5a
Fix and unify channel and user list items (#7175)
* Fix channel and user list items

* Fixes on members and create a dm lists

* Fix tutorial and ipad

* Fix test

* Address feedback

* Several fixes on Android

* Fix tests

* Address feedback

* Add more non breaking strings

---------

Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
2023-04-19 10:13:14 +02:00

34 lines
784 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useCallback} from 'react';
import UserItem from '@components/user_item';
import type UserModel from '@typings/database/models/servers/user';
type AtMentionItemProps = {
user: UserProfile | UserModel;
onPress?: (username: string) => void;
testID?: string;
}
const AtMentionItem = ({
user,
onPress,
testID,
}: AtMentionItemProps) => {
const completeMention = useCallback((u: UserModel | UserProfile) => {
onPress?.(u.username);
}, []);
return (
<UserItem
user={user}
testID={testID}
onUserPress={completeMention}
/>
);
};
export default AtMentionItem;