diff --git a/example/src/__dev__/test_gift_floating.tsx b/example/src/__dev__/test_gift_floating.tsx
index ea4e713..29fcaff 100644
--- a/example/src/__dev__/test_gift_floating.tsx
+++ b/example/src/__dev__/test_gift_floating.tsx
@@ -34,7 +34,7 @@ export function TestGiftEffect() {
ref.current?.pushTask({
model: {
id: seqId('_gf').toString(),
- nickName: 'NickName',
+ nickname: 'NickName',
giftCount: 1,
giftIcon: 'http://notext.png',
content: 'send Agoraship too too too long',
diff --git a/example/src/screens/ChatroomScreen.tsx b/example/src/screens/ChatroomScreen.tsx
index e5748c6..821e1af 100644
--- a/example/src/screens/ChatroomScreen.tsx
+++ b/example/src/screens/ChatroomScreen.tsx
@@ -128,7 +128,7 @@ export function ChatroomScreen(props: Props) {
chatroomRef?.current?.getGiftMessageListRef()?.pushTask({
model: {
id: seqId('_gf').toString(),
- nickName: 'NickName',
+ nickname: 'NickName',
giftCount: 1,
giftIcon: 'http://notext.png',
content: 'send Agoraship',
@@ -404,8 +404,8 @@ export function ChatroomScreen(props: Props) {
chatroomRef?.current?.getGiftMessageListRef()?.pushTask({
model: {
id: seqId('_gf').toString(),
- nickName:
- im.getUserInfo(im.userId)?.nickName ??
+ nickname:
+ im.getUserInfo(im.userId)?.nickname ??
im.userId ??
'unknown',
giftCount: 1,
diff --git a/src/biz/Chatroom/Chatroom.hooks.tsx b/src/biz/Chatroom/Chatroom.hooks.tsx
index 16550ce..72063a9 100644
--- a/src/biz/Chatroom/Chatroom.hooks.tsx
+++ b/src/biz/Chatroom/Chatroom.hooks.tsx
@@ -203,12 +203,12 @@ export class Chatroom extends ChatroomBase {
if (jsonGift) {
const gift = JSON.parse(jsonGift) as GiftServiceData;
const user = this.im?.userInfoFromMessage(message);
- const nickName = user?.nickName ?? user?.userId ?? 'unknown';
+ const nickname = user?.nickname ?? user?.userId ?? 'unknown';
this.giftRef?.current?.pushTask?.({
model: {
id: seqId('_gf').toString(),
avatar: user?.avatarURL,
- nickName: nickName,
+ nickname: nickname,
giftCount: gift.giftCount,
giftIcon: gift.giftIcon,
content: this.i18n?.tr("Sent '@${0}'", gift.giftName) ?? '',
diff --git a/src/biz/GiftMessageList/GiftMessageList.item.tsx b/src/biz/GiftMessageList/GiftMessageList.item.tsx
index 5f51993..4feec13 100644
--- a/src/biz/GiftMessageList/GiftMessageList.item.tsx
+++ b/src/biz/GiftMessageList/GiftMessageList.item.tsx
@@ -87,7 +87,7 @@ export function GiftMessageListItem(props: GiftMessageListItemProps) {
numberOfLines={1}
style={{ color: 'white' }}
>
- {item.gift.nickName}
+ {item.gift.nickname}
{
const getNickName = () => {
const user = im.userInfoFromMessage(message);
- return user?.nickName ?? user?.userId ?? message.from ?? 'unknown';
+ return user?.nickname ?? user?.userId ?? message.from ?? 'unknown';
};
const part = {
type: 'tip',
@@ -236,14 +236,14 @@ export function useMessageListApi(params: {
) => {
const getBasic = (): MessageListItemBasic => {
let user = im.getUserInfo(d.msg?.from);
- if (user === undefined || user.nickName === undefined) {
+ if (user === undefined || user.nickname === undefined) {
user = im.userInfoFromMessage(d.msg);
}
- const nickName =
- user?.nickName ?? user?.userId ?? d.msg?.from ?? 'unknown';
+ const nickname =
+ user?.nickname ?? user?.userId ?? d.msg?.from ?? 'unknown';
return {
timestamp: Date.now(),
- nickName: nickName,
+ nickname: nickname,
avatar: user?.avatarURL,
tag: user?.identify,
};
diff --git a/src/biz/MessageList/MessageList.item.tsx b/src/biz/MessageList/MessageList.item.tsx
index b08de01..4b9255a 100644
--- a/src/biz/MessageList/MessageList.item.tsx
+++ b/src/biz/MessageList/MessageList.item.tsx
@@ -181,7 +181,7 @@ export function MessageListItem(props: MessageListItemProps) {
paletteType={'label'}
style={{ color: getColor('name') }}
>
- {basic.nickName}
+ {basic.nickname}
diff --git a/src/biz/MessageList/types.tsx b/src/biz/MessageList/types.tsx
index d46b946..1475730 100644
--- a/src/biz/MessageList/types.tsx
+++ b/src/biz/MessageList/types.tsx
@@ -20,7 +20,7 @@ export type MessageListItemBasic = {
timestamp: number;
avatar?: string;
tag?: IconNameType | string;
- nickName: string;
+ nickname: string;
};
export type MessageListItemOp = {
diff --git a/src/biz/ParticipantList/ParticipantContextMenu.tsx b/src/biz/ParticipantList/ParticipantContextMenu.tsx
index 9e33069..28ec261 100644
--- a/src/biz/ParticipantList/ParticipantContextMenu.tsx
+++ b/src/biz/ParticipantList/ParticipantContextMenu.tsx
@@ -48,7 +48,7 @@ export const ParticipantContextMenu = (props: ParticipantContextMenuProps) => {
if (isOwner === true) {
if (_memberType === 'member') {
if (memberType === _memberType) {
- setUserName(im.getUserInfo(userId)?.nickName ?? userId);
+ setUserName(im.getUserInfo(userId)?.nickname ?? userId);
let items: InitMenuItemsType[] = [
{
name: 'Mute',
@@ -90,7 +90,7 @@ export const ParticipantContextMenu = (props: ParticipantContextMenuProps) => {
}
} else if (_memberType === 'muted') {
if (memberType === _memberType) {
- setUserName(im.getUserInfo(userId)?.nickName ?? userId);
+ setUserName(im.getUserInfo(userId)?.nickname ?? userId);
menuRef?.current?.startShowWithInit([
{
name: 'Unmute',
diff --git a/src/biz/ParticipantList/ParticipantList.hooks.tsx b/src/biz/ParticipantList/ParticipantList.hooks.tsx
index 1a6c9f4..06191ca 100644
--- a/src/biz/ParticipantList/ParticipantList.hooks.tsx
+++ b/src/biz/ParticipantList/ParticipantList.hooks.tsx
@@ -668,7 +668,7 @@ export function useSearchParticipantListAPI(props: {
memberType: ParticipantListType;
searchType?: keyof UserServiceData;
}) {
- const { memberType, searchType = 'nickName' } = props;
+ const { memberType, searchType = 'nickname' } = props;
// const ds = React.useRef();
const im = useRoomContext();
diff --git a/src/biz/ParticipantList/ParticipantList.item.tsx b/src/biz/ParticipantList/ParticipantList.item.tsx
index 5866a28..bd1e911 100644
--- a/src/biz/ParticipantList/ParticipantList.item.tsx
+++ b/src/biz/ParticipantList/ParticipantList.item.tsx
@@ -83,10 +83,10 @@ export function ParticipantListItem(props: ParticipantListItemProps) {
color: getColor('color'),
}}
>
- {userInfo.nickName === undefined ||
- userInfo.nickName.trim().length === 0
+ {userInfo.nickname === undefined ||
+ userInfo.nickname.trim().length === 0
? userInfo.userId
- : userInfo.nickName}
+ : userInfo.nickname}
{/* {
if (type === 'avatarURL') {
return v.avatarURL?.includes(key);
- } else if (type === 'nickName') {
- return v.nickName?.includes(key);
+ } else if (type === 'nickname') {
+ return v.nickname?.includes(key);
} else if (type === 'identify') {
return v.identify?.includes(key);
} else if (type === 'gender') {
diff --git a/src/room/types.tsx b/src/room/types.tsx
index 04f031a..f73c19f 100644
--- a/src/room/types.tsx
+++ b/src/room/types.tsx
@@ -70,7 +70,7 @@ export type UserServiceData = {
/**
* User nick name. It is very important to set.
*/
- nickName?: string;
+ nickname?: string;
/**
* User avatar URL.
*/