Skip to content

Commit

Permalink
Merge branch 'develop' into issue-13832
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Sep 11, 2022
2 parents 3f1bbf0 + 3fc5c89 commit 1633da5
Show file tree
Hide file tree
Showing 29 changed files with 828 additions and 521 deletions.
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.combined
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pipeline {
/* mobile */
Apk: utils.pkgUrl(apk), Apke2e: utils.pkgUrl(apke2e),
iOS: utils.pkgUrl(ios), /*iOSe2e: utils.pkgUrl(iose2e),*/
Diawi: utils.utils.getEnv(ios, 'DIAWI_URL'),
Diawi: utils.getEnv(ios, 'DIAWI_URL'),
/* upload the sha256 checksums file too */
SHA: s3.uploadArtifact(sha),
]
Expand Down
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.ios
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pipeline {
/* e2e builds get tested in SauceLabs */
if (utils.isE2EBuild()) {
env.SAUCE_URL = ios.uploadToSauceLabs()
} else {
} else if (!utils.isReleaseBuild()) {
env.DIAWI_URL = ios.uploadToDiawi()
}
} }
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
{:target :react-native
:output-dir "app"
:init-fn status-im.core/init
;; When false, the Shadow-CLJS watcher won't automatically refresh
;; the target files (a.k.a hot reload). When false, you can manually
;; reload by calling `shadow.cljs.devtools.api/watch-compile-all!`.
:devtools {:autobuild #shadow/env ["SHADOW_AUTOBUILD_ENABLED" :default true :as :bool]}
:dev {:devtools {:after-load status-im.reloader/reload
:build-notify status-im.reloader/build-notify
:preloads [re-frisk-remote.preload]}
Expand Down
2 changes: 2 additions & 0 deletions src/mocks/js_dependencies.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
:View {}
:RefreshControl {}
:AppState {}
:Alert {:alert (fn [])}
:FlatList {}
:SectionList {}
:Text {}
Expand Down Expand Up @@ -136,6 +137,7 @@
:setDefaultOptions identity
:setRoot identity
:dismissOverlay #(js/Promise.resolve)
:showOverlay identity
:setLazyComponentRegistrator identity
:pop identity
:push identity
Expand Down
78 changes: 37 additions & 41 deletions src/quo2/components/community/community_card_view.cljs
Original file line number Diff line number Diff line change
@@ -1,49 +1,45 @@
(ns quo2.components.community.community-card-view
(:require
[quo2.components.community.community-view :as community-view]
[status-im.communities.core :as communities]
[status-im.utils.handlers :refer [>evt <sub]]
[status-im.utils.handlers :refer [<sub]]
[status-im.ui.components.react :as react]
[status-im.ui.screens.communities.styles :as styles]
[status-im.ui.screens.communities.community :as community]
[status-im.ui.screens.communities.icon :as communities.icon]))

(defn community-card-view-item [{:keys [id name description locked
status tokens cover tags featured] :as community}]
(defn community-card-view-item
[{:keys [name description locked
status tokens cover tags featured] :as community} on-press]
(let [width (* (<sub [:dimensions/window-width]) 0.90)]
[react/view {:style (merge (styles/community-card 20)
{:margin-bottom 16}
(if featured
{:margin-right 12
:width width}
{:flex 1
:margin-horizontal 20}))}
[react/view {:style {:height 230
:border-radius 20}
:on-press (fn []
(>evt [::communities/load-category-states id])
(>evt [:dismiss-keyboard])
(>evt [:navigate-to :community {:community-id id}]))
:on-long-press #(>evt [:bottom-sheet/show-sheet
{:content (fn [] [community/community-actions community])}])}
[react/view
{:flex 1}
[react/view (styles/community-cover-container 40)
[react/image
{:source cover
:style
{:flex 1
:border-radius 20}}]]
[react/view (styles/card-view-content-container 12)
[react/view (styles/card-view-chat-icon 48)
[communities.icon/community-icon-redesign community 48]]
(when (= status :gated)
[react/view (styles/permission-tag-styles)
[community-view/permission-tag-container {:locked locked
:status status
:tokens tokens}]])
[community-view/community-title
{:title name
:description description}]
[community-view/community-stats-column :card-view]
[community-view/community-tags tags]]]]]))
[react/touchable-opacity {:on-press on-press}
[react/view {:style (merge (styles/community-card 20)
{:margin-bottom 16}
(if featured
{:margin-right 12
:width width}
{:flex 1
:margin-horizontal 20}))}
[react/view {:style {:height 230
:border-radius 20}
:on-press on-press}
[react/view
{:flex 1}
[react/view (styles/community-cover-container 40)
[react/image
{:source cover
:style
{:flex 1
:border-radius 20}}]]
[react/view (styles/card-view-content-container 12)
[react/view (styles/card-view-chat-icon 48)
[communities.icon/community-icon-redesign community 48]]
(when (= status :gated)
[react/view (styles/permission-tag-styles)
[community-view/permission-tag-container {:locked locked
:status status
:tokens tokens}]])
[community-view/community-title
{:title name
:description description}]
[community-view/community-stats-column :card-view]
[community-view/community-tags tags]]]]]]))

