-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into issue-13832
- Loading branch information
Showing
29 changed files
with
828 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]]]]]])) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.