Skip to content

Commit 130e8c1

Browse files
committed
style: sheet operator item layout
1 parent a038770 commit 130e8c1

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

src/components/editor/operator/sheet/SheetOperatorSkillAbout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const SkillAboutTrigger = ({
115115
const SkillAboutTrigger = (
116116
<div
117117
className={clsx(
118-
'flex mt-3 text-gray-500 items-center text-xs',
118+
'flex mt-1 text-gray-500 items-center text-xs',
119119
operator && 'hover:text-black',
120120
)}
121121
>

src/components/editor/operator/sheet/sheetGroup/SheetOperatorEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const OperatorSelectorItem: FC<{
333333
}}
334334
>
335335
<OperatorAvatar name={name} size="large" />
336-
<p className="font-bold leading-none text-center mt-3 truncate">
336+
<p className="mt-1 font-bold leading-tight text-center break-words">
337337
{useLocalizedOperatorName(name)}
338338
</p>
339339
</Card>

src/components/editor/operator/sheet/sheetOperator/SheetOperatorItem.tsx

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,32 +103,23 @@ export const SheetOperatorItem: FC<SheetOperatorItemProp> = ({ name }) => {
103103
return (
104104
<Card
105105
className={clsx(
106-
'flex items-center w-full h-full relative cursor-pointer flex-col justify-center',
106+
'flex items-center w-full h-full relative cursor-pointer flex-col',
107107
selectedInView && 'scale-90 bg-gray-200',
108108
)}
109109
elevation={grouped ? 0 : 2}
110110
interactive={!selectedInView}
111111
onClick={onOperatorSelect}
112112
>
113113
<>
114-
<>
115-
{/* Add a container div with fixed height for the avatar */}
116-
<div className="h-8 flex items-center justify-center">
117-
<OperatorAvatar name={name} size="large" />
118-
</div>
119-
120-
{/* Text container with min-height and auto overflow handling */}
121-
<div className="min-h-[2.5rem] flex items-center justify-center">
122-
<p
123-
className={clsx(
124-
'font-bold leading-none text-center',
125-
'break-words' // Allow text to break to next line
126-
)}
127-
>
128-
{useLocalizedOperatorName(name)}
129-
</p>
130-
</div>
131-
</>
114+
<OperatorAvatar className="mt-3" name={name} size="large" />
115+
<p
116+
className={clsx(
117+
'mt-1 font-bold leading-tight text-center',
118+
'break-words', // Allow text to break to next line
119+
)}
120+
>
121+
{useLocalizedOperatorName(name)}
122+
</p>
132123

133124
{selected && (
134125
<div
@@ -182,7 +173,7 @@ export const SheetOperatorItem: FC<SheetOperatorItemProp> = ({ name }) => {
182173
/>
183174
)}
184175
{grouped && (
185-
<span className="text-xs font-bold mt-3">
176+
<span className="text-xs font-bold mt-1">
186177
<Icon icon="warning-sign" size={15} />
187178
{
188179
t.components.editor.operator.sheet.sheetOperator.SheetOperatorItem

0 commit comments

Comments
 (0)