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