From cbcb0429d090d8c5de30a6029ab84510ad9c0de8 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 18 Sep 2020 15:52:31 +0200 Subject: [PATCH] props -> attrs in comments --- js/src/common/components/Alert.js | 4 ++-- js/src/common/components/Button.js | 6 ++++-- js/src/common/components/Checkbox.js | 2 +- js/src/common/components/ConfirmDocumentUnload.js | 2 +- js/src/common/components/LinkButton.js | 8 ++++---- js/src/common/components/LoadingIndicator.js | 7 ++++--- js/src/common/components/Placeholder.js | 2 +- js/src/forum/ForumApplication.js | 4 ++-- js/src/forum/components/AvatarEditor.js | 2 +- js/src/forum/components/ComposerBody.js | 2 +- js/src/forum/components/DiscussionList.js | 2 +- js/src/forum/components/DiscussionListItem.js | 2 +- js/src/forum/components/DiscussionListPane.js | 2 +- js/src/forum/components/ForgotPasswordModal.js | 2 +- js/src/forum/components/NotificationGrid.js | 2 +- js/src/forum/components/TerminalPost.js | 2 +- js/src/forum/components/TextEditor.js | 2 +- js/src/forum/components/UserCard.js | 2 +- 18 files changed, 29 insertions(+), 26 deletions(-) diff --git a/js/src/common/components/Alert.js b/js/src/common/components/Alert.js index ac2e6fb2f..d443a7ebe 100644 --- a/js/src/common/components/Alert.js +++ b/js/src/common/components/Alert.js @@ -7,7 +7,7 @@ import extract from '../utils/extract'; * The `Alert` component represents an alert box, which contains a message, * some controls, and may be dismissible. * - * The alert may have the following special props: + * ### Attrs * * - `type` The type of alert this is. Will be used to give the alert a class * name of `Alert--{type}`. @@ -15,7 +15,7 @@ import extract from '../utils/extract'; * - `dismissible` Whether or not the alert can be dismissed. * - `ondismiss` A callback to run when the alert is dismissed. * - * All other props will be assigned as attributes on the alert element. + * All other attrs will be assigned as attributes on the DOM element. */ export default class Alert extends Component { view(vnode) { diff --git a/js/src/common/components/Button.js b/js/src/common/components/Button.js index 4c50b8e99..bf756b0dd 100644 --- a/js/src/common/components/Button.js +++ b/js/src/common/components/Button.js @@ -7,7 +7,9 @@ import LoadingIndicator from './LoadingIndicator'; /** * The `Button` component defines an element which, when clicked, performs an - * action. The button may have the following special props: + * action. + * + * ### Attrs * * - `icon` The name of the icon class. If specified, the button will be given a * 'has-icon' class name. @@ -16,7 +18,7 @@ import LoadingIndicator from './LoadingIndicator'; * removed. * - `loading` Whether or not the button should be in a disabled loading state. * - * All other props will be assigned as attributes on the button element. + * All other attrs will be assigned as attributes on the button element. * * Note that a Button has no default class names. This is because a Button can * be used to represent any generic clickable control, like a menu item. diff --git a/js/src/common/components/Checkbox.js b/js/src/common/components/Checkbox.js index 293f77f6a..ebcda7e80 100644 --- a/js/src/common/components/Checkbox.js +++ b/js/src/common/components/Checkbox.js @@ -7,7 +7,7 @@ import withAttr from '../utils/withAttr'; /** * The `Checkbox` component defines a checkbox input. * - * ### Props + * ### Attrs * * - `state` Whether or not the checkbox is checked. * - `className` The class name for the root element. diff --git a/js/src/common/components/ConfirmDocumentUnload.js b/js/src/common/components/ConfirmDocumentUnload.js index 681e3f32b..f9c87da9e 100644 --- a/js/src/common/components/ConfirmDocumentUnload.js +++ b/js/src/common/components/ConfirmDocumentUnload.js @@ -5,7 +5,7 @@ import Component from '../Component'; * event handler that prevents closing the browser window/tab based on the * return value of a given callback prop. * - * ### Props + * ### Attrs * * - `when` - a callback returning true when the browser should prompt for * confirmation before closing the window/tab diff --git a/js/src/common/components/LinkButton.js b/js/src/common/components/LinkButton.js index edd272fd4..a21cdd88c 100644 --- a/js/src/common/components/LinkButton.js +++ b/js/src/common/components/LinkButton.js @@ -3,9 +3,9 @@ import Button from './Button'; /** * The `LinkButton` component defines a `Button` which links to a route. * - * ### Props + * ### Attrs * - * All of the props accepted by `Button`, plus: + * All of the attrs accepted by `Button`, plus: * * - `active` Whether or not the page that this button links to is currently * active. @@ -29,9 +29,9 @@ export default class LinkButton extends Button { } /** - * Determine whether a component with the given props is 'active'. + * Determine whether a component with the given attrs is 'active'. * - * @param {Object} props + * @param {Object} attrs * @return {Boolean} */ static isActive(attrs) { diff --git a/js/src/common/components/LoadingIndicator.js b/js/src/common/components/LoadingIndicator.js index 007a1c64e..918c6f820 100644 --- a/js/src/common/components/LoadingIndicator.js +++ b/js/src/common/components/LoadingIndicator.js @@ -2,12 +2,13 @@ import Component from '../Component'; import { Spinner } from 'spin.js'; /** - * The `LoadingIndicator` component displays a loading spinner with spin.js. It - * may have the following special props: + * The `LoadingIndicator` component displays a loading spinner with spin.js. + * + * ### Attrs * * - `size` The spin.js size preset to use. Defaults to 'small'. * - * All other props will be assigned as attributes on the element. + * All other attrs will be assigned as attributes on the DOM element. */ export default class LoadingIndicator extends Component { view() { diff --git a/js/src/common/components/Placeholder.js b/js/src/common/components/Placeholder.js index 7900f3bfa..a5d556351 100644 --- a/js/src/common/components/Placeholder.js +++ b/js/src/common/components/Placeholder.js @@ -4,7 +4,7 @@ import Component from '../Component'; * The `Placeholder` component displays a muted text with some call to action, * usually used as an empty state. * - * ### Props + * ### Attrs * * - `text` */ diff --git a/js/src/forum/ForumApplication.js b/js/src/forum/ForumApplication.js index ea8e5c5c9..b47f56a47 100644 --- a/js/src/forum/ForumApplication.js +++ b/js/src/forum/ForumApplication.js @@ -156,8 +156,8 @@ export default class ForumApplication extends Application { * will be reloaded. Otherwise, a SignUpModal will be opened, prefilled * with the provided details. * - * @param {Object} payload A dictionary of props to pass into the sign up - * modal. A truthy `loggedIn` prop indicates that the user has logged + * @param {Object} payload A dictionary of attrs to pass into the sign up + * modal. A truthy `loggedIn` attr indicates that the user has logged * in, and thus the page is reloaded. * @public */ diff --git a/js/src/forum/components/AvatarEditor.js b/js/src/forum/components/AvatarEditor.js index 1bbc15aef..3cb28ad64 100644 --- a/js/src/forum/components/AvatarEditor.js +++ b/js/src/forum/components/AvatarEditor.js @@ -11,7 +11,7 @@ import LoadingIndicator from '../../common/components/LoadingIndicator'; * The `AvatarEditor` component displays a user's avatar along with a dropdown * menu which allows the user to upload/remove the avatar. * - * ### Props + * ### Attrs * * - `className` * - `user` diff --git a/js/src/forum/components/ComposerBody.js b/js/src/forum/components/ComposerBody.js index 2140d13c3..d81a2c87a 100644 --- a/js/src/forum/components/ComposerBody.js +++ b/js/src/forum/components/ComposerBody.js @@ -11,7 +11,7 @@ import ItemList from '../../common/utils/ItemList'; * composer. Subclasses should implement the `onsubmit` method and override * `headerTimes`. * - * ### Props + * ### Attrs * * - `composer` * - `originalContent` diff --git a/js/src/forum/components/DiscussionList.js b/js/src/forum/components/DiscussionList.js index 61fa8d266..9ca3f5866 100644 --- a/js/src/forum/components/DiscussionList.js +++ b/js/src/forum/components/DiscussionList.js @@ -7,7 +7,7 @@ import Placeholder from '../../common/components/Placeholder'; /** * The `DiscussionList` component displays a list of discussions. * - * ### Props + * ### Attrs * * - `state` A DiscussionListState object that represents the discussion lists's state. */ diff --git a/js/src/forum/components/DiscussionListItem.js b/js/src/forum/components/DiscussionListItem.js index f9ccb1d60..4f2c1a78d 100644 --- a/js/src/forum/components/DiscussionListItem.js +++ b/js/src/forum/components/DiscussionListItem.js @@ -19,7 +19,7 @@ import { escapeRegExp } from 'lodash-es'; * The `DiscussionListItem` component shows a single discussion in the * discussion list. * - * ### Props + * ### Attrs * * - `discussion` * - `params` diff --git a/js/src/forum/components/DiscussionListPane.js b/js/src/forum/components/DiscussionListPane.js index 81cc0a90f..5659850a1 100644 --- a/js/src/forum/components/DiscussionListPane.js +++ b/js/src/forum/components/DiscussionListPane.js @@ -10,7 +10,7 @@ const hotEdge = (e) => { * discussions in a panel that can be displayed by moving the mouse to the left * edge of the screen, where it can also be pinned in place. * - * ### Props + * ### Attrs * * - `state` A DiscussionListState object that represents the discussion lists's state. */ diff --git a/js/src/forum/components/ForgotPasswordModal.js b/js/src/forum/components/ForgotPasswordModal.js index fb126fdb9..e9ec6b736 100644 --- a/js/src/forum/components/ForgotPasswordModal.js +++ b/js/src/forum/components/ForgotPasswordModal.js @@ -6,7 +6,7 @@ import extractText from '../../common/utils/extractText'; * The `ForgotPasswordModal` component displays a modal which allows the user to * enter their email address and request a link to reset their password. * - * ### Props + * ### Attrs * * - `email` */ diff --git a/js/src/forum/components/NotificationGrid.js b/js/src/forum/components/NotificationGrid.js index 8181b344b..650bb86f6 100644 --- a/js/src/forum/components/NotificationGrid.js +++ b/js/src/forum/components/NotificationGrid.js @@ -7,7 +7,7 @@ import ItemList from '../../common/utils/ItemList'; * The `NotificationGrid` component displays a table of notification types and * methods, allowing the user to toggle each combination. * - * ### Props + * ### Attrs * * - `user` */ diff --git a/js/src/forum/components/TerminalPost.js b/js/src/forum/components/TerminalPost.js index e7d7532dc..50baed6ed 100644 --- a/js/src/forum/components/TerminalPost.js +++ b/js/src/forum/components/TerminalPost.js @@ -5,7 +5,7 @@ import icon from '../../common/helpers/icon'; /** * Displays information about a the first or last post in a discussion. * - * ### Props + * ### Attrs * * - `discussion` * - `lastPost` diff --git a/js/src/forum/components/TextEditor.js b/js/src/forum/components/TextEditor.js index 7039e5f8b..10329295f 100644 --- a/js/src/forum/components/TextEditor.js +++ b/js/src/forum/components/TextEditor.js @@ -8,7 +8,7 @@ import Button from '../../common/components/Button'; * The `TextEditor` component displays a textarea with controls, including a * submit button. * - * ### Props + * ### Attrs * * - `composer` * - `submitLabel` diff --git a/js/src/forum/components/UserCard.js b/js/src/forum/components/UserCard.js index 9311d65b8..754135216 100644 --- a/js/src/forum/components/UserCard.js +++ b/js/src/forum/components/UserCard.js @@ -14,7 +14,7 @@ import listItems from '../../common/helpers/listItems'; * the `UserPage` (in the hero) and in discussions, shown when hovering over a * post author. * - * ### Props + * ### Attrs * * - `user` * - `className`