| | 1 | | using DCL.Controllers; |
| | 2 | | using System; |
| | 3 | | using UnityEngine; |
| | 4 | | using UnityEngine.UI; |
| | 5 | |
|
| | 6 | | namespace DCL.ContentModeration |
| | 7 | | { |
| | 8 | | public class ContentModerationReportingButtonComponentView : BaseComponentView, IContentModerationReportingButtonCom |
| | 9 | | { |
| | 10 | | [SerializeField] private Button contentModerationButton; |
| | 11 | | [SerializeField] private Image flagImage; |
| | 12 | | [SerializeField] private Sprite teenFlagIcon; |
| | 13 | | [SerializeField] private Sprite adultFlagIcon; |
| | 14 | | [SerializeField] private Sprite restrictedFlagIcon; |
| | 15 | |
|
| | 16 | | public event Action OnContentModerationPressed; |
| | 17 | |
|
| | 18 | | public override void Awake() |
| | 19 | | { |
| 10 | 20 | | base.Awake(); |
| 10 | 21 | | contentModerationButton.onClick.AddListener(() => OnContentModerationPressed?.Invoke()); |
| 10 | 22 | | } |
| | 23 | |
|
| | 24 | | public override void Dispose() |
| | 25 | | { |
| 10 | 26 | | contentModerationButton.onClick.RemoveAllListeners(); |
| 10 | 27 | | base.Dispose(); |
| 10 | 28 | | } |
| | 29 | |
|
| 0 | 30 | | public override void RefreshControl() { } |
| | 31 | |
|
| | 32 | | public void Show() => |
| 0 | 33 | | base.Show(); |
| | 34 | |
|
| | 35 | | public void Hide() => |
| 0 | 36 | | base.Hide(); |
| | 37 | |
|
| | 38 | | public void SetContentCategory(SceneContentCategory contentCategory) |
| | 39 | | { |
| | 40 | | switch (contentCategory) |
| | 41 | | { |
| | 42 | | case SceneContentCategory.ADULT: |
| 0 | 43 | | flagImage.sprite = adultFlagIcon; |
| 0 | 44 | | break; |
| | 45 | | case SceneContentCategory.RESTRICTED: |
| 0 | 46 | | flagImage.sprite = restrictedFlagIcon; |
| 0 | 47 | | break; |
| | 48 | | case SceneContentCategory.TEEN: |
| | 49 | | default: |
| 0 | 50 | | flagImage.sprite = teenFlagIcon; |
| | 51 | | break; |
| | 52 | | } |
| 0 | 53 | | } |
| | 54 | | } |
| | 55 | | } |