-
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.
- Loading branch information
Showing
3 changed files
with
124 additions
and
139 deletions.
There are no files selected for viewing
51 changes: 37 additions & 14 deletions
51
src/status_im2/common/floating_button_page/floating_container/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 |
---|---|---|
@@ -1,18 +1,41 @@ | ||
(ns status-im2.common.floating-button-page.floating-container.style | ||
(:require [react-native.platform :as platform])) | ||
(:require [quo.foundations.colors :as colors] | ||
[react-native.platform :as platform] | ||
[react-native.reanimated :as reanimated] | ||
[react-native.safe-area :as safe-area])) | ||
|
||
(def container | ||
{:width "100%" | ||
:margin-top :auto | ||
:align-self :flex-end}) | ||
(defn container | ||
[blur?] | ||
(cond-> {:width "100%" | ||
:margin-top :auto | ||
:align-self :flex-end} | ||
blur? (assoc :overflow :hidden) | ||
(not blur?) (assoc :padding-vertical 12 | ||
:padding-horizontal 20) | ||
platform/android? (assoc :padding-horizontal 20 | ||
:padding-vertical 12 | ||
:margin-left 20))) | ||
|
||
(def view-container | ||
(assoc container | ||
:padding-left 20 | ||
:padding-right 20 | ||
:padding-top 12 | ||
:padding-bottom 12)) | ||
(defn blur-inner-container | ||
[theme] | ||
(let [bg-color-key (if platform/android? :overlay-color :background-color)] | ||
(cond-> {bg-color-key (colors/theme-colors colors/white-70-blur | ||
colors/neutral-80-opa-1-blur | ||
theme)} | ||
platform/ios? (assoc :width "100%" | ||
:padding-horizontal 20 | ||
:padding-vertical 12)))) | ||
|
||
(def blur-container | ||
(merge container | ||
(when platform/android? {:margin-left 20}))) | ||
(defn get-margin-bottom | ||
[{:keys [show-background? keyboard-will-show?]}] | ||
(cond | ||
platform/android? 0 | ||
keyboard-will-show? (safe-area/get-top) | ||
(and show-background? keyboard-will-show?) (safe-area/get-bottom) | ||
:else (safe-area/get-bottom))) | ||
|
||
(defn animate-margin-bottom | ||
[margin-bottom-shared-value] | ||
(reanimated/apply-animations-to-style | ||
{:margin-bottom margin-bottom-shared-value} | ||
{:margin-top :auto})) |
82 changes: 25 additions & 57 deletions
82
src/status_im2/common/floating_button_page/floating_container/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
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