Skip to content

Commit

Permalink
move comments to task description
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Apr 26, 2024
1 parent 8aed339 commit 042c9a8
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 162 deletions.
63 changes: 37 additions & 26 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3683,8 +3683,9 @@ const CONST = {
type: 'createWorkspace',
autoCompleted: true,
title: 'Create a workspace',
subtitle: '<strong>Create a workspace</strong> to track expenses, scan receipts, chat, and more.',
message:
description:
'<strong>Create a workspace</strong> to track expenses, scan receipts, chat, and more.\n' +
'\n' +
'Here’s how to create a workspace:\n' +
'\n' +
'1. Click your profile picture.\n' +
Expand All @@ -3696,8 +3697,9 @@ const CONST = {
type: 'trackExpense',
autoCompleted: false,
title: 'Track an expense',
subtitle: '<strong>Track an expense</strong> in any currency, in just a few clicks.',
message:
description:
'<strong>Track an expense</strong> in any currency, in just a few clicks.\n' +
'\n' +
'Here’s how to track an expense:\n' +
'\n' +
'1. Click the green <strong>+</strong> button.\n' +
Expand All @@ -3723,8 +3725,9 @@ const CONST = {
type: 'submitExpense',
autoCompleted: false,
title: 'Submit an expense',
subtitle: '<strong>Submit an expense</strong> by entering an amount or scanning a receipt.',
message:
description:
'<strong>Submit an expense</strong> by entering an amount or scanning a receipt.\n' +
'\n' +
'Here’s how to submit an expense:\n' +
'\n' +
'1. Click the green <strong>+</strong> button.\n' +
Expand All @@ -3738,8 +3741,9 @@ const CONST = {
type: 'enableWallet',
autoCompleted: false,
title: 'Enable your wallet',
subtitle: 'You’ll need to <strong>enable your Expensify Wallet</strong> to get paid back. Don’t worry, it’s easy!',
message:
description:
'You’ll need to <strong>enable your Expensify Wallet</strong> to get paid back. Don’t worry, it’s easy!\n' +
'\n' +
'Here’s how to set up your wallet:\n' +
'\n' +
'1. Click your profile picture.\n' +
Expand All @@ -3764,8 +3768,9 @@ const CONST = {
type: 'createWorkspace',
autoCompleted: true,
title: 'Create a workspace',
subtitle: '<strong>Create a workspace</strong> to track expenses, scan receipts, chat, and more.',
message:
description:
'<strong>Create a workspace</strong> to track expenses, scan receipts, chat, and more.\n' +
'\n' +
'Here’s how to create a workspace:\n' +
'\n' +
'1. Click your profile picture.\n' +
Expand All @@ -3777,8 +3782,7 @@ const CONST = {
type: 'meetGuide',
autoCompleted: false,
title: 'Meet your setup specialist',
subtitle: '',
message: ({adminsRoomLink, guideCalendarLink}: {adminsRoomLink: string; guideCalendarLink: string}) =>
description: ({adminsRoomLink, guideCalendarLink}: {adminsRoomLink: string; guideCalendarLink: string}) =>
`Meet your setup specialist, who can answer any questions as you get started with Expensify. Yes, a real human!\n` +
'\n' +
`Chat with the specialist in your [#admins room](${adminsRoomLink}) or [schedule a call](${guideCalendarLink}) today.`,
Expand All @@ -3787,8 +3791,9 @@ const CONST = {
type: 'setupCategories',
autoCompleted: false,
title: 'Set up categories',
subtitle: '<strong>Set up categories</strong> so your team can code expenses for easy reporting.',
message:
description:
'<strong>Set up categories</strong> so your team can code expenses for easy reporting.\n' +
'\n' +
'Here’s how to set up categories:\n' +
'\n' +
'1. Click your profile picture.\n' +
Expand All @@ -3803,8 +3808,9 @@ const CONST = {
type: 'addExpenseApprovals',
autoCompleted: false,
title: 'Add expense approvals',
subtitle: '<strong>Add expense approvals</strong> to review your team’s spend and keep it under control.',
message:
description:
'<strong>Add expense approvals</strong> to review your team’s spend and keep it under control.\n' +
'\n' +
'Here’s how to add expense approvals:\n' +
'\n' +
'1. Click your profile picture.\n' +
Expand All @@ -3819,8 +3825,9 @@ const CONST = {
type: 'inviteTeam',
autoCompleted: false,
title: 'Invite your team',
subtitle: '<strong>Invite your team</strong> to Expensify so they can start tracking expenses today.',
message:
description:
'<strong>Invite your team</strong> to Expensify so they can start tracking expenses today.\n' +
'\n' +
'Here’s how to invite your team:\n' +
'\n' +
'1. Click your profile picture.\n' +
Expand All @@ -3847,8 +3854,9 @@ const CONST = {
type: 'trackExpense',
autoCompleted: false,
title: 'Track an expense',
subtitle: '<strong>Track an expense</strong> in any currency, whether you have a receipt or not.',
message:
description:
'<strong>Track an expense</strong> in any currency, whether you have a receipt or not.\n' +
'\n' +
'Here’s how to track an expense:\n' +
'\n' +
'1. Click the green <strong>+</strong> button.\n' +
Expand All @@ -3874,8 +3882,9 @@ const CONST = {
type: 'startChat',
autoCompleted: false,
title: 'Start a chat',
subtitle: '<strong>Start a chat</strong> with a friend or group using their email or phone number.',
message:
description:
'<strong>Start a chat</strong> with a friend or group using their email or phone number.\n' +
'\n' +
'Here’s how to start a chat:\n' +
'\n' +
'1. Click the green <strong>+</strong> button.\n' +
Expand All @@ -3890,8 +3899,9 @@ const CONST = {
type: 'splitExpense',
autoCompleted: false,
title: 'Split an expense',
subtitle: '<strong>Split an expense</strong> right in your chat with one or more friends.',
message:
description:
'<strong>Split an expense</strong> right in your chat with one or more friends.\n' +
'\n' +
'Here’s how to request money:\n' +
'\n' +
'1. Click the green <strong>+</strong> button.\n' +
Expand All @@ -3905,8 +3915,9 @@ const CONST = {
type: 'enableWallet',
autoCompleted: false,
title: 'Enable your wallet',
subtitle: 'You’ll need to <strong>enable your Expensify Wallet</strong> to get paid back. Don’t worry, it’s easy!',
message:
description:
'You’ll need to <strong>enable your Expensify Wallet</strong> to get paid back. Don’t worry, it’s easy!\n' +
'\n' +
'Here’s how to enable your wallet:\n' +
'\n' +
'1. Click your profile picture.\n' +
Expand Down
8 changes: 6 additions & 2 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ type MenuItemBaseProps = {
/** Should render the content in HTML format */
shouldRenderAsHTML?: boolean;

/** Whether or not the text should be escaped */
shouldEscapeText?: boolean;

/** Should we grey out the menu item when it is disabled? */
shouldGreyOutWhenDisabled?: boolean;

Expand Down Expand Up @@ -313,6 +316,7 @@ function MenuItem(
isSmallAvatarSubscriptMenu = false,
brickRoadIndicator,
shouldRenderAsHTML = false,
shouldEscapeText = undefined,
shouldGreyOutWhenDisabled = true,
shouldUseDefaultCursorWhenDisabled = false,
isAnonymousAction = false,
Expand Down Expand Up @@ -366,8 +370,8 @@ function MenuItem(
return '';
}
const parser = new ExpensiMark();
return parser.replace(title);
}, [title, shouldParseTitle]);
return parser.replace(title, {shouldEscapeText});
}, [title, shouldParseTitle, shouldEscapeText]);

const processedTitle = useMemo(() => {
let titleToWrap = '';
Expand Down
2 changes: 2 additions & 0 deletions src/components/ReportActionItem/TaskView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ function TaskView({report, shouldShowHorizontalRule, ...props}: TaskViewProps) {
shouldGreyOutWhenDisabled={false}
numberOfLinesTitle={0}
interactive={!isDisableInteractive}
shouldRenderAsHTML
shouldEscapeText={false}
/>
</OfflineWithFeedback>
<OfflineWithFeedback pendingAction={report.pendingFields?.managerID}>
Expand Down
Loading

0 comments on commit 042c9a8

Please sign in to comment.