Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
codemaster115 committed May 6, 2024
1 parent d74c8cb commit 40db16c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
18 changes: 8 additions & 10 deletions src/quo/components/notifications/activity_log/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
[utils.i18n :as i18n]))

(defn- activity-reply-text-input
[{:keys [on-update-reply max-reply-length valid-reply?]} reply-input set-reply-input]
Expand Down Expand Up @@ -146,14 +145,13 @@
label]))

(defmethod footer-item-view :status
[{:keys [label subtype blur?]} _ _]
(let [app-theme (rf/sub [:theme])]
[quo.theme/provider app-theme
[status-tags/status-tag
{:size :small
:label label
:status {:type subtype}
:blur? blur?}]]))
[{:keys [label subtype blur? theme]} _ _]
[quo.theme/provider theme
[status-tags/status-tag
{:size :small
:label label
:status {:type subtype}
:blur? blur?}]])

(defn- footer
[{:keys [replying? items] :as props}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
child)))

(defn- outgoing-contact-request-view
[{:keys [notification set-swipeable-height customization-color]}]
[{:keys [notification set-swipeable-height customization-color]} theme]
(let [{:keys [chat-id message last-message accepted]} notification
{:keys [contact-request-state] :as message} (or message last-message)]
(if accepted
Expand Down Expand Up @@ -89,19 +89,20 @@
:subtype :pending
:key :status-pending
:blur? true
:label (i18n/label :t/pending)}]
:label (i18n/label :t/pending)
:theme theme}]

constants/contact-request-message-state-declined
[{:type :status
:subtype :pending
:key :status-pending
:blur? true
:label (i18n/label :t/pending)}]

:label (i18n/label :t/pending)
:theme theme}]
nil)}])))

(defn- incoming-contact-request-view
[{:keys [notification set-swipeable-height customization-color]}]
[{:keys [notification set-swipeable-height customization-color]} theme]
(let [{:keys [id author message last-message]} notification
message (or message last-message)]
[quo/activity-log
Expand All @@ -122,14 +123,16 @@
:subtype :positive
:key :status-accepted
:blur? true
:label (i18n/label :t/accepted)}]
:label (i18n/label :t/accepted)
:theme theme}]

constants/contact-request-message-state-declined
[{:type :status
:subtype :negative
:key :status-declined
:blur? true
:label (i18n/label :t/declined)}]
:label (i18n/label :t/declined)
:theme theme}]

constants/contact-request-message-state-pending
[{:type :button
Expand All @@ -151,18 +154,19 @@
[{:keys [notification] :as props}]
(let [{:keys [author message last-message]} notification
{:keys [public-key]} (rf/sub [:multiaccount/contact])
{:keys [contact-request-state]} (or message last-message)]
{:keys [contact-request-state]} (or message last-message)
app-theme (rf/sub [:theme])]
[swipeable props
(cond
(= public-key author)
[outgoing-contact-request-view props]
[outgoing-contact-request-view props app-theme]

(= contact-request-state constants/contact-request-message-state-accepted)
[gesture/touchable-without-feedback
{:on-press (fn []
(rf/dispatch [:hide-popover])
(rf/dispatch [:chat.ui/start-chat author]))}
[incoming-contact-request-view props]]
[incoming-contact-request-view props app-theme]]

:else
[incoming-contact-request-view props])]))
[incoming-contact-request-view props app-theme])]))

0 comments on commit 40db16c

Please sign in to comment.