Skip to content

Commit

Permalink
migrate ReportActionItemSingle
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Nov 22, 2023
1 parent 5c73228 commit 86767e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ function ReportActionItem(props) {
<ReportActionItemSingle
action={props.action}
showHeader={!props.draftMessage}
wrapperStyles={[styles.chatItem, isWhisper ? styles.pt1 : {}]}
wrapperStyle={isWhisper ? styles.pt1 : {}}
shouldShowSubscriptAvatar={props.shouldShowSubscriptAvatar}
report={props.report}
iouReport={props.iouReport}
Expand Down Expand Up @@ -581,7 +581,6 @@ function ReportActionItem(props) {
<ReportActionItemSingle
action={parentReportAction}
showHeader={!props.draftMessage}
wrapperStyles={[styles.chatItem]}
report={props.report}
>
<RenderHTML html={`<comment>${props.translate('parentReportAction.deletedTask')}</comment>`} />
Expand Down
11 changes: 6 additions & 5 deletions src/pages/home/report/ReportActionItemSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import Permissions from '@libs/Permissions';
import * as ReportUtils from '@libs/ReportUtils';
import * as UserUtils from '@libs/UserUtils';
import reportPropTypes from '@pages/reportPropTypes';
import styles from '@styles/styles';
import stylePropTypes from '@styles/stylePropTypes';
import * as StyleUtils from '@styles/StyleUtils';
import themeColors from '@styles/themes/default';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand All @@ -37,8 +38,7 @@ const propTypes = {
action: PropTypes.shape(reportActionPropTypes).isRequired,

/** Styles for the outermost View */
// eslint-disable-next-line react/forbid-prop-types
wrapperStyles: PropTypes.arrayOf(PropTypes.object),
wrapperStyle: stylePropTypes,

/** Children view component for this action item */
children: PropTypes.node.isRequired,
Expand All @@ -65,7 +65,7 @@ const propTypes = {
};

const defaultProps = {
wrapperStyles: [styles.chatItem],
wrapperStyle: {},
showHeader: true,
shouldShowSubscriptAvatar: false,
hasBeenFlagged: false,
Expand All @@ -83,6 +83,7 @@ const showWorkspaceDetails = (reportID) => {
};

function ReportActionItemSingle(props) {
const styles = useThemeStyles();
const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;
const actorAccountID = props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && props.iouReport ? props.iouReport.managerID : props.action.actorAccountID;
let displayName = ReportUtils.getDisplayNameForParticipant(actorAccountID);
Expand Down Expand Up @@ -211,7 +212,7 @@ function ReportActionItemSingle(props) {
const statusTooltipText = formattedDate ? `${statusText} (${formattedDate})` : statusText;

return (
<View style={props.wrapperStyles}>
<View style={[styles.chatItem, props.wrapperStyle]}>
<PressableWithoutFeedback
style={[styles.alignSelfStart, styles.mr3]}
onPressIn={ControlSelection.block}
Expand Down

0 comments on commit 86767e1

Please sign in to comment.