Skip to content

Commit

Permalink
chore: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AsteriskZuo committed Dec 19, 2023
1 parent d971e0c commit 27b2d58
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion example/src/__dev__/test_gift_floating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions example/src/screens/ChatroomScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/biz/Chatroom/Chatroom.hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) ?? '',
Expand Down
2 changes: 1 addition & 1 deletion src/biz/GiftMessageList/GiftMessageList.item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function GiftMessageListItem(props: GiftMessageListItemProps) {
numberOfLines={1}
style={{ color: 'white' }}
>
{item.gift.nickName}
{item.gift.nickname}
</Text>
<Text
textType={'extraSmall'}
Expand Down
2 changes: 1 addition & 1 deletion src/biz/GiftMessageList/GiftMessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export type GiftMessageListProps = {
* 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',
Expand Down
2 changes: 1 addition & 1 deletion src/biz/GiftMessageList/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type GiftMessageListItemData = {
/**
* The nickname of the sender.
*/
nickName: string;
nickname: string;
/**
* The content of the message.
*/
Expand Down
10 changes: 5 additions & 5 deletions src/biz/MessageList/MessageList.hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function useMessageListApi(params: {
const _addJoinData = (message: ChatMessage) => {
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',
Expand Down Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion src/biz/MessageList/MessageList.item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export function MessageListItem(props: MessageListItemProps) {
paletteType={'label'}
style={{ color: getColor('name') }}
>
{basic.nickName}
{basic.nickname}
</Text>
</View>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/biz/MessageList/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type MessageListItemBasic = {
timestamp: number;
avatar?: string;
tag?: IconNameType | string;
nickName: string;
nickname: string;
};

export type MessageListItemOp = {
Expand Down
4 changes: 2 additions & 2 deletions src/biz/ParticipantList/ParticipantContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/biz/ParticipantList/ParticipantList.hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<NodeJS.Timeout | undefined>();
const im = useRoomContext();

Expand Down
6 changes: 3 additions & 3 deletions src/biz/ParticipantList/ParticipantList.item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
</Text>
{/* <Text
textType={'medium'}
Expand Down
14 changes: 7 additions & 7 deletions src/room/room.impl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export abstract class RoomServiceImpl implements RoomService {

// !!! hot-reload no pass, into catch codes
this._user = {
nickName: userNickname,
nickname: userNickname,
avatarURL: userAvatarURL,
userId: userId,
gender: gender,
Expand All @@ -178,15 +178,15 @@ export abstract class RoomServiceImpl implements RoomService {
if (error?.code === 200) {
// !!! for dev hot-reload
this._user = {
nickName: userNickname,
nickname: userNickname,
avatarURL: userAvatarURL,
userId: userId,
gender: gender,
identify: identify,
} as UserServiceData;

this._updateMember({
nickName: userNickname,
nickname: userNickname,
avatarURL: userAvatarURL,
userId: userId,
});
Expand Down Expand Up @@ -288,7 +288,7 @@ export abstract class RoomServiceImpl implements RoomService {
}
ret.push({
userId: item[1].userId,
nickName: item[1].nickName ?? undefined,
nickname: item[1].nickName ?? undefined,
avatarURL: item[1].avatarUrl ?? undefined,
gender: item[1].gender ?? 0,
identify: identify,
Expand All @@ -308,7 +308,7 @@ export abstract class RoomServiceImpl implements RoomService {
try {
const p = {
userId: self.userId,
nickName: self.nickName,
nickname: self.nickname,
avatarUrl: self.avatarURL,
gender: self.gender,
ext: JSON.stringify({ identify: self.identify }),
Expand All @@ -332,8 +332,8 @@ export abstract class RoomServiceImpl implements RoomService {
}).filter((v) => {
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') {
Expand Down
2 changes: 1 addition & 1 deletion src/room/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export type UserServiceData = {
/**
* User nick name. It is very important to set.
*/
nickName?: string;
nickname?: string;
/**
* User avatar URL.
*/
Expand Down

0 comments on commit 27b2d58

Please sign in to comment.