Skip to content

Commit

Permalink
ChatNavBar: Don't use BRAND_COLOR for text.
Browse files Browse the repository at this point in the history
The BRAND_COLOR is a pretty aggressive color, that doesn't look good as
text. Instead, just use the default text color.
  • Loading branch information
WesleyAC committed May 6, 2021
1 parent 3f2f2b3 commit 7026f4d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/nav/ChatNavBar.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* @flow strict-local */

import React from 'react';
import React, { useContext } from 'react';
import { View } from 'react-native';
import Color from 'color';
import { SafeAreaView } from 'react-native-safe-area-context';

import type { Narrow, EditMessage } from '../types';
import { LoadingBanner, ZulipStatusBar } from '../common';
import { useSelector } from '../react-redux';
import { BRAND_COLOR, NAVBAR_SIZE } from '../styles';
import { BRAND_COLOR, NAVBAR_SIZE, ThemeContext } from '../styles';
import Title from '../title/Title';
import NavBarBackButton from './NavBarBackButton';
import { getStreamColorForNarrow } from '../subscriptions/subscriptionSelectors';
Expand All @@ -25,6 +25,9 @@ export default function ChatNavBar(props: Props) {
const streamColor = useSelector(state => getStreamColorForNarrow(state, narrow));
const color =
streamColor === undefined ? BRAND_COLOR : foregroundColorFromBackground(streamColor);
const themeColor = useContext(ThemeContext).color;
const textColor =
streamColor === undefined ? themeColor : foregroundColorFromBackground(streamColor);
const spinnerColor =
streamColor === undefined ? 'default' : foregroundColorFromBackground(streamColor);

Expand Down Expand Up @@ -54,14 +57,14 @@ export default function ChatNavBar(props: Props) {
}}
>
<NavBarBackButton color={color} />
<Title color={color} narrow={narrow} editMessage={editMessage} />
<Title color={textColor} narrow={narrow} editMessage={editMessage} />
<ExtraButton color={color} narrow={narrow} />
<InfoButton color={color} narrow={narrow} />
</View>
<LoadingBanner
spinnerColor={spinnerColor}
backgroundColor={streamColor}
textColor={color}
textColor={textColor}
/>
</SafeAreaView>
</>
Expand Down

0 comments on commit 7026f4d

Please sign in to comment.