|
| 1 | +(ns status-im2.common.mute-chat-drawer.view |
| 2 | + (:require [utils.i18n :as i18n] |
| 3 | + [quo2.core :as quo] |
| 4 | + [react-native.core :as rn] |
| 5 | + [status-im2.constants :as constants] |
| 6 | + [utils.re-frame :as rf] |
| 7 | + [status-im2.common.mute-chat-drawer.style :as style])) |
| 8 | + |
| 9 | +(defn hide-sheet-and-dispatch |
| 10 | + [event] |
| 11 | + (rf/dispatch [:bottom-sheet/hide]) |
| 12 | + (rf/dispatch event)) |
| 13 | + |
| 14 | +(defn mute-chat-drawer |
| 15 | + [chat-id accessibility-label] |
| 16 | + [rn/view {:accessibility-label accessibility-label} |
| 17 | + [quo/text |
| 18 | + {:weight :medium |
| 19 | + :size :paragraph-2 |
| 20 | + :style (style/header-text)} (i18n/label :t/mute-channel)] |
| 21 | + [quo/menu-item |
| 22 | + {:type :transparent |
| 23 | + :title (i18n/label :t/mute-for-15-mins) |
| 24 | + :icon-bg-color :transparent |
| 25 | + :container-padding-vertical 12 |
| 26 | + :title-column-style {:margin-left 2} |
| 27 | + :on-press (fn [] |
| 28 | + (hide-sheet-and-dispatch [:chat.ui/mute chat-id true |
| 29 | + constants/mute-for-15-mins-type]))}] |
| 30 | + [quo/menu-item |
| 31 | + {:type :transparent |
| 32 | + :title (i18n/label :t/mute-for-1-hour) |
| 33 | + :icon-bg-color :transparent |
| 34 | + :container-padding-vertical 12 |
| 35 | + :title-column-style {:margin-left 2} |
| 36 | + :on-press (fn [] |
| 37 | + (hide-sheet-and-dispatch [:chat.ui/mute chat-id true |
| 38 | + constants/mute-for-1-hour-type]))}] |
| 39 | + [quo/menu-item |
| 40 | + {:type :transparent |
| 41 | + :title (i18n/label :t/mute-for-8-hours) |
| 42 | + :icon-bg-color :transparent |
| 43 | + :container-padding-vertical 12 |
| 44 | + :title-column-style {:margin-left 2} |
| 45 | + :on-press (fn [] |
| 46 | + (hide-sheet-and-dispatch [:chat.ui/mute chat-id true |
| 47 | + constants/mute-for-8-hours-type]))}] |
| 48 | + [quo/menu-item |
| 49 | + {:type :transparent |
| 50 | + :title (i18n/label :t/mute-for-1-week) |
| 51 | + :icon-bg-color :transparent |
| 52 | + :container-padding-vertical 12 |
| 53 | + :title-column-style {:margin-left 2} |
| 54 | + :on-press (fn [] |
| 55 | + (hide-sheet-and-dispatch [:chat.ui/mute chat-id true |
| 56 | + constants/mute-for-1-week]))}] |
| 57 | + [quo/menu-item |
| 58 | + {:type :transparent |
| 59 | + :title (i18n/label :t/mute-till-unmute) |
| 60 | + :icon-bg-color :transparent |
| 61 | + :container-padding-vertical 12 |
| 62 | + :title-column-style {:margin-left 2} |
| 63 | + :on-press (fn [] |
| 64 | + (hide-sheet-and-dispatch [:chat.ui/mute chat-id true |
| 65 | + constants/mute-till-unmuted]))}]]) |
0 commit comments