MCPcopy Index your code
hub / github.com/refined-github/refined-github / markForm

Function markForm

source/features/notifications-ui.tsx:72–87  ·  view source on GitHub ↗
(status: 'read' | 'unread')

Source from the content-addressed store, hash-verified

70}
71
72function markForm(status: 'read' | 'unread'): JSX.Element {
73 const form = $(`form[data-status="${status}"]`);
74 form.id ||= `rgh-mark-${status}-form`;
75 const icon = $('.mr-1:has(svg)', form).cloneNode(true);
76 return (
77 <button
78 className='d-flex justify-content-center align-items-center btn btn-sm mr-2'
79 form={form.id}
80 type="submit">
81 {icon}
82 {/* Spaces collapsed, use mr-1 to space words */}
83 <span className="not-sm-sr-only sr-only mr-1">Mark as</span>
84 {upperCaseFirst(status)}
85 </button>
86 );
87}
88
89function unwrapActions(details: HTMLDetailsElement): void {
90 details.before(markForm('read'), markForm('unread'));

Callers 1

unwrapActionsFunction · 0.85

Calls 2

upperCaseFirstFunction · 0.85
cloneNodeMethod · 0.80

Tested by

no test coverage detected