Skip to content

Commit

Permalink
Use getLocalisedName on the UserList component
Browse files Browse the repository at this point in the history
  • Loading branch information
Siyasanga committed Oct 23, 2024
1 parent e394dbe commit a9d0747
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/client/src/views/SysAdmin/Team/user/UserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
NATL_ADMIN_ROLES,
SYS_ADMIN_ROLES
} from '@client/utils/constants'
import { createNamesMap } from '@client/utils/data-formatting'
import { createNamesMap, getLocalisedName } from '@client/utils/data-formatting'
import { SysAdminContentWrapper } from '@client/views/SysAdmin/SysAdminContentWrapper'
import {
getAddressName,
Expand Down Expand Up @@ -552,14 +552,7 @@ function UserListComponent(props: IProps) {
return data.searchUsers.results.map(
(user: User | null, index: number) => {
if (user !== null) {
const name =
(user.name &&
intl.formatMessage(constantsMessages.humanName, {
firstName: user.name[0].firstNames,
middleName: user.name[0].middleName,
lastName: user.name[0].familyName
})) ||
''
const name = getLocalisedName(intl, user.name[0])
const role = intl.formatMessage({
id: getUserRoleIntlKey(user.role._id)
})
Expand Down

0 comments on commit a9d0747

Please sign in to comment.