Some minor UI improvements

This commit is contained in:
WolverinDEV 2021-03-24 17:57:21 +01:00
parent dbb8039f64
commit 4b64b4c0be
4 changed files with 14 additions and 7 deletions

View file

@ -71,11 +71,11 @@
.containerImage { .containerImage {
max-width: 90%; max-width: 90%;
max-height: 90%; max-height: 90%;
align-self: center;
display: flex; align-self: center;
flex-direction: column; text-align: center;
justify-content: stretch;
display: block;
img { img {
flex-shrink: 1; flex-shrink: 1;

View file

@ -96,6 +96,8 @@
max-height: 100%; max-height: 100%;
max-width: 100%; max-width: 100%;
/* We currently strech all avatars */
/*
&.heightBound { &.heightBound {
height: 100%; height: 100%;
} }
@ -103,6 +105,10 @@
&.widthBound { &.widthBound {
width: 100%; width: 100%;
} }
*/
width: 100%;
height: 100%;
} }
&.sizeChatInfo { &.sizeChatInfo {

View file

@ -71,13 +71,13 @@ const MaxAvatarSize = React.memo(() => {
const currentAvatar = useContext(CurrentAvatarContext); const currentAvatar = useContext(CurrentAvatarContext);
const maxSize = variables.useReadOnly("maxAvatarSize", undefined); const maxSize = variables.useReadOnly("maxAvatarSize", undefined);
if(currentAvatar.status === "loading" || maxSize.status === "loading") { if(maxSize.status === "loading") {
return ( return (
<div className={cssStyle.containerLimit} key={"loading"}> <div className={cssStyle.containerLimit} key={"loading"}>
<Translatable>Maximal avatar size:</Translatable> <Translatable>loading</Translatable> <LoadingDots /> <Translatable>Maximal avatar size:</Translatable> <Translatable>loading</Translatable> <LoadingDots />
</div> </div>
) )
} else if(currentAvatar.status === "unset" || currentAvatar.status === "server") { } else if(currentAvatar.status === "loading" ||currentAvatar.status === "unset" || currentAvatar.status === "server") {
return ( return (
<div className={cssStyle.containerLimit} key={"unset"}> <div className={cssStyle.containerLimit} key={"unset"}>
<VariadicTranslatable text={"Maximal avatar size: {}"}> <VariadicTranslatable text={"Maximal avatar size: {}"}>

View file

@ -20,6 +20,7 @@ const AvatarDefaultImage = React.memo((props: { className?: string, alt?: string
<img <img
draggable={false} draggable={false}
src={kDefaultAvatarImage} src={kDefaultAvatarImage}
style={ImageStyle}
alt={typeof props.alt === "string" ? props.alt : tr("default avatar")} alt={typeof props.alt === "string" ? props.alt : tr("default avatar")}
color={props.className} color={props.className}
onClick={event => { onClick={event => {
@ -28,7 +29,7 @@ const AvatarDefaultImage = React.memo((props: { className?: string, alt?: string
} }
event.preventDefault(); event.preventDefault();
showImagePreview(kDefaultAvatarImage, undefined); showImagePreview(kDefaultAvatarImage, kDefaultAvatarImage);
}} }}
/> />
)); ));