Skip to content

Commit 8dbcad9

Browse files
progress on styling
1 parent d4180ab commit 8dbcad9

File tree

9 files changed

+49
-46
lines changed

9 files changed

+49
-46
lines changed

Diff for: resources/images/icons2/20x20/[email protected]

271 Bytes
Loading

Diff for: resources/images/icons2/20x20/[email protected]

367 Bytes
Loading

Diff for: resources/images/icons2/20x20/[email protected]

363 Bytes
Loading

Diff for: resources/images/icons2/20x20/[email protected]

524 Bytes
Loading

Diff for: src/quo2/core.cljs

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
quo2.components.profile.select-profile.view
5454
quo2.components.reactions.reaction
5555
quo2.components.record-audio.record-audio.view
56+
quo2.components.record-audio.soundtrack.view
5657
quo2.components.selectors.disclaimer.view
5758
quo2.components.selectors.filter.view
5859
quo2.components.selectors.selectors
@@ -171,6 +172,7 @@
171172

172173
;;;; RECORD AUDIO
173174
(def record-audio quo2.components.record-audio.record-audio.view/record-audio)
175+
(def soundtrack quo2.components.record-audio.soundtrack.view/soundtrack)
174176

175177
;;;; SETTINGS
176178
(def privacy-option quo2.components.settings.privacy-option/card)

Diff for: src/status_im/ui/screens/chat/message/audio.cljs

+30-30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
(:require-macros [status-im.utils.views :refer [defview letsubs]])
33
(:require ["react-native-blob-util" :default ReactNativeBlobUtil]
44
[goog.string :as gstring]
5-
[quo.design-system.colors :as colors]
65
[reagent.core :as reagent]
76
[react-native.audio-toolkit :as audio]
87
[status-im.ui.components.animation :as anim]
@@ -12,7 +11,9 @@
1211
[status-im.ui.screens.chat.styles.message.audio :as style]
1312
[status-im.utils.platform :as platform]
1413
[status-im.utils.utils :as utils]
15-
[taoensso.timbre :as log]))
14+
[taoensso.timbre :as log]
15+
[quo2.foundations.colors :as colors]
16+
[quo2.core :as quo]))
1617

1718
(defonce player-ref (atom nil))
1819
(defonce current-player-message-id (atom nil))
@@ -192,18 +193,17 @@
192193

193194
(defn- play-pause-button
194195
[state-ref on-press]
195-
(let [color colors/blue]
196-
(if (= (:general @state-ref) :preparing)
197-
[react/view {:style (style/play-pause-container true)}
198-
[react/small-loading-indicator color]]
199-
[react/touchable-highlight {:on-press on-press}
200-
[icons/icon
201-
(case (:general @state-ref)
202-
:playing :main-icons/pause
203-
:main-icons/play)
204-
{:container-style (style/play-pause-container false)
205-
:accessibility-label :play-pause-audio-message-button
206-
:color color}]])))
196+
[react/touchable-opacity
197+
{:on-press on-press
198+
:style (style/play-pause-container)}
199+
[quo/icon
200+
(case (:general @state-ref)
201+
:preparing :i/loading
202+
:playing :i/play-audio
203+
:i/pause-audio)
204+
{:size 20
205+
:accessibility-label :play-pause-audio-message-button
206+
:color colors/white}]])
207207

