Commit 3643a39e authored by nanahira's avatar nanahira

use cut images for corner avatar

parent 548f4d87
Pipeline #16012 passed with stages
in 2 minutes and 15 seconds
......@@ -7,8 +7,16 @@ import Format from '../components/Format'
const defaultAvatar = require('../../public/default_avatar.jpg');
function mutatedUserAvatar(avatar) {
if (!avatar) {
return avatar;
}
return `https://sapi.moecube.com:444/avatar/url/${avatar.split('/').pop()}/40/avatar.png`;
}
function UserPanel({ dispatch, user }) {
const { avatar } = user;
const mutatedAvatar = mutatedUserAvatar(avatar);
const menu = (
<Menu trigger={['click']}>
<Menu.Item>
......@@ -46,7 +54,7 @@ function UserPanel({ dispatch, user }) {
<Dropdown overlay={menu} placement="bottomCenter">
<div className="ant-dropdown-link" style={{ display: 'flex', alignItems: 'center' }}>
<img
alt="avatar" src={avatar || defaultAvatar}
alt="avatar" src={mutatedAvatar || defaultAvatar}
style={{ borderRadius: '45px',
height: '40px',
weight: '40px',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment