-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add locked input component, tests, styles Add translations Add duration icons Remove extra code Use theme from context Add missing code Update styles Update gas icon (previous was not reacting to size change) Use text from components instead of rn/text Fix styling for transaction sheet preview, locked input & account selector components Fix purple 50 color since it doesn't match design Work on PR suggestions Fix style to be pixel-perfect Comment-in tests Fix style Add docs for locked-input component Remove extra code Fixed design discrepancies Fix font-weight Fix purple color in account selector Remove unused icons Fix linter Fix tests fix for airplane mode [161108] Optimize message styling when there's multiple mentions on top of each other (#16505) Fix failing mute till test (#16453) fix navigation to community from discover communities screen (#16702) Update version to 0.162.3 [#16703] The display name is not resolved in chats for user sender after relogin (#16704) Mute community * mute and unmute community status-im/status-go@dfdaa72...e6187ae * mute and unmute community and all community chats status-im/status-go@dfdaa72...3abc86e * updated statu-go status-im/status-go@dfdaa72...919123e * refactored mute chat drawer status-im/status-go@d3e650d...3af0b17 * refactored mute chat drawer status-im/status-go@dfdaa72...3af0b17 * fixing mute channels * fixed mute community channels * update community chats mute status status-im/status-go@dfdaa72...dc50ac2 * added mute and unmute community toast status-im/status-go@dfdaa72...c06f7a6 * unmute community when atleast one community channel is unmuted status-im/status-go@dfdaa72...e691c47 * updated status-go status-im/status-go@b2e56f5...c52718c * updated status-go version v0.162.5 [Fix] Scroll to bottom on editing message (#16630) This commit fixes (by skipping) the scroll to the bottom of messages when the user edits a message and sends it. Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Refactor `Bottom Sheet` to use Theme Context (#16710) This commit updates "Bottom Sheet" to use the theme (for theme provider) provided on the bottom sheet args when dispatching. This will ensure the theme is passed down to its child components where it can consume and render based on the theme. Changes done: In Bottom Sheet: - Fix Bottom Sheet to use the correct background colour (neutral-95) for dark mode (as per Figma) - Fix the Icon colour for danger in light mode - Updated Quo2 Preview to provide an option for the bottom sheet theme In Action Drawer: - Refactor the Action Drawer component to consume theme context Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Revert extra commits Revert extra commits Revert extra changes
- Loading branch information
1 parent
bf50217
commit 40a7c8a
Showing
14 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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.
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.
24 changes: 24 additions & 0 deletions
24
src/quo2/components/inputs/locked_input/component_spec.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,24 @@ | ||
(ns quo2.components.inputs.locked-input.component-spec | ||
(:require [quo2.components.inputs.locked-input.view :as locked-input] | ||
[test-helpers.component :as h])) | ||
|
||
(h/describe "Locked Input" | ||
(h/test "renders label, value and icon" | ||
(h/render [locked-input/locked-input | ||
{:label-text "Label" | ||
:icon :i/gas} "Value"]) | ||
(h/is-truthy (h/query-by-text "Label")) | ||
(h/is-truthy (h/get-by-text "Value"))) | ||
|
||
(h/test "no value" | ||
(h/render [locked-input/locked-input | ||
{:label-text "Label" | ||
:icon :i/gas}]) | ||
(h/is-null (h/query-by-text "Value")) | ||
(h/is-truthy (h/get-by-text "Label"))) | ||
|
||
(h/test "no emoji" | ||
(h/render [locked-input/locked-input | ||
{:label-text "Label"} "Value"]) | ||
(h/is-truthy (h/get-by-text "Label")) | ||
(h/is-truthy (h/get-by-text "Value")))) |
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,20 @@ | ||
(ns quo2.components.inputs.locked-input.style | ||
(:require [quo2.foundations.colors :as colors])) | ||
|
||
(defn info-box-container | ||
[theme] | ||
{:flex-direction :row | ||
:border-radius 12 | ||
:align-items :center | ||
:background-color (colors/theme-colors colors/neutral-10 | ||
colors/neutral-80-opa-80 | ||
theme) | ||
:height 40 | ||
:padding-horizontal 12 | ||
:padding-vertical 9 | ||
:margin-top 4}) | ||
|
||
(defn info-box-label | ||
[theme] | ||
{:color (colors/theme-colors colors/black colors/white theme) | ||
:margin-left 8}) |
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,44 @@ | ||
(ns quo2.components.inputs.locked-input.view | ||
(:require [react-native.core :as rn] | ||
[quo2.foundations.colors :as colors] | ||
[quo2.components.icon :as icons] | ||
[quo2.components.inputs.locked-input.style :as style] | ||
[quo2.theme :as quo.theme] | ||
[quo2.components.markdown.text :as text])) | ||
|
||
(defn- info-box | ||
[{:keys [icon value-text theme]}] | ||
[rn/view | ||
{:style (style/info-box-container theme)} | ||
[rn/view | ||
(when icon | ||
[icons/icon icon | ||
{:color (colors/theme-colors colors/neutral-50 | ||
colors/neutral-40 | ||
theme)}])] | ||
[text/text | ||
{:size :paragraph-1 | ||
:style (style/info-box-label theme)} value-text]]) | ||
|
||
(defn- locked-input-internal | ||
[{:keys [label-text icon style theme]} value] | ||
[rn/view {:style style} | ||
[text/text | ||
{:size :paragraph-2 | ||
:weight :medium | ||
:style {:color colors/neutral-40}} label-text] | ||
[info-box | ||
{:theme theme | ||
:icon icon | ||
:value-text value}]]) | ||
|
||
(def locked-input | ||
"Options: | ||
:label-text - string (default nil) - Text to display above the input | ||
:icon - keyword (default nil) - Icon to display in the info box | ||
:style - style map (default nil) - Override style for the container | ||
:theme - :light/:dark | ||
:value - string (default nil) - value to display in the info box" | ||
(quo.theme/with-theme locked-input-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
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
84 changes: 84 additions & 0 deletions
84
src/status_im2/contexts/quo_preview/transaction_sheet/transaction_sheet.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,84 @@ | ||
(ns status-im2.contexts.quo-preview.transaction-sheet.transaction-sheet | ||
(:require [quo2.components.tabs.account-selector :as acc-sel] | ||
[utils.i18n :as i18n] | ||
[quo2.foundations.colors :as colors] | ||
[react-native.core :as rn] | ||
[status-im2.contexts.quo-preview.tabs.segmented-tab] | ||
[quo2.components.tabs.segmented-tab :as quo2] | ||
[status-im2.contexts.shell.jump-to.utils :as utils] | ||
[quo2.components.inputs.locked-input.view :as locked-input] | ||
[quo2.components.markdown.text :as text])) | ||
|
||
(let [{:keys [width]} (utils/dimensions)] | ||
(def screen-width width)) | ||
(def account-selector-width (* 0.895 screen-width)) | ||
(def shared-selector-list-data | ||
{:show-label? false | ||
:transparent? false | ||
:style {:width account-selector-width | ||
:height 40}}) | ||
(def unique-selector-list-data | ||
[{:account-text "Drakaris account" | ||
:account-emoji "🔥"} | ||
{:account-text "Daenerys account" | ||
:account-emoji "👸"}]) | ||
(def selector-list-data | ||
(map #(merge % shared-selector-list-data) | ||
unique-selector-list-data)) | ||
|
||
(defn- render-account-selectors | ||
[item] | ||
[rn/view {:style {:margin-right 10}} | ||
[rn/touchable-opacity {:on-press #(js/alert (str "Pressed " (item :account-text)))} | ||
[acc-sel/account-selector item]]]) | ||
(defn preview-transaction-sheet | ||
[] | ||
[rn/view | ||
{:background-color (colors/theme-colors colors/white colors/neutral-90) | ||
:flex 1 | ||
:flex-direction :column | ||
:padding-top 20 | ||
:padding-left 20} | ||
[text/text | ||
{:size :heading-2 | ||
:weight :semi-bold | ||
:style {:color (colors/theme-colors | ||
colors/black | ||
colors/white) | ||
}} "Sign transaction with Rarible"] | ||
[quo2/segmented-control | ||
{:size 28 | ||
:blur? false | ||
:default-active 1 | ||
:container-style {:margin-top 19 | ||
:margin-right 20} | ||
:data [{:id 1 | ||
:label (i18n/label :t/simple)} | ||
{:id 2 | ||
:label (i18n/label :t/advanced)}]}] | ||
[rn/view {:style {:margin-top 19}} | ||
[text/text | ||
{:size :paragraph-2 | ||
:weight :medium | ||
:style {:color colors/neutral-40}} | ||
(i18n/label | ||
:t/select-account)] | ||
[rn/flat-list | ||
{:data selector-list-data | ||
:render-fn render-account-selectors | ||
:horizontal true | ||
:shows-horizontal-scroll-indicator false | ||
:style {:margin-top 4}}] | ||
[rn/view | ||
{:style {:margin-top 11 | ||
:flex-direction :row}} | ||
[locked-input/locked-input | ||
{:icon :i/gas | ||
:label-text (i18n/label :t/network-fee) | ||
:style {:margin-right 15 | ||
:width 160}} "$1,648.34"] | ||
[locked-input/locked-input | ||
{:icon :i/duration | ||
:label-text (i18n/label :t/duration-estimate) | ||
:style {:margin-right 18 | ||
:width 160}} "~3 min"]]]]) |
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