mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Fix property empty issue
This commit is contained in:
@ -17,7 +17,7 @@ import {MetaMaskAvatar} from "react-metamask-avatar";
|
||||
|
||||
class AccountAvatar extends React.Component {
|
||||
render() {
|
||||
const {src, size} = this.props;
|
||||
const {src, size, width, height} = this.props;
|
||||
// The avatar for Metamask account is directly generated by an algorithm based on the address
|
||||
// src = "metamask:0xC304b2cC0Be8E9ce10fF3Afd34820Ed306A23600";
|
||||
const matchMetaMask = src.match(/^metamask:(\w+)$/);
|
||||
@ -27,9 +27,19 @@ class AccountAvatar extends React.Component {
|
||||
<MetaMaskAvatar address={address} size={size} />
|
||||
);
|
||||
}
|
||||
return (
|
||||
<img width={size} height={size} src={src} />
|
||||
);
|
||||
if (size !== undefined) {
|
||||
return (
|
||||
<img width={size} height={size} src={src} />
|
||||
);
|
||||
} else if (width === undefined) {
|
||||
return (
|
||||
<img height={height} src={src} />
|
||||
);
|
||||
} else if (height === undefined) {
|
||||
return (
|
||||
<img width={width} src={src} />
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user