| | 1 | | using DCL.Social.Chat; |
| | 2 | | using System; |
| | 3 | | using TMPro; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | namespace DCL.Social.Chat |
| | 7 | | { |
| | 8 | | public class ChannelLeaveErrorWindowComponentView : BaseComponentView, IChannelLeaveErrorWindowView |
| | 9 | | { |
| | 10 | | [SerializeField] internal ButtonComponentView[] acceptButton; |
| | 11 | | [SerializeField] internal ButtonComponentView retryButton; |
| | 12 | | [SerializeField] internal TMP_Text titleLabel; |
| | 13 | |
|
| | 14 | | public event Action OnClose; |
| | 15 | | public event Action OnRetry; |
| | 16 | |
|
| | 17 | | public void Show(string channelName) |
| | 18 | | { |
| 1 | 19 | | gameObject.SetActive(true); |
| 1 | 20 | | titleLabel.SetText($"There was an error while trying to leave the channel #{channelName}. Please try again." |
| 1 | 21 | | } |
| | 22 | |
|
| 1 | 23 | | public void Hide() => gameObject.SetActive(false); |
| | 24 | |
|
| | 25 | | public override void Awake() |
| | 26 | | { |
| 4 | 27 | | base.Awake(); |
| | 28 | |
|
| 32 | 29 | | foreach (var button in acceptButton) |
| 15 | 30 | | button.onClick.AddListener(() => OnClose?.Invoke()); |
| | 31 | |
|
| 5 | 32 | | retryButton.onClick.AddListener(() => OnRetry?.Invoke()); |
| 4 | 33 | | } |
| | 34 | |
|
| | 35 | | public override void RefreshControl() |
| | 36 | | { |
| 0 | 37 | | } |
| | 38 | | } |
| | 39 | | } |