Skip to content

Commit

Permalink
Merge pull request Expensify#32560 from VickyStash/ts-migration/repor…
Browse files Browse the repository at this point in the history
…tActionItemTaskAction-component

[TS migration] Migrate 'ReportActionItemTaskAction.js' component to TypeScript
  • Loading branch information
thienlnam authored Dec 14, 2023
2 parents 66ef49e + 3d2e50f commit 17c1ea8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 40 deletions.
34 changes: 0 additions & 34 deletions src/components/ReportActionItem/TaskAction.js

This file was deleted.

24 changes: 24 additions & 0 deletions src/components/ReportActionItem/TaskAction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import {View} from 'react-native';
import Text from '@components/Text';
import useThemeStyles from '@hooks/useThemeStyles';
import * as TaskUtils from '@libs/TaskUtils';

type TaskActionProps = {
/** Name of the reportAction action */
actionName: string;
};

function TaskAction({actionName}: TaskActionProps) {
const styles = useThemeStyles();

return (
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
<Text style={[styles.chatItemMessage, styles.colorMuted]}>{TaskUtils.getTaskReportActionMessage(actionName)}</Text>
</View>
);
}

TaskAction.displayName = 'TaskAction';

export default TaskAction;
7 changes: 1 addition & 6 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,7 @@ function ReportActionItem(props) {
props.action.actionName === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED ||
props.action.actionName === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED
) {
children = (
<TaskAction
taskReportID={props.action.originalMessage.taskReportID.toString()}
actionName={props.action.actionName}
/>
);
children = <TaskAction actionName={props.action.actionName} />;
} else if (ReportActionsUtils.isCreatedTaskReportAction(props.action)) {
children = (
<ShowContextMenuContext.Provider value={contextValue}>
Expand Down

0 comments on commit 17c1ea8

Please sign in to comment.