-
Notifications
You must be signed in to change notification settings - Fork 109
Add participant actions in channel info view #982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Generated by 🚫 Danger |
Public Interface+ public struct ParticipantAction: Identifiable
+
+ public var id: String
+ public let title: String
+ public let iconName: String
+ public let action: () -> Void
+ public let confirmationPopup: ConfirmationPopup?
+ public let isDestructive: Bool
+ public var navigationDestination: AnyView?
+
+
+ public init(title: String,iconName: String,action: @escaping () -> Void,confirmationPopup: ConfirmationPopup?,isDestructive: Bool)
- public class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDelegate
+ open class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDelegate
- public var shouldShowLeaveConversationButton: Bool
+ @Published public var selectedParticipant: ParticipantInfo?
- public var canRenameChannel: Bool
+ public var shouldShowLeaveConversationButton: Bool
- public var shouldShowAddUserButton: Bool
+ public var canRenameChannel: Bool
- public var showSingleMemberDMView: Bool
+ public var shouldShowAddUserButton: Bool
- public var displayedParticipants: [ParticipantInfo]
+ public var showSingleMemberDMView: Bool
- public var leaveButtonTitle: String
+ public var displayedParticipants: [ParticipantInfo]
- public var leaveConversationDescription: String
+ public var leaveButtonTitle: String
- public var showMoreUsersButtonTitle: String
+ public var leaveConversationDescription: String
- public var notDisplayedParticipantsCount: Int
+ public var showMoreUsersButtonTitle: String
- public var mutedText: String
+ public var notDisplayedParticipantsCount: Int
- public var showMoreUsersButton: Bool
+ public var mutedText: String
-
+ public var showMoreUsersButton: Bool
-
+
- public init(channel: ChatChannel)
+
-
+ public init(channel: ChatChannel)
-
+
- public func onlineInfo(for user: ChatUser)-> String
+
- public func onParticipantAppear(_ participantInfo: ParticipantInfo)
+ public func onlineInfo(for user: ChatUser)-> String
- public func leaveConversationTapped(completion: @escaping () -> Void)
+ public func onParticipantAppear(_ participantInfo: ParticipantInfo)
- public func cancelGroupRenaming()
+ public func leaveConversationTapped(completion: @escaping () -> Void)
- public func confirmGroupRenaming()
+ public func cancelGroupRenaming()
- public func channelController(_ channelController: ChatChannelController,didUpdateChannel channel: EntityChange<ChatChannel>)
+ public func confirmGroupRenaming()
- public func addUserTapped(_ user: ChatUser)
+ public func channelController(_ channelController: ChatChannelController,didUpdateChannel channel: EntityChange<ChatChannel>)
+ public func addUserTapped(_ user: ChatUser)
+ open func participantActions(for participant: ParticipantInfo)-> [ParticipantAction]
+ public func muteAction(participant: ParticipantInfo,onDismiss: @escaping () -> Void,onError: @escaping (Error) -> Void)-> ParticipantAction
+ public func unmuteAction(participant: ParticipantInfo,onDismiss: @escaping () -> Void,onError: @escaping (Error) -> Void)-> ParticipantAction
+ public func removeUserAction(participant: ParticipantInfo,onDismiss: @escaping () -> Void,onError: @escaping (Error) -> Void)-> ParticipantAction
public struct ChatInfoParticipantsView: View
- public init(factory: Factory = DefaultViewFactory.shared,participants: [ParticipantInfo],onItemAppear: @escaping (ParticipantInfo) -> Void)
+ public init(factory: Factory = DefaultViewFactory.shared,participants: [ParticipantInfo],onItemAppear: @escaping (ParticipantInfo) -> Void,selectedParticipant: Binding<ParticipantInfo?> = .constant(nil))
public struct ChatChannelInfoView: View, KeyboardReadable
- public init(factory: Factory = DefaultViewFactory.shared,channel: ChatChannel,shownFromMessageList: Bool = false)
+ public init(factory: Factory = DefaultViewFactory.shared,viewModel: ChatChannelInfoViewModel? = nil,channel: ChatChannel,shownFromMessageList: Bool = false) |
SDK Size
|
DateUtils.timeAgo | ||
} | ||
|
||
open func participantActions(for participant: ParticipantInfo) -> [ParticipantAction] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to keep it consistent with Android, we need to introduce the action of "Send direct message" or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great 👌 Just added on small comment
Co-authored-by: Stream Bot <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added one small suggestion, other than that LGTM 👍
ParticipantInfoView( | ||
participant: selectedParticipant, | ||
actions: viewModel.participantActions(for: selectedParticipant) | ||
) { | ||
withAnimation { | ||
viewModel.selectedParticipant = nil | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we create a slot here so that customers can override the ParticipantInfoView?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think we should not, we don't expose much slots here. We can in the future, if there's enough interest.
"channel.item.remove-user" = "Remove User"; | ||
"channel.item.remove-user-confirmation-title" = "Remove User"; | ||
"channel.item.remove-user-confirmation-message" = "Are you sure you want to remove %@ from %@?"; | ||
"channel.item.send-direct-message" = "Send direct message"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is a title, should not it be "Send Direct Message" (like "Remove User")?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment about the action's title.
🔗 Issue Links
Resolves https://linear.app/stream/issue/IOS-1163/speakap-channel-member-info-view.
🎯 Goal
Describe why we are making this change.
📝 Summary
Provide bullet points with the most important changes in the codebase.
🛠 Implementation
Provide a detailed description of the implementation and explain your decisions if you find them relevant.
🎨 Showcase
Add relevant screenshots and/or videos/gifs to easily see what this PR changes, if applicable.
🧪 Manual Testing Notes
Explain how this change can be tested manually, if applicable.
☑️ Contributor Checklist
docs-content
repo