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