208208
(defview message-content
209209
[{:keys [audio audio-duration-ms message-id]}]
@@ -233,27 +233,27 @@
233233
[react/text
234234
{:style {:typography :main-medium
235235
:margin-bottom 16}} (:error-msg @state)]
236-
[react/view (style/container width)
236+
[react/view {:style {:width 295
237+
:height 56
238+
:border-radius 12
239+
:border-width 1
240+
:padding 12
241+
:align-items :center
242+
:border-color (colors/theme-colors colors/neutral-20 colors/neutral-80)
243+
:background-color (colors/theme-colors colors/neutral-5 colors/neutral-80-opa-40)}}
237244
[react/view style/play-pause-slider-container
238245
[play-pause-button state #(play-pause base-params audio)]
239246
[react/view style/slider-container
240-
[slider/animated-slider
241-
(merge (style/slider)
242-
{:minimum-value 0
243-
:maximum-value (:duration @state)
244-
:value progress-anim
245-
:on-value-change #(seek base-params % false nil)
246-
:on-sliding-start #(seek (merge base-params {:slider-new-state-seeking? true})
247-
%
248-
true
249-
nil)
250-
:on-sliding-complete #(seek (merge base-params {:slider-new-state-seeking? false})
251-
%
252-
true
253-
nil)})]]]
247+
[quo/soundtrack
248+
{:audio-current-time-ms (:progress-ref base-params)
249+
:player-ref player-ref
250+
:seeking-audio? (:slider-seeking @state)}]]]
254251

255252
[react/view style/times-container
256-
[react/text {:style (style/timestamp)}
253+
[quo/text {:style (style/timestamp)
254+
:accessibility-label :audio-duration-label
255+
:weight :regular
256+
:size :paragraph-1}
257257
(let [time (cond
258258
(or (:slider-seeking @state) (> (:seek-to-ms @state) 0)) (:seek-to-ms @state)
259259
(#{:playing :paused :seeking} (:general @state)) @progress

Diff for: src/status_im/ui/screens/chat/styles/message/audio.cljs

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
(ns status-im.ui.screens.chat.styles.message.audio
2-
(:require [quo.design-system.colors :as colors]
2+
(:require [quo.design-system.colors :as colors-old]
33
[status-im.ui.screens.chat.styles.message.message :as message.style]
4-
[status-im.utils.platform :as platform]))
4+
[status-im.utils.platform :as platform]
5+
[quo2.foundations.colors :as colors]
6+
[quo2.theme :as theme]))
57

68
(defn container
79
[window-width]
@@ -23,17 +25,18 @@
2325
{:style (merge {:margin-left 12
2426
:height 34}
2527
(when platform/ios? {:margin-bottom 4}))
26-
:thumb-tint-color colors/white
27-
:minimum-track-tint-color colors/white
28-
:maximum-track-tint-color colors/white-transparent})
28+
:thumb-tint-color colors-old/white
29+
:minimum-track-tint-color colors-old/white
30+
:maximum-track-tint-color colors-old/white-transparent})
2931

3032
(defn play-pause-container
31-
[loading?]
32-
{:background-color colors/white-persist
33-
:width 28
34-
:height 28
35-
:padding (if loading? 4 2)
36-
:border-radius 15})
33+
[]
34+
{:background-color (get-in colors/customization [:blue (if (theme/dark?) 60 50)])
35+
:width 32
36+
:height 32
37+
:border-radius 16
38+
:align-items :center
39+
:justify-content :center})
3740

3841
(def times-container
3942
{:flex-direction :row
@@ -42,4 +45,4 @@
4245
(defn timestamp
4346
[]
4447
(merge (message.style/audio-message-timestamp-text)
45-
{:margin-left 40}))
48+
{:margin-left 40}))

Diff for: src/status_im/ui2/screens/chat/messages/message.cljs

+1-3
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,7 @@
291291
;; AUDIO
292292
(defn audio
293293
[message]
294-
[rn/view {:style (style/message-view message) :accessibility-label :audio-message}
295-
[rn/view {:style (style/message-view-content)}
296-
[message.audio/message-content message]]])
294+
[message.audio/message-content message])
297295

298296
(defn contact-request-status-pending
299297
[]

Diff for: src/status_im2/contexts/chat/messages/content/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
[not-implemented/not-implemented [old-message/sticker message-data]]
134134

135135
constants/content-type-audio
136-
[not-implemented/not-implemented [old-message/audio message-data]]
136+
[old-message/audio message-data]
137137

138138
constants/content-type-image
139139
[image/image-message 0 message-data context on-long-press]

0 commit comments

Comments
 (0)