From c6dc0d7fc558efd66caf8ae6584d8261e8d4ef7a Mon Sep 17 00:00:00 2001 From: AndyLnd Date: Wed, 28 Oct 2020 17:48:58 +0100 Subject: [PATCH] refactor: React participant-avatar (#9828) --- package.json | 2 + .../template/content/connect-requests.htm | 2 +- .../template/content/preferences-account.htm | 4 +- .../components/ParticipantAvatar.test.tsx | 99 ++++++ src/script/components/ParticipantAvatar.tsx | 156 +++++++++ src/script/components/fullSearch.ts | 8 +- src/script/components/groupList.ts | 8 +- .../list/conversationListCallingCell.ts | 8 +- .../components/list/conversationListCell.ts | 8 +- src/script/components/list/participantItem.ts | 4 +- src/script/components/mentionSuggestions.ts | 8 +- src/script/components/message.ts | 15 +- src/script/components/panel/serviceDetails.ts | 10 +- src/script/components/panel/userDetails.ts | 4 +- src/script/components/participantAvatar.ts | 305 ------------------ .../participantAvatar/AvatarBackground.tsx | 36 ++- .../participantAvatar/AvatarBadge.tsx | 52 +++ .../participantAvatar/AvatarBorder.tsx | 37 +++ .../participantAvatar/AvatarImage.test.tsx | 129 ++++++++ .../participantAvatar/AvatarImage.tsx | 118 +++++++ .../participantAvatar/AvatarInitials.tsx | 49 +++ .../participantAvatar/AvatarWrapper.tsx | 45 +++ .../participantAvatar/ServiceAvatar.test.tsx | 80 +++++ .../participantAvatar/ServiceAvatar.tsx | 86 +++++ .../participantAvatar/TemporaryGuest.test.tsx | 104 ++++++ .../TemporaryGuestAvatar.tsx | 94 ++++++ .../participantAvatar/UserAvatar.test.tsx | 113 +++++++ .../participantAvatar/UserAvatar.tsx | 85 +++++ src/script/components/serviceList.ts | 4 +- src/script/components/topPeople.ts | 8 +- src/script/entity/User.ts | 4 +- src/script/util/CSSMixin.ts | 28 ++ src/script/util/ComponentUtil.ts | 12 +- .../content/ConnectRequestsViewModel.ts | 6 +- .../view_model/content/InputBarViewModel.ts | 4 +- .../content/PreferencesAccountViewModel.ts | 6 +- .../content/ServiceModalViewModel.ts | 4 +- .../list/ConversationListViewModel.ts | 6 +- .../list/conversation-list-calling-cell.less | 10 - src/style/components/participant-avatar.less | 273 ---------------- .../content/conversation/message-list.less | 4 - src/style/content/preferences/account.less | 4 - src/style/foundation/main.less | 1 - .../list/conversationListCallingCellSpec.js | 4 +- yarn.lock | 7 + 45 files changed, 1380 insertions(+), 674 deletions(-) create mode 100644 src/script/components/ParticipantAvatar.test.tsx create mode 100644 src/script/components/ParticipantAvatar.tsx delete mode 100644 src/script/components/participantAvatar.ts rename test/unit_tests/components/participantAvatarSpec.js => src/script/components/participantAvatar/AvatarBackground.tsx (50%) create mode 100644 src/script/components/participantAvatar/AvatarBadge.tsx create mode 100644 src/script/components/participantAvatar/AvatarBorder.tsx create mode 100644 src/script/components/participantAvatar/AvatarImage.test.tsx create mode 100644 src/script/components/participantAvatar/AvatarImage.tsx create mode 100644 src/script/components/participantAvatar/AvatarInitials.tsx create mode 100644 src/script/components/participantAvatar/AvatarWrapper.tsx create mode 100644 src/script/components/participantAvatar/ServiceAvatar.test.tsx create mode 100644 src/script/components/participantAvatar/ServiceAvatar.tsx create mode 100644 src/script/components/participantAvatar/TemporaryGuest.test.tsx create mode 100644 src/script/components/participantAvatar/TemporaryGuestAvatar.tsx create mode 100644 src/script/components/participantAvatar/UserAvatar.test.tsx create mode 100644 src/script/components/participantAvatar/UserAvatar.tsx delete mode 100644 src/style/components/participant-avatar.less diff --git a/package.json b/package.json index a9764f4ffaa..ded40dcb799 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "react-redux": "7.2.1", "react-router": "5.2.0", "react-router-dom": "5.2.0", + "react-transition-group": "4.4.1", "redux": "4.0.5", "redux-logdown": "1.0.4", "redux-thunk": "2.3.0", @@ -80,6 +81,7 @@ "@types/react-redux": "7.1.9", "@types/react-router": "5.1.8", "@types/react-router-dom": "5.1.6", + "@types/react-transition-group": "4.4.0", "@types/redux-mock-store": "1.0.2", "@types/sdp-transform": "2.4.4", "@types/simplebar": "5.1.1", diff --git a/src/page/template/content/connect-requests.htm b/src/page/template/content/connect-requests.htm index ac9a8294d6e..3b65882da7f 100644 --- a/src/page/template/content/connect-requests.htm +++ b/src/page/template/content/connect-requests.htm @@ -4,7 +4,7 @@
- +
diff --git a/src/page/template/content/preferences-account.htm b/src/page/template/content/preferences-account.htm index 534e6019e50..7517f2153ef 100644 --- a/src/page/template/content/preferences-account.htm +++ b/src/page/template/content/preferences-account.htm @@ -97,7 +97,7 @@