Skip to content

Commit

Permalink
chore: new assign design
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Sep 14, 2024
1 parent 182998e commit 5305d79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
12 changes: 6 additions & 6 deletions src/handlers/shared/generate-assignment-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export async function generateAssignmentComment(context: Context, issueCreatedAt
registeredWallet:
(await context.adapters.supabase.user.getWalletByUserId(senderId, issueNumber)) ||
"Register your wallet address using the following slash command: `/wallet 0x0000...0000`",
tips: `<h6>Tips:</h6>
<ul>
<li>Use <code>/wallet 0x0000...0000</code> if you want to update your registered payment wallet address.</li>
<li>Be sure to open a draft pull request as soon as possible to communicate updates on your progress.</li>
<li>Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.</li>
<ul>`,
tips: `> [!TIP]
> <ul>
> <li>Use <code>/wallet 0x0000...0000</code> if you want to update your registered payment wallet address.</li>
> <li>Be sure to open a draft pull request as soon as possible to communicate updates on your progress.</li>
> <li>Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.</li>
> </ul>`,
};
}
29 changes: 13 additions & 16 deletions src/handlers/shared/table.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
export function assignTableComment({ taskDeadline, registeredWallet, isTaskStale, daysElapsedSinceTaskCreation }: AssignTableCommentParams) {
let taskStaleWarning = ``;
const elements: string[] = ["<samp>", "<table>"];

if (isTaskStale) {
taskStaleWarning = `<tr><td>Warning!</td> <td>This task was created over ${daysElapsedSinceTaskCreation} days ago. Please confirm that this issue specification is accurate before starting.</td></tr>`;
elements.push(
"<tr>",
"<td>Warning!</td>",
`<td><b>This task was created over ${daysElapsedSinceTaskCreation} days ago. Please confirm that this issue specification is accurate before starting.</b></td>`,
"</tr>"
);
}
let deadlineWarning = ``;

if (taskDeadline) {
deadlineWarning = `<tr><td>Deadline</td><td>${taskDeadline}</td></tr>`;
elements.push("<tr>", "<td>Deadline</td>", `<td><b>${taskDeadline}</b></td>`, "</tr>");
}

return `
<samp>
<table>
${taskStaleWarning}
${deadlineWarning}
<tr>
<td>Beneficiary</td>
<td>${registeredWallet}</td>
</tr>
</table>
</samp>
`;
elements.push("<tr>", "<td>Beneficiary</td>", `<td><b>${registeredWallet}</b></td>`, "</tr>", "</table>", "</samp>");

return elements.join("\n");
}

interface AssignTableCommentParams {
Expand Down

0 comments on commit 5305d79

Please sign in to comment.