Social Login support both https and mxc icons
This commit is contained in:
parent
1b6ace8cce
commit
1b2cfa5f05
1 changed files with 7 additions and 2 deletions
|
@ -45,8 +45,13 @@ const SSOButton: React.FC<ISSOButtonProps> = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
let icon;
|
let icon;
|
||||||
if (idp && idp.icon && idp.icon.startsWith("https://")) {
|
if (typeof idp?.icon === "string" && idp.icon.startsWith("mxc://") || idp.icon.startsWith("https://")) {
|
||||||
icon = <img src={idp.icon} height="24" width="24" alt={label} />;
|
icon = <img
|
||||||
|
src={matrixClient.mxcUrlToHttp(idp.icon, 24, 24, "crop", true)}
|
||||||
|
height="24"
|
||||||
|
width="24"
|
||||||
|
alt={label}
|
||||||
|
/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const classes = classNames("mx_SSOButton", {
|
const classes = classNames("mx_SSOButton", {
|
||||||
|
|
Loading…
Reference in a new issue