mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 01:22:54 +00:00
Fix character names rendering incorrectly
This commit is contained in:
parent
564e4e496b
commit
e3accdad1b
@ -2,21 +2,29 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
max-width: 100px;
|
||||
max-width: 96px;
|
||||
max-height: 125px;
|
||||
border-radius: 15px;
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.Character :hover {
|
||||
cursor: pointer;
|
||||
box-shadow: 1px 1px black;
|
||||
}
|
||||
|
||||
.Character_Icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-width: 96px;
|
||||
max-height: 96px;
|
||||
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.Character_Label {
|
||||
@ -30,7 +38,7 @@
|
||||
height: 30px;
|
||||
|
||||
p {
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
margin: 4px;
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ class Character extends React.PureComponent<IProps> {
|
||||
// Check if the avatar is blacklisted.
|
||||
if (ignored.includes(id)) return undefined;
|
||||
|
||||
const characterName = nameSwitch[id] ?? name;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={"Character"}
|
||||
@ -47,7 +49,11 @@ class Character extends React.PureComponent<IProps> {
|
||||
/>
|
||||
|
||||
<div className={"Character_Label"}>
|
||||
<p>{nameSwitch[id] ?? name}</p>
|
||||
<p
|
||||
style={{ fontSize: characterName.length >= 12 ? 13 : 17 }}
|
||||
>
|
||||
{characterName}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user