From 0d6aacf2632659883a12f06bf09fb2a4bedbf64d Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Mon, 18 Mar 2024 15:22:04 -0300 Subject: [PATCH] wip: colors --- .../HeaderButton/HeaderButtons.stories.tsx | 2 +- .../IncomingCallNotification/style.tsx | 2 +- .../InAppNotification/NotifierComponent.tsx | 2 +- app/containers/List/ListSeparator.tsx | 2 +- .../RoomHeader/RoomHeader.stories.tsx | 2 +- app/containers/RoomHeader/RoomHeader.tsx | 2 +- app/containers/RoomItem/Actions.tsx | 10 +++-- app/containers/RoomItem/Wrapper.tsx | 2 +- app/containers/SearchHeader.tsx | 2 +- app/containers/StatusBar.tsx | 2 +- app/containers/Toast.tsx | 2 +- app/containers/UIKit/DatePicker.tsx | 2 +- app/containers/UIKit/MultiSelect/Input.tsx | 2 +- app/containers/UIKit/Select.tsx | 2 +- .../Components/CollapsibleQuote/index.tsx | 6 +-- app/containers/message/Message.tsx | 2 +- app/containers/message/Video.tsx | 2 +- app/lib/constants/colors.ts | 41 +------------------ app/lib/methods/helpers/navigation/index.ts | 8 ++-- app/lib/methods/helpers/openLink.ts | 4 +- app/lib/methods/helpers/theme.ts | 2 +- .../Dropdown/index.tsx | 2 +- app/views/CannedResponsesListView/index.tsx | 2 +- app/views/CloseLivechatView.tsx | 2 +- app/views/CreateChannelView/index.tsx | 4 +- app/views/DirectoryView/Options.tsx | 4 +- app/views/DirectoryView/index.tsx | 4 +- app/views/DiscussionsView/index.tsx | 2 +- .../ChangePassword.tsx | 2 +- app/views/E2EEncryptionSecurityView/index.tsx | 2 +- app/views/ForwardMessageView/index.tsx | 2 +- app/views/InviteUsersView/index.tsx | 2 +- app/views/NewServerView/ServerInput/index.tsx | 2 +- app/views/ReadReceiptView/index.tsx | 2 +- .../RoomInfoEditView/SwitchContainer.tsx | 2 +- app/views/RoomInfoEditView/index.tsx | 6 +-- app/views/RoomView/LeftButtons.tsx | 2 +- app/views/RoomView/RightButtons.tsx | 2 +- app/views/RoomsListView/Header/Header.tsx | 4 +- app/views/RoomsListView/ServerDropdown.tsx | 4 +- app/views/SearchMessagesView/index.tsx | 2 +- app/views/SelectedUsersView/index.tsx | 2 +- app/views/ShareListView/Header/Header.ios.tsx | 4 +- app/views/ShareListView/Header/Header.tsx | 2 +- app/views/ShareListView/Header/SearchBox.tsx | 4 +- app/views/TeamChannelsView.tsx | 2 +- .../ThreadMessagesView/Dropdown/index.tsx | 2 +- app/views/ThreadMessagesView/index.tsx | 2 +- 48 files changed, 68 insertions(+), 105 deletions(-) diff --git a/app/containers/HeaderButton/HeaderButtons.stories.tsx b/app/containers/HeaderButton/HeaderButtons.stories.tsx index 5a0db9a44..df28ca672 100644 --- a/app/containers/HeaderButton/HeaderButtons.stories.tsx +++ b/app/containers/HeaderButton/HeaderButtons.stories.tsx @@ -33,7 +33,7 @@ const HeaderExample = ({ left, right, colors, title = '' }: IHeader) => ( title={title} headerLeft={left} headerRight={right} - headerBackground={() => } + headerBackground={() => } /> ); diff --git a/app/containers/InAppNotification/IncomingCallNotification/style.tsx b/app/containers/InAppNotification/IncomingCallNotification/style.tsx index d55f9fc92..aa0149784 100644 --- a/app/containers/InAppNotification/IncomingCallNotification/style.tsx +++ b/app/containers/InAppNotification/IncomingCallNotification/style.tsx @@ -14,7 +14,7 @@ export const useStyle = () => { borderWidth: StyleSheet.hairlineWidth, borderRadius: 4, backgroundColor: colors.surfaceLight, - borderColor: colors.separatorColor, + borderColor: colors.strokeLight, flex: 1 }, small: { diff --git a/app/containers/InAppNotification/NotifierComponent.tsx b/app/containers/InAppNotification/NotifierComponent.tsx index 602e2f92b..3c02a76cc 100644 --- a/app/containers/InAppNotification/NotifierComponent.tsx +++ b/app/containers/InAppNotification/NotifierComponent.tsx @@ -104,7 +104,7 @@ const NotifierComponent = React.memo(({ notification, isMasterDetail }: INotifie isMasterDetail && styles.small, { backgroundColor: themes[theme].surfaceLight, - borderColor: themes[theme].separatorColor, + borderColor: themes[theme].strokeLight, marginTop: insets.top } ]} diff --git a/app/containers/List/ListSeparator.tsx b/app/containers/List/ListSeparator.tsx index d0e8d1cdd..2f2c36496 100644 --- a/app/containers/List/ListSeparator.tsx +++ b/app/containers/List/ListSeparator.tsx @@ -17,7 +17,7 @@ interface IListSeparator { const ListSeparator = React.memo(({ style }: IListSeparator) => { const { theme } = useTheme(); - return ; + return ; }); ListSeparator.displayName = 'List.Separator'; diff --git a/app/containers/RoomHeader/RoomHeader.stories.tsx b/app/containers/RoomHeader/RoomHeader.stories.tsx index 0e54650a1..f502c3dc0 100644 --- a/app/containers/RoomHeader/RoomHeader.stories.tsx +++ b/app/containers/RoomHeader/RoomHeader.stories.tsx @@ -14,7 +14,7 @@ export default { const HeaderExample = ({ title, theme = 'light' }: { title: Function; theme?: TSupportedThemes }) => ( // Using View directly instead of Header from react-navigation because it's easier to test. - {title()} + {title()} ); const RoomHeader = ({ ...props }) => ( diff --git a/app/containers/RoomHeader/RoomHeader.tsx b/app/containers/RoomHeader/RoomHeader.tsx index 8b5b60ff5..6e410c47e 100644 --- a/app/containers/RoomHeader/RoomHeader.tsx +++ b/app/containers/RoomHeader/RoomHeader.tsx @@ -110,7 +110,7 @@ const SubTitle = React.memo(({ usersTyping, subtitle, renderFunc, scale }: TRoom const HeaderTitle = React.memo(({ title, tmid, prid, scale, testID }: TRoomHeaderHeaderTitle) => { const { colors } = useTheme(); - const titleStyle = { fontSize: TITLE_SIZE * scale, color: colors.headerTitleColor }; + const titleStyle = { fontSize: TITLE_SIZE * scale, color: colors.fontTitlesLabels }; if (!tmid && !prid) { return ( diff --git a/app/containers/RoomItem/Actions.tsx b/app/containers/RoomItem/Actions.tsx index 79ab46ced..2aab3bffa 100644 --- a/app/containers/RoomItem/Actions.tsx +++ b/app/containers/RoomItem/Actions.tsx @@ -21,6 +21,8 @@ import I18n from '../../i18n'; const CONDENSED_ICON_SIZE = 24; const EXPANDED_ICON_SIZE = 28; +const starColor = '#f5d100'; + export const LeftActions = React.memo(({ transX, isRead, width, onToggleReadPress, displayMode }: ILeftActionsProps) => { const { colors } = useTheme(); @@ -118,14 +120,14 @@ export const RightActions = React.memo(({ transX, favorite, width, toggleFav, on styles.actionRightButtonContainer, { width, - backgroundColor: colors.favoriteBackground, + backgroundColor: starColor, left: '100%' }, viewHeight, animatedFavStyles ]} > - + - + diff --git a/app/containers/SearchHeader.tsx b/app/containers/SearchHeader.tsx index e4a0672c4..21928b851 100644 --- a/app/containers/SearchHeader.tsx +++ b/app/containers/SearchHeader.tsx @@ -32,7 +32,7 @@ const SearchHeader = ({ onSearchChangeText, testID }: ISearchHeaderProps): JSX.E { barStyle = 'dark-content'; } } - return ; + return ; }; export default StatusBar; diff --git a/app/containers/Toast.tsx b/app/containers/Toast.tsx index 508627430..781ad5b59 100644 --- a/app/containers/Toast.tsx +++ b/app/containers/Toast.tsx @@ -46,7 +46,7 @@ const Toast = (): React.ReactElement => { ref={getToastRef} // @ts-ignore position='center' - style={[styles.toast, { backgroundColor: colors.toastBackground }]} + style={[styles.toast, { backgroundColor: colors.surfaceDark }]} textStyle={[styles.text, { color: colors.fontWhite }]} opacity={0.9} /> diff --git a/app/containers/UIKit/DatePicker.tsx b/app/containers/UIKit/DatePicker.tsx index a1b8b3558..58d0453da 100644 --- a/app/containers/UIKit/DatePicker.tsx +++ b/app/containers/UIKit/DatePicker.tsx @@ -69,7 +69,7 @@ export const DatePicker = ({ element, language, action, context, loading, value, style={{ backgroundColor: themes[theme].surfaceRoom }} background={Touchable.Ripple(themes[theme].bannerBackground)} > - + {currentDate.toLocaleDateString(language)} diff --git a/app/containers/UIKit/MultiSelect/Input.tsx b/app/containers/UIKit/MultiSelect/Input.tsx index 41d599ae5..e39446c09 100644 --- a/app/containers/UIKit/MultiSelect/Input.tsx +++ b/app/containers/UIKit/MultiSelect/Input.tsx @@ -26,7 +26,7 @@ const Input = ({ children, onPress, loading, inputStyle, placeholder, disabled, background={Touchable.Ripple(colors.bannerBackground)} disabled={disabled} > - + {placeholder ? {placeholder} : children} {loading ? ( diff --git a/app/containers/UIKit/Select.tsx b/app/containers/UIKit/Select.tsx index 7653720e5..03dd83b89 100644 --- a/app/containers/UIKit/Select.tsx +++ b/app/containers/UIKit/Select.tsx @@ -51,7 +51,7 @@ export const Select = ({ options = [], placeholder, onChange, loading, disabled, const pickerStyle = { ...styles.viewContainer, ...(isIOS ? styles.iosPadding : {}), - borderColor: themes[theme].separatorColor, + borderColor: themes[theme].strokeLight, backgroundColor: themes[theme].surfaceRoom }; diff --git a/app/containers/message/Components/CollapsibleQuote/index.tsx b/app/containers/message/Components/CollapsibleQuote/index.tsx index b09a40003..7f22cc6b3 100644 --- a/app/containers/message/Components/CollapsibleQuote/index.tsx +++ b/app/containers/message/Components/CollapsibleQuote/index.tsx @@ -128,7 +128,7 @@ const CollapsibleQuote = React.memo( chatComponentBackground: backgroundColor, strokeLight, strokeDark, - headerTintColor + fontSecondaryInfo } = themes[theme]; try { @@ -137,7 +137,7 @@ const CollapsibleQuote = React.memo( borderColor = attachment.color; strokeLight = attachment.color; strokeDark = attachment.color; - headerTintColor = headerTintColor; + fontSecondaryInfo = fontSecondaryInfo; } } catch (e) { // fallback to default @@ -167,7 +167,7 @@ const CollapsibleQuote = React.memo( - {attachment.title} + {attachment.title} {!collapsed && } diff --git a/app/containers/message/Message.tsx b/app/containers/message/Message.tsx index 2222403f3..e1f67233e 100644 --- a/app/containers/message/Message.tsx +++ b/app/containers/message/Message.tsx @@ -135,7 +135,7 @@ const MessageTouchable = React.memo((props: IMessageTouchable & IMessage) => { backgroundColor = themes[theme].statusBackgroundWarning2; } if (props.highlighted) { - backgroundColor = themes[theme].headerBackground; + backgroundColor = themes[theme].surfaceNeutral; } if (props.hasError) { diff --git a/app/containers/message/Video.tsx b/app/containers/message/Video.tsx index 04e81be43..0f4e86259 100644 --- a/app/containers/message/Video.tsx +++ b/app/containers/message/Video.tsx @@ -224,7 +224,7 @@ const Video = ({ file, showAttachment, getCustomEmoji, style, isReply, msg }: IM diff --git a/app/lib/constants/colors.ts b/app/lib/constants/colors.ts index d3aa43319..49aa4fdca 100644 --- a/app/lib/constants/colors.ts +++ b/app/lib/constants/colors.ts @@ -190,7 +190,7 @@ const newColorsBlack = { surfaceLight: '#0d0d0d', surfaceTint: '#16181a', surfaceRoom: '#000000', - surfaceNeutral: '#2F343D', + surfaceNeutral: '#2F343D', //#0d0d0d // surfaceDisabled: '#24272E', surfaceHover: '#080808', // surfaceSelected: '#3C3F44', @@ -292,19 +292,6 @@ export const colors = { tintDisabled: '#88B4F5', auxiliaryTintColor: '#6C727A', actionTintColor: '#1d74f5', - separatorColor: '#cbcbcc', - navbarBackground: '#ffffff', - headerBorder: '#B2B2B2', - headerBackground: '#EEEFF1', - headerSecondaryBackground: '#ffffff', - headerTintColor: '#6C727A', - headerTitleColor: '#0C0D0F', - headerSecondaryText: '#1d74f5', - toastBackground: '#0C0D0F', - videoBackground: '#1f2329', - favoriteBackground: '#ffbb00', - hideBackground: '#54585e', - buttonBackground: '#414852', backdropOpacity: 0.3, attachmentLoadingOpacity: 0.7, }, @@ -321,19 +308,6 @@ export const colors = { tintDisabled: '#88B4F5', auxiliaryTintColor: '#f9f9f9', actionTintColor: '#1d74f5', - separatorColor: '#2b2b2d', - navbarBackground: '#0b182c', - headerBorder: '#2F3A4B', - headerBackground: '#0b182c', - headerSecondaryBackground: '#0b182c', - headerTintColor: '#f9f9f9', - headerTitleColor: '#f9f9f9', - headerSecondaryText: '#9297a2', - toastBackground: '#54585e', - videoBackground: '#1f2329', - favoriteBackground: '#ffbb00', - hideBackground: '#54585e', - buttonBackground: '#414852', backdropOpacity: 0.9, attachmentLoadingOpacity: 0.3, black: { @@ -349,19 +323,6 @@ export const colors = { tintDisabled: '#88B4F5', // TODO: Evaluate this with design team auxiliaryTintColor: '#f9f9f9', actionTintColor: '#1e9bfe', - separatorColor: '#272728', - navbarBackground: '#0d0d0d', - headerBorder: '#323232', - headerBackground: '#0d0d0d', - headerSecondaryBackground: '#0d0d0d', - headerTintColor: '#f9f9f9', - headerTitleColor: '#f9f9f9', - headerSecondaryText: '#b2b8c6', - toastBackground: '#54585e', - videoBackground: '#1f2329', - favoriteBackground: '#ffbb00', - hideBackground: '#54585e', - buttonBackground: '#414852', backdropOpacity: 0.9, attachmentLoadingOpacity: 0.3, }, diff --git a/app/lib/methods/helpers/navigation/index.ts b/app/lib/methods/helpers/navigation/index.ts index 321b8b11a..a2d9f81d5 100644 --- a/app/lib/methods/helpers/navigation/index.ts +++ b/app/lib/methods/helpers/navigation/index.ts @@ -21,7 +21,7 @@ export const cardStyle = { export const borderBottom: any = (theme: TSupportedThemes) => ({ borderBottomWidth: StyleSheet.hairlineWidth, - borderBottomColor: themes[theme].headerBorder, + borderBottomColor: themes[theme].strokeDark, elevation: 0 }); @@ -35,10 +35,10 @@ export const headerHeight = isIOS ? 50 : 56; export const themedHeader = (theme: TSupportedThemes) => ({ headerStyle: { ...borderBottom(theme), - backgroundColor: themes[theme].headerBackground + backgroundColor: themes[theme].surfaceNeutral }, - headerTintColor: themes[theme].headerTintColor, - headerTitleStyle: { ...sharedStyles.textSemibold, color: themes[theme].headerTitleColor, fontSize: 18 } + headerTintColor: themes[theme].fontSecondaryInfo, + headerTitleStyle: { ...sharedStyles.textSemibold, color: themes[theme].fontTitlesLabels, fontSize: 18 } }); export const navigationTheme = (theme: TSupportedThemes) => { diff --git a/app/lib/methods/helpers/openLink.ts b/app/lib/methods/helpers/openLink.ts index e4ade0a30..d571c6f8f 100644 --- a/app/lib/methods/helpers/openLink.ts +++ b/app/lib/methods/helpers/openLink.ts @@ -54,8 +54,8 @@ const openLink = async (url: string, theme: TSupportedThemes = 'light'): Promise const browser = UserPreferences.getString(DEFAULT_BROWSER_KEY); if (browser === 'inApp') { await WebBrowser.openBrowserAsync(url, { - toolbarColor: themes[theme].headerBackground, - controlsColor: themes[theme].headerTintColor, + toolbarColor: themes[theme].surfaceNeutral, + controlsColor: themes[theme].fontSecondaryInfo, // https://github.com/expo/expo/pull/4923 enableBarCollapsing: true, showTitle: true diff --git a/app/lib/methods/helpers/theme.ts b/app/lib/methods/helpers/theme.ts index 5bb73e924..50f0ec4e2 100644 --- a/app/lib/methods/helpers/theme.ts +++ b/app/lib/methods/helpers/theme.ts @@ -53,7 +53,7 @@ export const setNativeTheme = async (themePreferences: IThemePreference): Promis const iconsLight = theme === 'light'; try { // The late param as default is true @ react-native-navigation-bar-color/src/index.js line 8 - await changeNavigationBarColor(themes[theme].navbarBackground, iconsLight, true); + await changeNavigationBarColor(themes[theme].surfaceLight, iconsLight, true); } catch (error) { // Do nothing } diff --git a/app/views/CannedResponsesListView/Dropdown/index.tsx b/app/views/CannedResponsesListView/Dropdown/index.tsx index 79f54f214..7068f9cb4 100644 --- a/app/views/CannedResponsesListView/Dropdown/index.tsx +++ b/app/views/CannedResponsesListView/Dropdown/index.tsx @@ -81,7 +81,7 @@ class Dropdown extends React.Component { { transform: [{ translateY }], backgroundColor: themes[theme!].surfaceRoom, - borderColor: themes[theme!].separatorColor + borderColor: themes[theme!].strokeLight } ]} > diff --git a/app/views/CannedResponsesListView/index.tsx b/app/views/CannedResponsesListView/index.tsx index 79dbad0dc..7815a25e6 100644 --- a/app/views/CannedResponsesListView/index.tsx +++ b/app/views/CannedResponsesListView/index.tsx @@ -243,7 +243,7 @@ const CannedResponsesListView = ({ navigation, route }: ICannedResponsesListView navigation.pop()} - tintColor={themes[theme].headerTintColor} + tintColor={themes[theme].fontSecondaryInfo} testID='header-back' /> ), diff --git a/app/views/CloseLivechatView.tsx b/app/views/CloseLivechatView.tsx index 77f1c884f..c021a157a 100644 --- a/app/views/CloseLivechatView.tsx +++ b/app/views/CloseLivechatView.tsx @@ -102,7 +102,7 @@ const CloseLivechatView = ({ navigation, route }: IBaseScreen ) : null} diff --git a/app/views/CreateChannelView/index.tsx b/app/views/CreateChannelView/index.tsx index f25edfd19..02908c7b4 100644 --- a/app/views/CreateChannelView/index.tsx +++ b/app/views/CreateChannelView/index.tsx @@ -147,7 +147,7 @@ const CreateChannelView = () => { - + { styles.list, { backgroundColor: colors.surfaceRoom, - borderColor: colors.separatorColor + borderColor: colors.strokeLight } ]} contentContainerStyle={styles.invitedList} diff --git a/app/views/DirectoryView/Options.tsx b/app/views/DirectoryView/Options.tsx index 636289106..acde27754 100644 --- a/app/views/DirectoryView/Options.tsx +++ b/app/views/DirectoryView/Options.tsx @@ -98,7 +98,7 @@ export default class DirectoryOptions extends PureComponent {I18n.t('Search_by')} @@ -115,7 +115,7 @@ export default class DirectoryOptions extends PureComponent - + diff --git a/app/views/DirectoryView/index.tsx b/app/views/DirectoryView/index.tsx index 65fb4e25e..55eca1e19 100644 --- a/app/views/DirectoryView/index.tsx +++ b/app/views/DirectoryView/index.tsx @@ -219,7 +219,7 @@ class DirectoryView extends React.Component @@ -244,7 +244,7 @@ class DirectoryView extends React.Component navigation.pop()} - tintColor={colors.headerTintColor} + tintColor={colors.fontSecondaryInfo} testID='header-back' /> ), diff --git a/app/views/E2EEncryptionSecurityView/ChangePassword.tsx b/app/views/E2EEncryptionSecurityView/ChangePassword.tsx index f55f4d216..3677127f4 100644 --- a/app/views/E2EEncryptionSecurityView/ChangePassword.tsx +++ b/app/views/E2EEncryptionSecurityView/ChangePassword.tsx @@ -74,7 +74,7 @@ const ChangePassword = () => { return ( <> - {I18n.t('E2E_encryption_change_password_title')} + {I18n.t('E2E_encryption_change_password_title')} {I18n.t('E2E_encryption_change_password_description')} diff --git a/app/views/E2EEncryptionSecurityView/index.tsx b/app/views/E2EEncryptionSecurityView/index.tsx index f602bfb5c..27aa5a1a8 100644 --- a/app/views/E2EEncryptionSecurityView/index.tsx +++ b/app/views/E2EEncryptionSecurityView/index.tsx @@ -77,7 +77,7 @@ const E2EEncryptionSecurityView = () => { - {I18n.t('E2E_encryption_reset_title')} + {I18n.t('E2E_encryption_reset_title')} {I18n.t('E2E_encryption_reset_description')}