-
Notifications
You must be signed in to change notification settings - Fork 984
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 milad/16334
- Loading branch information
Showing
7 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/quo2/components/notifications/activity_logs_photos/style.cljs
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns quo2.components.notifications.activity-logs-photos.style) | ||
|
||
(def photos-container | ||
{:flex 1 | ||
:height 40 | ||
:flex-direction :row}) | ||
|
||
(defn photo | ||
[index] | ||
{:width 40 | ||
:height 40 | ||
:border-radius 10 | ||
:margin-left (if (= index 0) 0 8)}) |
14 changes: 14 additions & 0 deletions
14
src/quo2/components/notifications/activity_logs_photos/view.cljs
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns quo2.components.notifications.activity-logs-photos.view | ||
(:require [react-native.core :as rn] | ||
[quo2.components.notifications.activity-logs-photos.style :as style])) | ||
|
||
(defn view | ||
[{:keys [photos]}] | ||
[rn/view {:style style/photos-container} | ||
(map-indexed | ||
(fn [index photo] | ||
^{:key index} | ||
[rn/image | ||
{:source photo | ||
:style (style/photo index)}]) | ||
photos)]) |
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
53 changes: 53 additions & 0 deletions
53
src/status_im2/contexts/quo_preview/notifications/activity_logs_photos.cljs
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
(ns status-im2.contexts.quo-preview.notifications.activity-logs-photos | ||
(:require [quo2.core :as quo] | ||
[react-native.core :as rn] | ||
[reagent.core :as reagent] | ||
[quo2.foundations.colors :as colors] | ||
[status-im2.common.resources :as resources] | ||
[status-im2.contexts.quo-preview.preview :as preview])) | ||
|
||
(def descriptor | ||
[{:label "Photos Count:" | ||
:key :count | ||
:type :select | ||
:options [{:key 1 | ||
:value "1"} | ||
{:key 2 | ||
:value "2"} | ||
{:key 3 | ||
:value "3"} | ||
{:key 4 | ||
:value "4"} | ||
{:key 5 | ||
:value "5"} | ||
{:key 6 | ||
:value "6"}]}]) | ||
|
||
(def mock-photos | ||
[(resources/get-mock-image :photo1) | ||
(resources/get-mock-image :photo2) | ||
(resources/get-mock-image :photo3) | ||
(resources/get-mock-image :photo1) | ||
(resources/get-mock-image :photo2) | ||
(resources/get-mock-image :photo3)]) | ||
|
||
(defn cool-preview | ||
[] | ||
(let [state (reagent/atom {:count 1})] | ||
(fn [] | ||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!} | ||
[rn/view {:padding-bottom 150} | ||
[preview/customizer state descriptor] | ||
[rn/view | ||
[quo/activity-logs-photos {:photos (take (:count @state) mock-photos)}]]]]))) | ||
|
||
(defn preview-activity-logs-photos | ||
[] | ||
[rn/view | ||
{:background-color (colors/theme-colors colors/white colors/neutral-95) | ||
:flex 1} | ||
[rn/flat-list | ||
{:flex 1 | ||
:keyboard-should-persist-taps :always | ||
:header [cool-preview] | ||
:key-fn str}]]) |
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