227 changes: 151 additions & 76 deletions src/quo2/components/notifications/activity_logs.cljs
Original file line number Diff line number Diff line change
@@ -1,81 +1,156 @@
(ns quo2.components.notifications.activity-logs
(:require [quo.react-native :as rn]
[quo2.foundations.colors :as colors]
[quo2.components.tags.status-tags :as status-tags]
[quo2.components.buttons.button :as quo2.button]
[quo2.components.buttons.button :as button]
[quo2.components.icon :as icon]
[quo2.components.markdown.text :as text]
[quo2.components.icon :as quo2.icons]))
[quo2.components.tags.status-tags :as status-tags]
[quo2.foundations.colors :as colors]))

(defn- activity-icon
[icon]
[rn/view {:height 32
:width 32
:border-radius 100
:margin-top 10
:border-width 1
:border-color colors/white-opa-5
:flex-direction :column
:align-items :center
:justify-content :center}
[icon/icon icon {:color colors/white}]])

(defn- activity-unread-dot
[]
[rn/view {:margin-left 14
:margin-right 6
:background-color colors/primary-50
:width 8
:height 8
:border-radius 4}])

(defn- activity-context
[context]
(let [margin-top 4]
(into [rn/view {:flex 1
:flex-direction :row
:align-items :center
:flex-wrap :wrap
:margin-top (+ 4 (- margin-top))}]
(map-indexed (fn [index detail]
^{:key index}
[rn/view {:margin-right 4
:margin-top margin-top}
(if (string? detail)
[text/text {:size :paragraph-2}
detail]
detail)])
context))))

(defn- activity-message
[{:keys [title body]}]
[rn/view {:border-radius 12
:margin-top 12
:padding-horizontal 12
:padding-vertical 8
:background-color colors/white-opa-5
:flex 1
:flex-direction :column}
(when title
[text/text {:size :paragraph-2
:style {:color colors/white-opa-40}}
title])
(if (string? body)
[text/text {:style {:color colors/white}
:size :paragraph-1}
body]
body)])

