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 Nov 14, 2024
1 parent adadcb5 commit e57d9fe
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 e57d9fe

Please sign in to comment.