Skip to content

Commit

Permalink
Merge pull request #38802 from barttom/feat/38772/update-ui-for-compl…
Browse files Browse the repository at this point in the history
…eted-task
  • Loading branch information
francoisl authored Mar 27, 2024
2 parents 77fe8da + 0000259 commit 4001bf3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/HTMLEngineProvider/BaseHTMLEngineProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ function BaseHTMLEngineProvider({textSelectable = false, children, enableExperim
contentModel: HTMLContentModel.block,
}),
emoji: HTMLElementModel.fromCustomModel({tagName: 'emoji', contentModel: HTMLContentModel.textual}),
'completed-task': HTMLElementModel.fromCustomModel({
tagName: 'completed-task',
mixedUAStyles: {...styles.textSupporting, ...styles.textLineThrough},
contentModel: HTMLContentModel.textual,
}),
}),
[styles.colorMuted, styles.formError, styles.mb0, styles.textLabelSupporting, styles.lh16],
[styles.formError, styles.mb0, styles.colorMuted, styles.textLabelSupporting, styles.lh16, styles.textSupporting, styles.textLineThrough],
);
/* eslint-enable @typescript-eslint/naming-convention */

Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/TaskPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function TaskPreview({taskReport, taskReportID, action, contextMenuAnchor, chatR
})}
accessibilityLabel={translate('task.task')}
/>
<RenderHTML html={htmlForTaskPreview} />
<RenderHTML html={isTaskCompleted ? `<completed-task>${htmlForTaskPreview}</completed-task>` : htmlForTaskPreview} />
</View>
<Icon
src={Expensicons.ArrowRight}
Expand Down
4 changes: 4 additions & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4694,6 +4694,10 @@ const styles = (theme: ThemeColors) =>
...headlineFont,
fontSize: variables.fontSizeXLarge,
},

textLineThrough: {
textDecorationLine: 'line-through',
},
} satisfies Styles);

type ThemeStyles = ReturnType<typeof styles>;
Expand Down

0 comments on commit 4001bf3

Please sign in to comment.