-
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
125 additions
and
138 deletions.
There are no files selected for viewing
48 changes: 34 additions & 14 deletions
48
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,38 @@ | ||
(ns status-im2.common.floating-button-page.floating-container.style | ||
(:require [react-native.platform :as platform])) | ||
(:require [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 | ||
:padding-horizontal 20 | ||
:padding-vertical 12} | ||
blur? (assoc :overflow :hidden) | ||
(and blur? platform/android?) (assoc :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] | ||
(cond-> {#_#_:background-color | ||
(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})) |
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