Sort team names in favorites
This commit is contained in:
parent
416a4fbc86
commit
05000a3243
|
|
@ -44,6 +44,8 @@ export function FavoriteBar({teams}) {
|
||||||
return <div>Loading...</div>;
|
return <div>Loading...</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sortedTeams = [...teams].sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div style={{display: 'flex', alignItems: 'center'}}>
|
<div style={{display: 'flex', alignItems: 'center'}}>
|
||||||
|
|
@ -62,7 +64,7 @@ export function FavoriteBar({teams}) {
|
||||||
<div className="favorite-bar">
|
<div className="favorite-bar">
|
||||||
<h3>All Teams</h3>
|
<h3>All Teams</h3>
|
||||||
<div>
|
<div>
|
||||||
{teams.map(team => (
|
{sortedTeams.map(team => (
|
||||||
<div key={team.id} style={{display: 'flex', alignItems: 'center'}}>
|
<div key={team.id} style={{display: 'flex', alignItems: 'center'}}>
|
||||||
<Button onClick={() => toggleFavorite(team)} style={{marginRight: '10px'}}>
|
<Button onClick={() => toggleFavorite(team)} style={{marginRight: '10px'}}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue