|
1 | 1 | import './style.scss'; |
2 | 2 | import MonthSelect from 'components/MonthSelect'; |
3 | 3 | import YearSelect from 'components/YearSelect'; |
| 4 | +import AdSense from 'components/adsense'; |
4 | 5 | import AjaxForm from 'components/ajaxForm'; |
5 | 6 | import alert from 'components/dialogs/alert'; |
6 | 7 | import confirm from 'components/dialogs/confirm'; |
@@ -47,7 +48,12 @@ export default async function Plugin({ id: pluginId, section = 'description' }) |
47 | 48 | const selectYear = Ref(); |
48 | 49 | const selectMonth = Ref(); |
49 | 50 | const $comments = <CommentsContainerAndForm listRef={commentListRef} plugin={plugin} user={user} id={pluginId} userComment={userComment} />; |
50 | | - const $description = <p className='md' innerHTML={marked.parse(description)} />; |
| 51 | + const $description = ( |
| 52 | + <article style={{ width: '100%', overflow: 'auto' }}> |
| 53 | + <AdSense name='readme' style={{ position: 'relative' }} /> |
| 54 | + <p className='md' innerHTML={marked.parse(description)} /> |
| 55 | + </article> |
| 56 | + ); |
51 | 57 | const updateOrder = () => { |
52 | 58 | renderOrders(ordersList, pluginId, selectYear.value, selectMonth.value); |
53 | 59 | }; |
@@ -466,6 +472,18 @@ function CommentsContainerAndForm({ plugin, listRef, user, id, userComment }) { |
466 | 472 | } |
467 | 473 | } |
468 | 474 |
|
| 475 | +/** |
| 476 | + * Renders an icon input element with customizable icon states and selection behavior. |
| 477 | + * |
| 478 | + * @param {Object} props - The properties for this component. |
| 479 | + * @param {string} props.name - The name attribute of the input, used for grouping. |
| 480 | + * @param {string} props.icon - The default icon class to display. |
| 481 | + * @param {string} props.iconSelected - The icon class to display when selected. |
| 482 | + * @param {string} props.value - The value attribute of the input. |
| 483 | + * @param {string} props.title - The title attribute used for the label and input. |
| 484 | + * @param {boolean} props.checked - Whether the input is initially checked. |
| 485 | + * @returns {HTMLElement} The rendered icon-based radio input component. |
| 486 | + */ |
469 | 487 | function IconInput({ name, icon, iconSelected, value, title, checked }) { |
470 | 488 | const input = Ref(); |
471 | 489 | const iconHolder = Ref(); |
@@ -509,6 +527,12 @@ function IconInput({ name, icon, iconSelected, value, title, checked }) { |
509 | 527 | ); |
510 | 528 | } |
511 | 529 |
|
| 530 | +/** |
| 531 | + * Toggles the flagged state of the provided element by updating its class name and title. |
| 532 | + * |
| 533 | + * @param {boolean} flagged - Indicates whether the element should be set as flagged. |
| 534 | + * @param {HTMLElement} flagRef - A reference to the HTML element that needs its class and title updated. |
| 535 | + */ |
512 | 536 | function toggleFlag(flagged, flagRef) { |
513 | 537 | if (flagged) { |
514 | 538 | flagRef.className = 'icon flag danger'; |
|
0 commit comments