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 7 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
40 changes: 40 additions & 0 deletions src/components/ImageHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import _ from 'underscore';
import styles from '../styles/styles';
import EnvironmentBadge from './EnvironmentBadge';

const propTypes = {
children: PropTypes.node.isRequired,

/** Subtitle of the header */
subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),

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

const defaultProps = {
shouldShowEnvironmentBadge: false,
subtitle: '',
};
const ImageHeader = props => (
<View style={[styles.flex1, styles.flexRow]}>
<View style={styles.mw100}>
{props.children}
{/* If there's no subtitle then display a fragment to avoid an empty space which moves the main title */}
{_.isString(props.subtitle)
? Boolean(props.subtitle) && <Text style={[styles.mutedTextLabel, styles.pre]} numberOfLines={1}>{props.subtitle}</Text>
: props.subtitle}
</View>
{props.shouldShowEnvironmentBadge && (
<EnvironmentBadge />
)}
</View>
);

ImageHeader.displayName = 'ImageHeader';
ImageHeader.propTypes = propTypes;
ImageHeader.defaultProps = defaultProps;
export default ImageHeader;
1 change: 0 additions & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,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 @@ -294,7 +294,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
14 changes: 8 additions & 6 deletions src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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 ImageHeader from '../../../components/ImageHeader';
import * as Expensicons from '../../../components/Icon/Expensicons';
import AvatarWithIndicator from '../../../components/AvatarWithIndicator';
import Tooltip from '../../../components/Tooltip';
Expand All @@ -31,6 +31,8 @@ import SidebarUtils from '../../../libs/SidebarUtils';
import reportPropTypes from '../../reportPropTypes';
import OfflineWithFeedback from '../../../components/OfflineWithFeedback';
import LHNSkeletonView from '../../../components/LHNSkeletonView';
import LogoWordmark from '../../../../assets/images/expensify-wordmark.svg';
import defaultTheme from '../../../styles/themes/default';

const propTypes = {
/** Toggles the navigation menu open and closed */
Expand Down Expand Up @@ -153,13 +155,13 @@ class SidebarLinks extends React.Component {
]}
nativeID="drag-area"
>
<Header
title={this.props.translate('sidebarScreen.headerChat')}
accessibilityLabel={this.props.translate('sidebarScreen.headerChat')}
<ImageHeader
accessibilityLabel={"Expensify"}
accessibilityRole="text"
shouldShowEnvironmentBadge
textStyles={[styles.textHeadline]}
/>
>
<LogoWordmark width={108} fill={defaultTheme.textLight} />
</ImageHeader>
<Tooltip text={this.props.translate('common.search')}>
<TouchableOpacity
accessibilityLabel={this.props.translate('sidebarScreen.buttonSearch')}
Expand Down