(defn activity-logs [_]
(fn [{:keys [title
button-1
button-2
icon
unread
status
message
timestamp]}]
[rn/view {:flex-direction :row
:flex 1
:border-radius 16
:padding-top 8
:padding-horizontal 12
:padding-bottom 12
:background-color (when unread
(defn- activity-buttons
[button-1 button-2]
(let [size 24
common-style {:padding-top 3
:padding-right 8
:padding-bottom 4
:padding-left 8}]
[rn/view {:margin-top 12
:flex 1
:flex-direction :row
:align-items :flex-start}
(when button-1
[button/button (-> button-1
(assoc :size size)
(assoc-in [:style :margin-right] 8)
(update :style merge common-style))
(:label button-1)])
(when button-2
[button/button (-> button-2
(assoc :size size)
(update :style merge common-style))
(:label button-2)])]))

(defn- activity-status
[status]
[rn/view {:margin-top 12
:align-items :flex-start
:flex 1}
[status-tags/status-tag {:size :small
:status status}]])

(defn- activity-title
[title]
[text/text {:weight :semi-bold
:style {:color colors/white}
:size :paragraph-1}
title])

(defn- activity-timestamp
[timestamp]
[rn/view {:margin-left 8}
[text/text {:size :label
:style {:text-transform :none
:color colors/neutral-40}}
timestamp]])

(defn activity-log
[{:keys [button-1
button-2
icon
message
status
context
timestamp
title
unread?]}]
[rn/view {:flex-direction :row
:flex 1
:border-radius 16
:padding-top 8
:padding-horizontal 12
:padding-bottom 12
:background-color (when unread?
colors/primary-50-opa-10)}
[rn/view {:height 32
:width 32
:border-radius 100
:margin-top 8
:background-color colors/neutral-80-opa-60
:flex-direction :column
:align-items :center
:justify-content :center}
[quo2.icons/icon icon {:color colors/white}]]
[rn/view {:flex-direction :column
:padding-left 8
:flex 1}
[rn/view {:flex 1
:flex-wrap :wrap}
[rn/view {:flex-direction :row}
[text/text {:weight :semi-bold
:style {:color colors/white}
:size :paragraph-1}
title]
[rn/view {:margin-left 8
:margin-top 5}
[text/text {:size :label
:style {:text-transform :none
:color colors/neutral-40}} timestamp]]]]
(when message
[rn/view {:border-radius 12
:margin-top 13
:padding-horizontal 12
:padding-vertical 8
:background-color :red}
[text/text {:style {:color colors/white}
:size :paragraph-1}
message]])
(when status
[rn/view {:padding-top 10
:align-items :flex-start}
[status-tags/status-tag {:size :small
:override-theme :dark
:status status}]])
(when (or button-1 button-2)
[rn/view {:padding-top 10
:flex 1
:flex-direction :row
:align-items :flex-start}
(when button-1
[quo2.button/button
(assoc button-1
:override-them :dark
:style {:margin-right 8})
(:label button-1)])
(when button-2
[quo2.button/button
(assoc button-2
:override-theme
:dark)
(:label button-2)])])]]))
[activity-icon icon]
[rn/view {:flex-direction :column
:padding-left 8
:flex 1}
[rn/view {:flex 1
:align-items :center
:flex-direction :row}
[rn/view {:flex 1
:align-items :center
:flex-direction :row}
[rn/view {:flex-shrink 1}
[activity-title title]]
[activity-timestamp timestamp]]
(when unread?
[activity-unread-dot])]
(when context
[activity-context context])
(when message
[activity-message message])
(cond
(some? status)
[activity-status status]

(or button-1 button-2)
[activity-buttons button-1 button-2])]])
8 changes: 5 additions & 3 deletions src/quo2/components/tags/context_tags.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@

(defn group-avatar-tag [_ _]
(fn [label opts]
[base-tag {:style {:padding-left 3}}
[base-tag (-> opts
(select-keys [:override-theme :style])
(assoc-in [:style :padding-left] 3))
[group-avatar/group-avatar opts]
[text/text {:weight :medium
:size :paragraph-2}

:size :paragraph-2
:style (:text-style opts)}
(str " " label)]]))

(defn public-key-tag [_ _]
Expand Down
2 changes: 1 addition & 1 deletion src/quo2/components/tags/status_tags.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

(def small-container-style
(merge default-container-style
{:padding-horizontal 7
{:padding-horizontal 8
:padding-vertical 3}))

(def large-container-style
Expand Down
Loading

0 comments on commit 1633da5

Please sign in to comment.