diff --git a/src/components/ReportActionItem/RenameAction.tsx b/src/components/ReportActionItem/RenameAction.tsx deleted file mode 100644 index e65fc68ecd42..000000000000 --- a/src/components/ReportActionItem/RenameAction.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import Text from '@components/Text'; -import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; -import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; -import useLocalize from '@hooks/useLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import * as ReportActionsUtils from '@libs/ReportActionsUtils'; -import type {ReportAction} from '@src/types/onyx'; - -type RenameActionProps = WithCurrentUserPersonalDetailsProps & { - /** All the data of the action */ - action: ReportAction; -}; - -function RenameAction({currentUserPersonalDetails, action}: RenameActionProps) { - const styles = useThemeStyles(); - const {translate} = useLocalize(); - - const currentUserAccountID = currentUserPersonalDetails.accountID ?? '-1'; - const userDisplayName = action.person?.[0]?.text; - const actorAccountID = action.actorAccountID ?? '-1'; - const displayName = actorAccountID === currentUserAccountID ? `${translate('common.you')}` : `${userDisplayName}`; - const originalMessage = ReportActionsUtils.isRenamedAction(action) ? ReportActionsUtils.getOriginalMessage(action) : null; - const oldName = originalMessage?.oldName ?? ''; - const newName = originalMessage?.newName ?? ''; - - return ( - - {displayName} - {translate('newRoomPage.renamedRoomAction', {oldName, newName})} - - ); -} - -RenameAction.displayName = 'RenameAction'; - -export default withCurrentUserPersonalDetails(RenameAction); diff --git a/src/languages/en.ts b/src/languages/en.ts index 44686dbc53df..ba3b519f1f20 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3540,7 +3540,7 @@ export default { roomNameInvalidError: 'Room names can only include lowercase letters, numbers, and hyphens.', pleaseEnterRoomName: 'Please enter a room name.', pleaseSelectWorkspace: 'Please select a workspace.', - renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => ` renamed this room from ${oldName} to ${newName}`, + renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => `renamed this room from ${oldName} to ${newName}`, roomRenamedTo: ({newName}: RoomRenamedToParams) => `Room renamed to ${newName}`, social: 'social', selectAWorkspace: 'Select a workspace', diff --git a/src/languages/es.ts b/src/languages/es.ts index 090185716d4d..f8f130e8d7b9 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3594,7 +3594,7 @@ export default { roomNameInvalidError: 'Los nombres de las salas solo pueden contener minúsculas, números y guiones.', pleaseEnterRoomName: 'Por favor, escribe el nombre de una sala.', pleaseSelectWorkspace: 'Por favor, selecciona un espacio de trabajo.', - renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => ` cambió el nombre de la sala de ${oldName} a ${newName}`, + renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => `cambió el nombre de la sala de ${oldName} a ${newName}`, roomRenamedTo: ({newName}: RoomRenamedToParams) => `Sala renombrada a ${newName}`, social: 'social', selectAWorkspace: 'Seleccionar un espacio de trabajo', diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 1d73a4b12f2f..b56576bd9cce 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -24,7 +24,6 @@ import ChronosOOOListActions from '@components/ReportActionItem/ChronosOOOListAc import ExportIntegration from '@components/ReportActionItem/ExportIntegration'; import IssueCardMessage from '@components/ReportActionItem/IssueCardMessage'; import MoneyRequestAction from '@components/ReportActionItem/MoneyRequestAction'; -import RenameAction from '@components/ReportActionItem/RenameAction'; import ReportPreview from '@components/ReportActionItem/ReportPreview'; import TaskAction from '@components/ReportActionItem/TaskAction'; import TaskPreview from '@components/ReportActionItem/TaskPreview'; @@ -658,6 +657,13 @@ function ReportActionItem({ children = ; } else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION)) { children = ; + } else if (ReportActionsUtils.isRenamedAction(action)) { + const initialMessage = ReportActionsUtils.getOriginalMessage(action); + const message = translate('newRoomPage.renamedRoomAction', { + oldName: initialMessage?.oldName ?? '', + newName: initialMessage?.newName ?? '', + }); + children = ; } else { const hasBeenFlagged = ![CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING].some((item) => item === moderationDecision) && @@ -839,9 +845,6 @@ function ReportActionItem({ /> ); } - if (action.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) { - return ; - } if (ReportActionsUtils.isChronosOOOListAction(action)) { return (