From bd09cd32a0dd2896accb12403abe5f92f01b71c8 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Thu, 21 Jan 2021 15:52:26 -0400 Subject: [PATCH] [FIX] Wrong styling on E2E encryption banner (#2767) * [FIX] Wrong styling on E2E encryption banner * [FIX] Wrong styling on E2E encryption banner * [FIX] Wrong styling on E2E encryption banner * [FIX] Wrong styling on E2E encryption banner (#2767) * Updated SortDropdown, ListHeader, ListItem and added stories for List.Item * Updated SortDropdown * Removed unused component * Updated List.Item and stories * Reverted unnecessary changes and updated ListItem stories * Fix minor indentation * Stop breaking Touch's default underlay color * Fix indentation * Remove falsy comparison from render * Fix left icon * Use List.Item on OmnichannelStatus * Add missing separator * Lint * Fix sort dropdown * Remove unnecessary styles * Fix detox Co-authored-by: Diego Mello --- .../__snapshots__/Storyshots.test.js.snap | 61 +++++++++- app/constants/colors.js | 3 + app/containers/List/ListItem.js | 19 ++-- .../containers/OmnichannelStatus.js | 61 +++++----- app/utils/touch.js | 7 +- .../RoomsListView/ListHeader/Encryption.js | 49 -------- app/views/RoomsListView/ListHeader/Sort.js | 45 -------- app/views/RoomsListView/ListHeader/index.js | 69 ++++++++++-- app/views/RoomsListView/SortDropdown/Item.js | 46 -------- app/views/RoomsListView/SortDropdown/index.js | 105 +++++++++--------- app/views/RoomsListView/styles.js | 93 +--------------- storybook/stories/List.js | 11 +- 12 files changed, 225 insertions(+), 344 deletions(-) delete mode 100644 app/views/RoomsListView/ListHeader/Encryption.js delete mode 100644 app/views/RoomsListView/ListHeader/Sort.js delete mode 100644 app/views/RoomsListView/SortDropdown/Item.js diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 9d9a30e3..b30a37fe 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -6796,7 +6796,7 @@ exports[`Storyshots List with black theme 1`] = ` `; -exports[`Storyshots List with custom color 1`] = ` +exports[`Storyshots List with custom colors 1`] = ` + + + + Press me! + + + + `; diff --git a/app/constants/colors.js b/app/constants/colors.js index 6cc0ea16..b1fdcd7f 100644 --- a/app/constants/colors.js +++ b/app/constants/colors.js @@ -35,6 +35,7 @@ export const themes = { auxiliaryText: '#9ca2a8', infoText: '#6d6d72', tintColor: '#1d74f5', + tintActive: '#549df9', auxiliaryTintColor: '#6C727A', actionTintColor: '#1d74f5', separatorColor: '#cbcbcc', @@ -80,6 +81,7 @@ export const themes = { auxiliaryText: '#9297a2', infoText: '#6D6D72', tintColor: '#1d74f5', + tintActive: '#549df9', auxiliaryTintColor: '#f9f9f9', actionTintColor: '#1d74f5', separatorColor: '#2b2b2d', @@ -125,6 +127,7 @@ export const themes = { auxiliaryText: '#b2b8c6', infoText: '#6d6d72', tintColor: '#1e9bfe', + tintActive: '#76b7fc', auxiliaryTintColor: '#f9f9f9', actionTintColor: '#1e9bfe', separatorColor: '#272728', diff --git a/app/containers/List/ListItem.js b/app/containers/List/ListItem.js index a3252a7f..6ce7bb6f 100644 --- a/app/containers/List/ListItem.js +++ b/app/containers/List/ListItem.js @@ -1,9 +1,6 @@ import React from 'react'; import { - View, - Text, - StyleSheet, - I18nManager + View, Text, StyleSheet, I18nManager } from 'react-native'; import PropTypes from 'prop-types'; @@ -82,11 +79,12 @@ const Content = React.memo(({ )); const Button = React.memo(({ - onPress, ...props + onPress, backgroundColor, underlayColor, ...props }) => ( onPress(props.title)} - style={{ backgroundColor: themes[props.theme].backgroundColor }} + style={{ backgroundColor: backgroundColor || themes[props.theme].backgroundColor }} + underlayColor={underlayColor} enabled={!props.disabled} theme={props.theme} > @@ -99,7 +97,7 @@ const ListItem = React.memo(({ ...props }) => { return