more imporvmentes
This commit is contained in:
@@ -22,12 +22,21 @@ const TeamListItem = React.memo(({ team }: TeamListItemProps) => {
|
||||
[team.players]
|
||||
);
|
||||
|
||||
const teamNameSize = useMemo(() => {
|
||||
const nameLength = team.name.length;
|
||||
if (nameLength > 20) return 'xs';
|
||||
if (nameLength > 15) return 'sm';
|
||||
return 'md';
|
||||
}, [team.name]);
|
||||
|
||||
return (
|
||||
<Group justify="space-between" w="100%">
|
||||
<Text fw={500}>{`${team.name}`}</Text>
|
||||
<Stack ml="auto" gap={0}>
|
||||
{playerNames.map((name) => (
|
||||
<Text size="xs" c="dimmed" ta="right">
|
||||
<Group justify="space-between" w="100%" wrap="nowrap">
|
||||
<Text fw={500} size={teamNameSize} style={{ flexShrink: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{`${team.name}`}
|
||||
</Text>
|
||||
<Stack ml="auto" gap={0} style={{ flexShrink: 0 }}>
|
||||
{playerNames.map((name, idx) => (
|
||||
<Text key={idx} size="xs" c="dimmed" ta="right">
|
||||
{name}
|
||||
</Text>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user