Some minor UI improvements
This commit is contained in:
parent
dbb8039f64
commit
4b64b4c0be
4 changed files with 14 additions and 7 deletions
|
@ -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;
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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: {}"}>
|
||||||
|
|
|
@ -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);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Reference in a new issue