From cc8485a7db67ce6bc371cb97fce7ae8a7ef1a627 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sun, 28 Mar 2021 21:18:41 +0800 Subject: [PATCH] Add renderAvatar(). --- web/src/App.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/web/src/App.js b/web/src/App.js index aa815169..76da40e0 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -142,7 +142,7 @@ class App extends Component { account: null }); - Setting.showMessage("success", `Successfully logged out, redirected to homepage`); + Setting.showMessage("success", `Logged out successfully`); Setting.goToLinkSoft(this, "/"); } else { @@ -159,6 +159,22 @@ class App extends Component { } } + renderAvatar() { + if (this.state.account.avatar === "") { + return ( + + {Setting.getShortName(this.state.account.name)} + + ) + } else { + return ( + + {Setting.getShortName(this.state.account.name)} + + ) + } + } + renderRightDropdown() { const menu = ( @@ -176,9 +192,9 @@ class App extends Component { return (
- - {Setting.getShortName(this.state.account.name)} - + { + this.renderAvatar() + }     {Setting.isMobile() ? null : Setting.getShortName(this.state.account.name)}