-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[XS][1648] Add noWrap to team name display in TeamCharacterSelector
#2518
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -173,22 +173,34 @@ function TabNav({ | |||||||||||||||||||||||||||||||||||||||||||||||||
'&:hover': { | ||||||||||||||||||||||||||||||||||||||||||||||||||
color: 'info.light', | ||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
alignItems: 'center', | ||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<PersonIcon /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography | ||||||||||||||||||||||||||||||||||||||||||||||||||
variant="h6" | ||||||||||||||||||||||||||||||||||||||||||||||||||
noWrap | ||||||||||||||||||||||||||||||||||||||||||||||||||
sx={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||
display: 'flex', | ||||||||||||||||||||||||||||||||||||||||||||||||||
gap: 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
alignItems: 'center', | ||||||||||||||||||||||||||||||||||||||||||||||||||
justifyContent: 'center', | ||||||||||||||||||||||||||||||||||||||||||||||||||
textShadow: '#000 0 0 10px !important', | ||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<PersonIcon /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<strong>{teamChar.name}</strong> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Divider orientation="vertical" variant="middle" flexItem /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<CheckroomIcon /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Divider orientation="vertical" variant="middle" flexItem /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<CheckroomIcon /> | ||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography | ||||||||||||||||||||||||||||||||||||||||||||||||||
variant="h6" | ||||||||||||||||||||||||||||||||||||||||||||||||||
noWrap | ||||||||||||||||||||||||||||||||||||||||||||||||||
sx={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||
gap: 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
alignItems: 'center', | ||||||||||||||||||||||||||||||||||||||||||||||||||
justifyContent: 'center', | ||||||||||||||||||||||||||||||||||||||||||||||||||
textShadow: '#000 0 0 10px !important', | ||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+194
to
+203
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider flexible width distribution for long names While the Consider applying this improvement: <Typography
variant="h6"
noWrap
sx={{
gap: 1,
alignItems: 'center',
justifyContent: 'center',
textShadow: '#000 0 0 10px !important',
+ flexShrink: 1,
+ minWidth: 0,
+ overflow: 'hidden',
+ textOverflow: 'ellipsis'
}}
> This change would:
📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
{database.teams.getActiveBuildName(loadoutDatum)} | ||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography> | ||||||||||||||||||||||||||||||||||||||||||||||||||
</CardContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -46,7 +46,11 @@ export function BuildCard({ | |||||||||||||||||||||||||
const clickableAreaContent = ( | ||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||
<CardHeader | ||||||||||||||||||||||||||
title={name} | ||||||||||||||||||||||||||
title={ | ||||||||||||||||||||||||||
<Typography noWrap gutterBottom variant="h6"> | ||||||||||||||||||||||||||
{name} | ||||||||||||||||||||||||||
</Typography> | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
Comment on lines
+49
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adding a title attribute for accessibility. When text is truncated with <Typography noWrap gutterBottom variant="h6"
+ title={typeof name === 'string' ? name : undefined}
>
{name}
</Typography> 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
action={ | ||||||||||||||||||||||||||
description && ( | ||||||||||||||||||||||||||
<Tooltip title={<Typography>{description}</Typography>}> | ||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Add maxWidth and text overflow handling for character names
The Typography component with
noWrap
lacks maxWidth constraints and text overflow handling, which could lead to layout issues with long character names. Add the following properties to the Typography's sx prop:🔗 Analysis chain
Verify text overflow handling for long character names
The addition of
noWrap
prevents text wrapping as intended. However, we should ensure proper text truncation for long character names.Let's verify the text overflow behavior:
Let me check the surrounding context of the Typography component to better understand the layout constraints.
Let me try a different approach to check the component's structure and styling.
Let me check the parent container's styling to understand the width constraints.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 166
Script:
Length of output: 88
Script:
Length of output: 2880
Script:
Length of output: 96