Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change LHN header to Expensify #18449

Merged
merged 21 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b548a3e
change LHN header to Expensify
bondydaa May 4, 2023
3b461e2
update the header component so it can accept react components (or any…
bondydaa May 5, 2023
735725c
import the wordmark logo and render it in the header
bondydaa May 5, 2023
5a5b4d7
fix style
bondydaa May 5, 2023
1fa9eed
create new component for imageheader to properly use children to rend…
bondydaa May 5, 2023
fc93302
remove unused props
bondydaa May 5, 2023
0bc7607
removing unneeded string
bondydaa May 5, 2023
398546c
remove unnecessary new component since we have a wordmark that we can…
bondydaa May 8, 2023
6be4be4
remove in-svg styles so we can modify them via props
bondydaa May 8, 2023
9968ab7
update the wordmark component to accept more customization so it can …
bondydaa May 8, 2023
8a14e2e
fix typo
bondydaa May 8, 2023
4843a61
update usage of wordmark component based on new api
bondydaa May 8, 2023
c7acacd
Merge branch 'main' of github.com:Expensify/App into bondy-rename-lhn
bondydaa May 8, 2023
8920c49
linter fixes
bondydaa May 8, 2023
64de69b
fixing proptypes b/c linter complains
bondydaa May 8, 2023
2d1eb9b
remove the unneeded badge component from header component
bondydaa May 8, 2023
8d25d70
include const lib
bondydaa May 8, 2023
b4aee41
remove unneeded import
bondydaa May 8, 2023
24c3259
linter be damned this is what works
bondydaa May 8, 2023
d1596bc
Merge branch 'main' of github.com:Expensify/App into bondy-rename-lhn
bondydaa May 9, 2023
a29631b
import style props to appease linter
bondydaa May 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions assets/images/expensify-logo--dev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 9 additions & 10 deletions assets/images/expensify-logo--staging.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 16 additions & 3 deletions src/components/ExpensifyWordmark.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import ProductionLogo from '../../assets/images/expensify-wordmark.svg';
import DevLogo from '../../assets/images/expensify-logo--dev.svg';
import StagingLogo from '../../assets/images/expensify-logo--staging.svg';
Expand All @@ -9,13 +10,24 @@ import withEnvironment, {environmentPropTypes} from './withEnvironment';
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
import compose from '../libs/compose';
import themeColors from '../styles/themes/default';
import styles from '../styles/styles';
import * as StyleUtils from '../styles/StyleUtils';
import variables from '../styles/variables';
import stylePropTypes from '../styles/stylePropTypes';

const propTypes = {
...environmentPropTypes,
...windowDimensionsPropTypes,

/** The styles to apply for the View wrapping the svg */
containerStyles: stylePropTypes,

/** Fill color of the svg */
color: PropTypes.string,
};

const defaultProps = {
containerStyles: [],
color: themeColors.success,
};

const logoComponents = {
Expand All @@ -32,17 +44,18 @@ const ExpensifyWordmark = (props) => {
<View style={[
StyleUtils.getSignInWordmarkWidthStyle(props.environment, props.isSmallScreenWidth),
StyleUtils.getHeight(props.isSmallScreenWidth ? variables.signInLogoHeightSmallScreen : variables.signInLogoHeight),
(props.isSmallScreenWidth && (props.environment === CONST.ENVIRONMENT.DEV || props.environment === CONST.ENVIRONMENT.STAGING)) ? styles.ml3 : {},
...props.containerStyles,
]}
>
<LogoComponent fill={themeColors.success} />
<LogoComponent fill={props.color} />
</View>
</>
);
};

ExpensifyWordmark.displayName = 'ExpensifyWordmark';
ExpensifyWordmark.propTypes = propTypes;
ExpensifyWordmark.defaultProps = defaultProps;
export default compose(
withEnvironment,
withWindowDimensions,
Expand Down
8 changes: 0 additions & 8 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
import _ from 'underscore';
import styles from '../styles/styles';
import Text from './Text';
import EnvironmentBadge from './EnvironmentBadge';

const propTypes = {
/** Title of the Header */
Expand All @@ -13,16 +12,12 @@ const propTypes = {
/** Subtitle of the header */
subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),

/** Should we show the environment badge (dev/stg)? */
shouldShowEnvironmentBadge: PropTypes.bool,

/** Additional text styles */
// eslint-disable-next-line react/forbid-prop-types
textStyles: PropTypes.arrayOf(PropTypes.object),
};

const defaultProps = {
shouldShowEnvironmentBadge: false,
subtitle: '',
textStyles: [],
};
Expand All @@ -37,9 +32,6 @@ const Header = props => (
? Boolean(props.subtitle) && <Text style={[styles.mutedTextLabel, styles.pre]} numberOfLines={1}>{props.subtitle}</Text>
: props.subtitle}
</View>
{props.shouldShowEnvironmentBadge && (
<EnvironmentBadge />
)}
</View>
);

Expand Down
1 change: 0 additions & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ export default {
newChat: 'New chat',
newGroup: 'New group',
newRoom: 'New room',
headerChat: 'Chats',
buttonSearch: 'Search',
buttonMySettings: 'My settings',
fabNewChat: 'New chat (Floating action)',
Expand Down
1 change: 0 additions & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ export default {
newChat: 'Nuevo chat',
newGroup: 'Nuevo grupo',
newRoom: 'Nueva sala de chat',
headerChat: 'Chats',
buttonSearch: 'Buscar',
buttonMySettings: 'Mi configuración',
fabNewChat: 'Nuevo chat',
Expand Down
15 changes: 7 additions & 8 deletions src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import compose from '../../../libs/compose';
import Navigation from '../../../libs/Navigation/Navigation';
import ROUTES from '../../../ROUTES';
import Icon from '../../../components/Icon';
import Header from '../../../components/Header';
import * as Expensicons from '../../../components/Icon/Expensicons';
import AvatarWithIndicator from '../../../components/AvatarWithIndicator';
import Tooltip from '../../../components/Tooltip';
Expand All @@ -31,6 +30,8 @@ import SidebarUtils from '../../../libs/SidebarUtils';
import reportPropTypes from '../../reportPropTypes';
import OfflineWithFeedback from '../../../components/OfflineWithFeedback';
import LHNSkeletonView from '../../../components/LHNSkeletonView';
import ExpensifyWordmark from '../../../components/ExpensifyWordmark';
import defaultTheme from '../../../styles/themes/default';

const propTypes = {
/** Toggles the navigation menu open and closed */
Expand Down Expand Up @@ -153,13 +154,11 @@ class SidebarLinks extends React.Component {
]}
nativeID="drag-area"
>
<Header
title={this.props.translate('sidebarScreen.headerChat')}
accessibilityLabel={this.props.translate('sidebarScreen.headerChat')}
accessibilityRole="text"
shouldShowEnvironmentBadge
textStyles={[styles.textHeadline]}
/>
<View>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add flexRow and flex1 to fix the search icon.

<ExpensifyWordmark
color={defaultTheme.textLight}
/>
</View>
<Tooltip text={this.props.translate('common.search')}>
<TouchableOpacity
accessibilityLabel={this.props.translate('sidebarScreen.buttonSearch')}
Expand Down
8 changes: 7 additions & 1 deletion src/pages/signin/SignInPageLayout/SignInPageContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import OfflineIndicator from '../../../components/OfflineIndicator';
import SignInHeroImage from '../SignInHeroImage';
import * as StyleUtils from '../../../styles/StyleUtils';
import variables from '../../../styles/variables';
import withEnvironment, {environmentPropTypes} from '../../../components/withEnvironment';
import CONST from '../../../CONST';

const propTypes = {
/** The children to show inside the layout */
Expand All @@ -34,6 +36,7 @@ const propTypes = {

...withLocalizePropTypes,
...windowDimensionsPropTypes,
...environmentPropTypes,
};

const SignInPageContent = props => (
Expand All @@ -49,7 +52,9 @@ const SignInPageContent = props => (
<View style={[styles.flexGrow2, styles.mb8]}>
<SignInPageForm style={[styles.alignSelfStretch]}>
<View style={[props.isSmallScreenWidth ? styles.mb8 : styles.mb15, props.isSmallScreenWidth ? styles.alignItemsCenter : styles.alignSelfStart]}>
<ExpensifyWordmark />
<ExpensifyWordmark
containerStyles={[(props.isSmallScreenWidth && (props.environment === CONST.ENVIRONMENT.DEV || props.environment === CONST.ENVIRONMENT.STAGING)) ? styles.ml3 : {}]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has a lint issue. Please wrap this in next lines.

/>
</View>
<View style={[styles.signInPageWelcomeTextContainer]}>
{(props.shouldShowWelcomeHeader && props.welcomeHeader) ? (
Expand Down Expand Up @@ -92,4 +97,5 @@ export default compose(
withWindowDimensions,
withLocalize,
withSafeAreaInsets,
withEnvironment,
)(SignInPageContent);
1 change: 0 additions & 1 deletion src/stories/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const Template = args => <Header {...args} />;
const Default = Template.bind({});
Default.args = {
title: 'Chats',
shouldShowEnvironmentBadge: true,
};

export default story;
Expand Down