Skip to content

Commit

Permalink
Adjust user profile witness box list display to alphabetical sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfarhat authored and dnotestein committed Jun 28, 2024
1 parent d2a13ff commit c9151ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/account/AccountWitnessVotesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ const buildTableBody = (voters: string[]) => {
};

const AccountWitnessVotesCard: React.FC<AccountWitnessVotesCardProps> = ({
voters,
voters: initialVoters,
}) => {
const [isPropertiesHidden, setIsPropertiesHidden] = useState(true);

const voters = [...initialVoters];
if (!voters || !voters.length) return null;

voters.sort((a, b) =>
a.toLowerCase().localeCompare(b.toLowerCase()) // Changed: Sorting logic to ensure alphabetical order
);
const handlePropertiesVisibility = () => {
setIsPropertiesHidden(!isPropertiesHidden);
};
Expand Down

0 comments on commit c9151ed

Please sign in to comment.