From 6a6e7e374cc63c6dda44ea23ede80d4c27e02535 Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sat, 13 Apr 2019 22:22:43 +0300 Subject: [PATCH] move navbar menu to a separate function --- frontend/src/Home/Home.tsx | 61 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/frontend/src/Home/Home.tsx b/frontend/src/Home/Home.tsx index 6720242..cca87aa 100644 --- a/frontend/src/Home/Home.tsx +++ b/frontend/src/Home/Home.tsx @@ -78,40 +78,13 @@ export class HomeComponent extends React.PureComponent { {this.props.user.username} } - content={ - - - {this.props.darkMode ? ( - - ) : ( - - )} - - } + content={this.menu()} />
{ }} > {(_location: any) => (style: any) => ( - + { ) ); } + + private menu() { + return ( + + + {this.props.darkMode ? ( + + ) : ( + + )} + + ); + } } function mapStateToProps(state: IAppState) {