|
16 | 16 |
|
17 | 17 | package io.getstream.chat.android.compose.ui.channel.info |
18 | 18 |
|
19 | | -import androidx.compose.material3.LocalContentColor |
20 | 19 | import androidx.compose.runtime.Composable |
21 | | -import androidx.compose.runtime.CompositionLocalProvider |
22 | 20 | import androidx.compose.runtime.getValue |
23 | 21 | import androidx.compose.runtime.mutableStateOf |
24 | 22 | import androidx.compose.runtime.remember |
@@ -104,23 +102,22 @@ private fun ChannelInfoOptionContent( |
104 | 102 | } |
105 | 103 |
|
106 | 104 | is ChannelInfoViewState.Content.Option.BlockUser -> { |
107 | | - CompositionLocalProvider(LocalContentColor.provides(ChatTheme.colors.accentError)) { |
108 | | - ChannelInfoOptionButton( |
109 | | - icon = R.drawable.stream_design_ic_no_sign, |
110 | | - text = if (option.isBlocked) { |
111 | | - stringResource(UiCommonR.string.stream_ui_channel_info_option_unblock_user) |
| 105 | + ChannelInfoOptionButton( |
| 106 | + icon = R.drawable.stream_design_ic_no_sign, |
| 107 | + text = if (option.isBlocked) { |
| 108 | + stringResource(UiCommonR.string.stream_ui_channel_info_option_unblock_user) |
| 109 | + } else { |
| 110 | + stringResource(UiCommonR.string.stream_ui_channel_info_option_block_user) |
| 111 | + }, |
| 112 | + destructive = false, |
| 113 | + onClick = { |
| 114 | + if (option.isBlocked) { |
| 115 | + onViewAction(ChannelInfoViewAction.UnblockUserClick) |
112 | 116 | } else { |
113 | | - stringResource(UiCommonR.string.stream_ui_channel_info_option_block_user) |
114 | | - }, |
115 | | - onClick = { |
116 | | - if (option.isBlocked) { |
117 | | - onViewAction(ChannelInfoViewAction.UnblockUserClick) |
118 | | - } else { |
119 | | - onViewAction(ChannelInfoViewAction.BlockUserClick) |
120 | | - } |
121 | | - }, |
122 | | - ) |
123 | | - } |
| 117 | + onViewAction(ChannelInfoViewAction.BlockUserClick) |
| 118 | + } |
| 119 | + }, |
| 120 | + ) |
124 | 121 | } |
125 | 122 |
|
126 | 123 | is ChannelInfoViewState.Content.Option.PinnedMessages -> { |
@@ -148,31 +145,29 @@ private fun ChannelInfoOptionContent( |
148 | 145 | } |
149 | 146 |
|
150 | 147 | is ChannelInfoViewState.Content.Option.LeaveChannel -> { |
151 | | - CompositionLocalProvider(LocalContentColor.provides(ChatTheme.colors.accentError)) { |
152 | | - ChannelInfoOptionButton( |
153 | | - icon = R.drawable.stream_design_ic_leave, |
154 | | - text = if (isGroupChannel) { |
155 | | - stringResource(UiCommonR.string.stream_ui_channel_info_option_leave_group) |
156 | | - } else { |
157 | | - stringResource(UiCommonR.string.stream_ui_channel_info_option_leave_conversation) |
158 | | - }, |
159 | | - onClick = { onViewAction(ChannelInfoViewAction.LeaveChannelClick) }, |
160 | | - ) |
161 | | - } |
| 148 | + ChannelInfoOptionButton( |
| 149 | + icon = R.drawable.stream_design_ic_leave, |
| 150 | + text = if (isGroupChannel) { |
| 151 | + stringResource(UiCommonR.string.stream_ui_channel_info_option_leave_group) |
| 152 | + } else { |
| 153 | + stringResource(UiCommonR.string.stream_ui_channel_info_option_leave_conversation) |
| 154 | + }, |
| 155 | + destructive = true, |
| 156 | + onClick = { onViewAction(ChannelInfoViewAction.LeaveChannelClick) }, |
| 157 | + ) |
162 | 158 | } |
163 | 159 |
|
164 | 160 | is ChannelInfoViewState.Content.Option.DeleteChannel -> { |
165 | | - CompositionLocalProvider(LocalContentColor.provides(ChatTheme.colors.accentError)) { |
166 | | - ChannelInfoOptionButton( |
167 | | - icon = R.drawable.stream_design_ic_delete, |
168 | | - text = if (isGroupChannel) { |
169 | | - stringResource(UiCommonR.string.stream_ui_channel_info_option_delete_group) |
170 | | - } else { |
171 | | - stringResource(UiCommonR.string.stream_ui_channel_info_option_delete_conversation) |
172 | | - }, |
173 | | - onClick = { onViewAction(ChannelInfoViewAction.DeleteChannelClick) }, |
174 | | - ) |
175 | | - } |
| 161 | + ChannelInfoOptionButton( |
| 162 | + icon = R.drawable.stream_design_ic_delete, |
| 163 | + text = if (isGroupChannel) { |
| 164 | + stringResource(UiCommonR.string.stream_ui_channel_info_option_delete_group) |
| 165 | + } else { |
| 166 | + stringResource(UiCommonR.string.stream_ui_channel_info_option_delete_conversation) |
| 167 | + }, |
| 168 | + destructive = true, |
| 169 | + onClick = { onViewAction(ChannelInfoViewAction.DeleteChannelClick) }, |
| 170 | + ) |
176 | 171 | } |
177 | 172 | } |
178 | 173 | } |
|
0 commit comments