Skip to content

Commit

Permalink
Merge pull request Expensify#35846 from dukenv0307/fix/35743
Browse files Browse the repository at this point in the history
update workspace name
  • Loading branch information
Beamanator authored Feb 12, 2024
2 parents 456fdbe + 6bc90fe commit bfd272c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint-disable rulesdir/onyx-props-must-have-default */
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useRef} from 'react';
import {InteractionManager, StyleSheet, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import Breadcrumbs from '@components/Breadcrumbs';
import LHNOptionsList from '@components/LHNOptionsList/LHNOptionsList';
Expand Down Expand Up @@ -42,7 +44,7 @@ const propTypes = {
isActiveReport: PropTypes.func.isRequired,
};

function SidebarLinks({onLinkClick, insets, optionListItems, isLoading, priorityMode = CONST.PRIORITY_MODE.DEFAULT, isActiveReport, isCreateMenuOpen}) {
function SidebarLinks({onLinkClick, insets, optionListItems, isLoading, priorityMode = CONST.PRIORITY_MODE.DEFAULT, isActiveReport, isCreateMenuOpen, activePolicy}) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const modal = useRef({});
Expand Down Expand Up @@ -133,9 +135,14 @@ function SidebarLinks({onLinkClick, insets, optionListItems, isLoading, priority
<View style={[styles.flex1, styles.h100]}>
<Breadcrumbs
breadcrumbs={[
{
type: CONST.BREADCRUMB_TYPE.ROOT,
},
activePolicy
? {
type: CONST.BREADCRUMB_TYPE.STRONG,
text: lodashGet(activePolicy, 'name', ''),
}
: {
type: CONST.BREADCRUMB_TYPE.ROOT,
},
{
text: translate('common.chats'),
},
Expand Down Expand Up @@ -165,5 +172,9 @@ function SidebarLinks({onLinkClick, insets, optionListItems, isLoading, priority
SidebarLinks.propTypes = propTypes;
SidebarLinks.displayName = 'SidebarLinks';

export default SidebarLinks;
export default withOnyx({
activePolicy: {
key: ({activeWorkspaceID}) => `${ONYXKEYS.COLLECTION.POLICY}${activeWorkspaceID}`,
},
})(SidebarLinks);
export {basePropTypes};
1 change: 1 addition & 0 deletions src/pages/home/sidebar/SidebarLinksData.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function SidebarLinksData({
isActiveReport={isActiveReport}
isLoading={isLoading}
optionListItems={optionListItemsWithCurrentReport}
activeWorkspaceID={activeWorkspaceID}
/>
</View>
);
Expand Down

0 comments on commit bfd272c

Please sign in to comment.