-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
1,405 additions
and
934 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
(ns quo2.components.avatars.group-avatar.view | ||
(:require [quo2.components.icon :as icon] | ||
[quo2.theme :as quo.theme] | ||
[quo2.theme :as theme] | ||
[quo2.foundations.colors :as colors] | ||
[react-native.core :as rn] | ||
[react-native.fast-image :as fast-image] | ||
[quo2.components.avatars.group-avatar.style :as style])) | ||
|
||
(def sizes | ||
{:icon {:small 12 | ||
:medium 16 | ||
:large 20} | ||
:container {:small 20 | ||
:medium 32 | ||
:large 48}}) | ||
{:icon {:x-small 12 | ||
:small 16 | ||
:medium 16 | ||
:large 20 | ||
:x-large 32} | ||
:container {:x-small 20 | ||
:small 28 | ||
:medium 32 | ||
:large 48 | ||
:x-large 80}}) | ||
|
||
;; TODO: this implementation does not support group display picture (can only display default group | ||
;; icon). | ||
(defn- view-internal | ||
[_] | ||
(fn [{:keys [color size theme]}] | ||
(fn [{:keys [size theme customization-color picture] | ||
:or {size :x-small | ||
customization-color :blue | ||
picture nil}}] | ||
(let [container-size (get-in sizes [:container size]) | ||
icon-size (get-in sizes [:icon size])] | ||
[rn/view | ||
{:style (style/container {:container-size container-size | ||
:customization-color color | ||
:customization-color customization-color | ||
:theme theme})} | ||
[icon/icon :i/group | ||
{:size icon-size | ||
:color colors/white-opa-70}]]))) | ||
(if picture | ||
[fast-image/fast-image | ||
{:source picture | ||
:style {:width container-size | ||
:height container-size}}] | ||
[icon/icon :i/members | ||
{:size icon-size | ||
:color colors/white-opa-70}])]))) | ||
|
||
(def view (quo.theme/with-theme view-internal)) | ||
(def view (theme/with-theme view-internal)) |
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.