diff options
author | crupest <crupest@outlook.com> | 2020-08-04 18:14:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 18:14:41 +0800 |
commit | 0791682e1f333adb5c79b979e3e8c5c50bb5f85a (patch) | |
tree | 47b85b9bfb5026743a4a9984c5c24b8363e8a5af /Timeline/ClientApp/src/app/common/AppBar.tsx | |
parent | 66417650b46f27f8238cc6997e2ff14579c1244a (diff) | |
parent | 89806d334fe2c7ef0ea8b3d12c74759e8e3ba860 (diff) | |
download | timeline-0791682e1f333adb5c79b979e3e8c5c50bb5f85a.tar.gz timeline-0791682e1f333adb5c79b979e3e8c5c50bb5f85a.tar.bz2 timeline-0791682e1f333adb5c79b979e3e8c5c50bb5f85a.zip |
Merge pull request #132 from crupest/refactor
Refactor a lot of things.
Diffstat (limited to 'Timeline/ClientApp/src/app/common/AppBar.tsx')
-rw-r--r-- | Timeline/ClientApp/src/app/common/AppBar.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Timeline/ClientApp/src/app/common/AppBar.tsx b/Timeline/ClientApp/src/app/common/AppBar.tsx index 061ba08c..8349aef7 100644 --- a/Timeline/ClientApp/src/app/common/AppBar.tsx +++ b/Timeline/ClientApp/src/app/common/AppBar.tsx @@ -5,14 +5,15 @@ import { Navbar, NavbarToggler, Collapse, Nav, NavItem } from 'reactstrap'; import { useMediaQuery } from 'react-responsive';
import { useTranslation } from 'react-i18next';
-import { useUser, useAvatarUrl } from '../data/user';
+import { useUser, useAvatar } from '../data/user';
import TimelineLogo from './TimelineLogo';
+import BlobImage from './BlobImage';
const AppBar: React.FC = (_) => {
const history = useHistory();
const user = useUser();
- const avatarUrl = useAvatarUrl(user?.username);
+ const avatar = useAvatar(user?.username);
const { t } = useTranslation();
@@ -34,9 +35,9 @@ const AppBar: React.FC = (_) => { <div className="ml-auto mr-2">
{user != null ? (
<NavLink to={`/users/${user.username}`}>
- <img
+ <BlobImage
className="avatar small rounded-circle bg-white"
- src={avatarUrl}
+ blob={avatar}
/>
</NavLink>
) : (
|