Аналогично для проекта Jhipster реагирует
В app.tsx
<Header
isAuthenticated={this.props.isAuthenticated}
login={this.props.account.login}
isAdmin={this.props.isAdmin}
currentLocale={this.props.currentLocale}
onLocaleChange={this.props.setLocale}
ribbonEnv={this.props.ribbonEnv}
isInProduction={this.props.isInProduction}
isSwaggerEnabled={this.props.isSwaggerEnabled}
/>
.
.
.
const mapStateToProps = ({ authentication, applicationProfile, locale }: IRootState) => ({
currentLocale: locale.currentLocale,
isAuthenticated: authentication.isAuthenticated,
account: authentication.account,
isAdmin: hasAnyAuthority(authentication.account.authorities, [AUTHORITIES.ADMIN]),
ribbonEnv: applicationProfile.ribbonEnv,
isInProduction: applicationProfile.inProduction,
isSwaggerEnabled: applicationProfile.isSwaggerEnabled
});
В header.tsx
const { currentLocale, isAuthenticated, login, isAdmin, isSwaggerEnabled, isInProduction } = this.props;
.
.
.
<AccountMenu login={login} isAuthenticated={isAuthenticated} closeNav={this.closeNav} />
В account.tsx
export const AccountMenu = props => (
<NavDropdown
closeNav={props.closeNav}
icon="user"
name={props.isAuthenticated ? props.login : translate('global.menu.account.main')}
id="account-menu"
>
{props.isAuthenticated ? accountMenuItemsAuthenticated : accountMenuItems}
</NavDropdown>
);