added empty state illustrations image for pinned messages

This commit is contained in:
John Ngei 2024-02-02 23:24:34 +01:00 committed by GitHub
parent 9c884d1173
commit 154fbb156d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 26 additions and 22 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -85,7 +85,10 @@
:dark (js/require "../resources/images/ui2/no-permissions-dark.png")} :dark (js/require "../resources/images/ui2/no-permissions-dark.png")}
:sweating-man :sweating-man
{:light (js/require "../resources/images/ui2/sweating-man-light.png") {:light (js/require "../resources/images/ui2/sweating-man-light.png")
:dark (js/require "../resources/images/ui2/sweating-man-dark.png")}}) :dark (js/require "../resources/images/ui2/sweating-man-dark.png")}
:no-pinned-messages
{:light (js/require "../resources/images/ui2/no-pinned-messages-light.png")
:dark (js/require "../resources/images/ui2/no-pinned-messages-dark.png")}})
(def mock-images (def mock-images
{:bored-ape (js/require "../resources/images/mock2/bored-ape.png") {:bored-ape (js/require "../resources/images/mock2/bored-ape.png")

View File

@ -2,9 +2,11 @@
(:require (:require
[quo.core :as quo] [quo.core :as quo]
[quo.foundations.colors :as colors] [quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn] [react-native.core :as rn]
[react-native.fast-image :as fast-image] [react-native.fast-image :as fast-image]
[react-native.gesture :as gesture] [react-native.gesture :as gesture]
[status-im.common.resources :as resources]
[status-im.contexts.chat.messenger.menus.pinned-messages.style :as style] [status-im.contexts.chat.messenger.menus.pinned-messages.style :as style]
[status-im.contexts.chat.messenger.messages.content.view :as message] [status-im.contexts.chat.messenger.messages.content.view :as message]
[utils.i18n :as i18n] [utils.i18n :as i18n]
@ -24,26 +26,18 @@
[message/message message context (atom false)]) [message/message message context (atom false)])
(defn empty-pinned-messages-state (defn empty-pinned-messages-state
[{:keys [community?]}] [{:keys [theme community?]}]
[rn/view {:style style/no-pinned-messages-container} [rn/view {:style style/no-pinned-messages-container}
[rn/view {:style style/no-pinned-messages-icon} [quo/empty-state
[quo/icon :i/placeholder]] {:blur? false
[rn/view {:style style/no-pinned-messages-content} :image (resources/get-themed-image :no-pinned-messages theme)
[quo/text :title (i18n/label :t/no-pinned-messages)
{:size :paragraph-1 :description (i18n/label (if community?
:weight :semi-bold :t/no-pinned-messages-community-desc
:style style/no-pinned-messages-title} :t/no-pinned-messages-desc))}]])
(i18n/label :t/no-pinned-messages)]
[quo/text
{:size :paragraph-2
:style style/no-pinned-messages-text}
(i18n/label
(if community?
:t/no-pinned-messages-community-desc
:t/no-pinned-messages-desc))]]])
(defn pinned-messages (defn f-pinned-messages
[chat-id] [{:keys [theme chat-id]}]
(let [pinned (rf/sub [:chats/pinned-sorted-list chat-id]) (let [pinned (rf/sub [:chats/pinned-sorted-list chat-id])
render-data (rf/sub [:chats/current-chat-message-list-view-context :in-pinned-view]) render-data (rf/sub [:chats/current-chat-message-list-view-context :in-pinned-view])
current-chat (rf/sub [:chats/chat-by-id chat-id]) current-chat (rf/sub [:chats/chat-by-id chat-id])
@ -83,4 +77,11 @@
:key-fn list-key-fn :key-fn list-key-fn
:separator [quo/separator {:style {:margin-vertical 8}}]}] :separator [quo/separator {:style {:margin-vertical 8}}]}]
[empty-pinned-messages-state [empty-pinned-messages-state
{:community? (boolean community)}])])) {:community? (boolean community)
:theme theme}])]))
(defn- internal-pinned-messages
[params]
[:f> f-pinned-messages params])
(def view (quo.theme/with-theme internal-pinned-messages))

View File

@ -128,4 +128,4 @@
(rf/defn show-pins-bottom-sheet (rf/defn show-pins-bottom-sheet
{:events [:pin-message/show-pins-bottom-sheet]} {:events [:pin-message/show-pins-bottom-sheet]}
[cofx chat-id] [cofx chat-id]
(navigation/show-bottom-sheet cofx {:content (fn [] [pinned-messages-menu/pinned-messages chat-id])})) (navigation/show-bottom-sheet cofx {:content (fn [] [pinned-messages-menu/view {:chat-id chat-id}])}))

View File

@ -2042,7 +2042,7 @@
"shell-placeholder-title": "Your open tabs will be here", "shell-placeholder-title": "Your open tabs will be here",
"shell-placeholder-subtitle": "Jump between your communities, messages,\nwallet accounts and browser tabs", "shell-placeholder-subtitle": "Jump between your communities, messages,\nwallet accounts and browser tabs",
"no-pinned-messages-desc": "This chat doesnt have any\npinned messages.", "no-pinned-messages-desc": "This chat doesnt have any\npinned messages.",
"no-pinned-messages-community-desc": "This channel doesnt have any\npinned messages.", "no-pinned-messages-community-desc": "Just keep pinning, just keep pinning\nWhat do we do? We pin, pin, pin",
"invite-friends-to-status": "Invite friends to Status", "invite-friends-to-status": "Invite friends to Status",
"share-invite-link": "Share an invite link", "share-invite-link": "Share an invite link",
"pending-requests": "Pending requests", "pending-requests": "Pending requests",