Skip to content

Commit 4ff261f

Browse files
committed
Add drawer
1 parent 2bfb908 commit 4ff261f

File tree

5 files changed

+95
-14
lines changed

5 files changed

+95
-14
lines changed

src/quo2/components/list_items/menu_item.cljs

+11-11
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@
3030
(when on-press
3131
{:on-press on-press}))
3232
[rn/view
33-
{:style {:flex-direction :row
34-
:flex-grow 0
35-
:flex-shrink 1
36-
:padding-horizontal 20
37-
:align-items :center}}
33+
{:style (cond-> {:flex-direction :row
34+
:flex-grow 0
35+
:flex-shrink 1
36+
:align-items :center}
37+
icon (assoc :padding-horizontal 20))}
3838
[rn/view
39-
{:style {:width 20
40-
:height 20
41-
:align-items :center
42-
:justify-content :center
43-
:margin-right 12}}
44-
[icons/icon icon {:color icon-color}]]
39+
{:style (cond-> {:width 20
40+
:height 20
41+
:align-items :center
42+
:justify-content :center}
43+
icon (assoc :margin-right 12))}
44+
(when icon [icons/icon icon {:color icon-color}])]
4545
[rn/view
4646
[text/text
4747
{:weight :medium
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(ns status-im2.common.mute-chat-drawer.style
2+
(:require [quo2.foundations.colors :as colors]))
3+
4+
(defn header-text []
5+
{:margin-left 20
6+
:margin-bottom 10
7+
:color (colors/theme-colors colors/neutral-50 colors/neutral-40)})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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]))}]]))

status-go-version.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"owner": "status-im",
55
"repo": "status-go",
66
"version": "mute-for-specific-time",
7-
"commit-sha1": "0d7c46e830810d76f3a645c2e17a734e40f967c2",
8-
"src-sha256": "0kp1w6v1c2vxqcq54sap52ddm83filr04lmhbvaxq4qjis439nl0"
7+
"commit-sha1": "3bc0b0d5274c8813f36d118c0f6f5df9f9c505cd",
8+
"src-sha256": "197x90zfrk7mh0g8zg5xgx7i8r1yp2qcq98bnnij9acmbbj2ky9j"
99
}

translations/en.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -1975,5 +1975,12 @@
19751975
"strength-divider-weak-label": "Weak",
19761976
"strength-divider-okay-label": "Okay",
19771977
"strength-divider-strong-label": "Strong",
1978-
"strength-divider-very-strong-label": "Very strong"
1978+
"strength-divider-very-strong-label": "Very strong",
1979+
"mute-for-15-mins": "For 15 min",
1980+
"mute-for-1-hour": "For 1 hour",
1981+
"mute-for-8-hours": "For 8 hours",
1982+
"mute-for-1-week": "For 7 days",
1983+
"mute-till-unmute": "Until you turn it back on",
1984+
"mute-channel": "Mute channel",
1985+
"mute-for-1-min": "For 1 min"
19791986
}

0 commit comments

Comments
 (0)