Skip to content

Commit 582c484

Browse files
alwxyevh-berdnyk
authored andcommitted
Style fixes for pinned messages (#18061)
* Style fixes for pinned messages * Small code style update
1 parent 97f8247 commit 582c484

File tree

3 files changed

+46
-32
lines changed

3 files changed

+46
-32
lines changed

src/status_im2/contexts/chat/menus/pinned_messages/style.cljs

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
(ns status-im2.contexts.chat.menus.pinned-messages.style
22
(:require
3-
[quo.foundations.colors :as colors]))
3+
[quo.foundations.colors :as colors]
4+
[react-native.platform :as platform]))
45

56
(defn heading
67
[community?]
7-
{:margin-horizontal 20
8-
:margin-bottom (when-not community? 24)})
8+
{:padding-horizontal 20
9+
:margin-bottom (when-not community? 12)})
910

1011
(defn heading-container
1112
[]
@@ -31,23 +32,28 @@
3132
:margin-right 8
3233
:color (colors/theme-colors colors/neutral-60 colors/neutral-20)})
3334

34-
(defn list-footer
35-
[bottom-inset]
36-
{:height bottom-inset})
37-
38-
(defn no-pinned-messages-container
39-
[bottom-inset]
35+
(def no-pinned-messages-container
4036
{:justify-content :center
4137
:align-items :center
42-
:margin-top 20
43-
:margin-bottom bottom-inset})
38+
:margin 12
39+
:margin-bottom (when platform/android? 12)})
4440

4541
(def no-pinned-messages-icon
46-
{:width 120
47-
:height 120
42+
{:width 80
43+
:height 80
4844
:justify-content :center
4945
:align-items :center
5046
:border-width 1})
5147

48+
(def no-pinned-messages-content
49+
{:margin-top 12})
50+
51+
(def no-pinned-messages-title
52+
{:text-align :center})
53+
5254
(def no-pinned-messages-text
53-
{:margin-top 20})
55+
{:text-align :center
56+
:margin-top 2})
57+
58+
(def list-footer
59+
{:height (when platform/android? 12)})

src/status_im2/contexts/chat/menus/pinned_messages/view.cljs

+24-16
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[react-native.core :as rn]
66
[react-native.fast-image :as fast-image]
77
[react-native.gesture :as gesture]
8-
[react-native.safe-area :as safe-area]
98
[status-im2.contexts.chat.menus.pinned-messages.style :as style]
109
[status-im2.contexts.chat.messages.content.view :as message]
1110
[utils.i18n :as i18n]
@@ -24,17 +23,36 @@
2423
[message _ _ context]
2524
[message/message message context (atom false)])
2625

26+
(defn empty-pinned-messages-state
27+
[{:keys [community?]}]
28+
[rn/view {:style style/no-pinned-messages-container}
29+
[rn/view {:style style/no-pinned-messages-icon}
30+
[quo/icon :i/placeholder]]
31+
[rn/view {:style style/no-pinned-messages-content}
32+
[quo/text
33+
{:size :paragraph-1
34+
:weight :semi-bold
35+
:style style/no-pinned-messages-title}
36+
(i18n/label :t/no-pinned-messages)]
37+
[quo/text
38+
{:size :paragraph-2
39+
:style style/no-pinned-messages-text}
40+
(i18n/label
41+
(if community?
42+
:t/no-pinned-messages-community-desc
43+
:t/no-pinned-messages-desc))]]])
44+
2745
(defn pinned-messages
2846
[chat-id]
2947
(let [pinned (rf/sub [:chats/pinned-sorted-list chat-id])
3048
render-data (rf/sub [:chats/current-chat-message-list-view-context :in-pinned-view])
3149
current-chat (rf/sub [:chat-by-id chat-id])
3250
{:keys [community-id]} current-chat
3351
community (rf/sub [:communities/community community-id])
34-
bottom-inset (safe-area/get-bottom)
3552
community-images (rf/sub [:community/images community-id])]
3653
[gesture/scroll-view
37-
{:accessibility-label :pinned-messages-menu}
54+
{:accessibility-label :pinned-messages-menu
55+
:bounces false}
3856
[:<>
3957
[quo/text
4058
{:size :heading-2
@@ -61,18 +79,8 @@
6179
{:data pinned
6280
:render-data render-data
6381
:render-fn message-render-fn
64-
:footer [rn/view {:style (style/list-footer bottom-inset)}]
82+
:footer [rn/view {:style style/list-footer}]
6583
:key-fn list-key-fn
6684
:separator [quo/separator {:style {:margin-vertical 8}}]}]
67-
[rn/view {:style (style/no-pinned-messages-container bottom-inset)}
68-
[rn/view {:style style/no-pinned-messages-icon}
69-
[quo/icon :i/placeholder]]
70-
[quo/text
71-
{:weight :semi-bold
72-
:style style/no-pinned-messages-text}
73-
(i18n/label :t/no-pinned-messages)]
74-
[quo/text {:size :paragraph-2}
75-
(i18n/label
76-
(if community
77-
:t/no-pinned-messages-community-desc
78-
:t/no-pinned-messages-desc))]])]))
85+
[empty-pinned-messages-state
86+
{:community? (boolean community)}])]))

translations/en.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2013,8 +2013,8 @@
20132013
"you-must-now-hold": "You must now hold:",
20142014
"you-must-always-hold": "You must always hold:",
20152015
"shell-placeholder-title": "Your apps will run here",
2016-
"no-pinned-messages-desc": "This chat doesn't have any pinned messages.",
2017-
"no-pinned-messages-community-desc": "This channel doesn't have any pinned messages.",
2016+
"no-pinned-messages-desc": "This chat doesnt have any\npinned messages.",
2017+
"no-pinned-messages-community-desc": "This channel doesnt have any\npinned messages.",
20182018
"shell-placeholder-subtitle": "Open tabs of your communities, messages,\nwallet account and browser windows",
20192019
"invite-friends-to-status": "Invite friends to Status",
20202020
"share-invite-link": "Share an invite link",

0 commit comments

Comments
 (0)