From 5a244dcfd2032bcadaa9fe4133fde6f51711fd1e Mon Sep 17 00:00:00 2001 From: Matthew Kilgore Date: Tue, 4 Aug 2020 20:06:15 -0400 Subject: [PATCH] update: common/components/SelectDropdown --- js/src/common/components/SelectDropdown.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/js/src/common/components/SelectDropdown.js b/js/src/common/components/SelectDropdown.js index 9c60539b2..62766fc5b 100644 --- a/js/src/common/components/SelectDropdown.js +++ b/js/src/common/components/SelectDropdown.js @@ -6,26 +6,26 @@ import icon from '../helpers/icon'; * button's label is set as the label of the first child which has a truthy * `active` prop. * - * ### Props + * ### Attrs * * - `caretIcon` * - `defaultLabel` */ export default class SelectDropdown extends Dropdown { - static initProps(props) { - props.caretIcon = typeof props.caretIcon !== 'undefined' ? props.caretIcon : 'fas fa-sort'; + initAttrs(attrs) { + attrs.caretIcon = typeof attrs.caretIcon !== 'undefined' ? attrs.caretIcon : 'fas fa-sort'; - super.initProps(props); + super.initAttrs(attrs); - props.className += ' Dropdown--select'; + attrs.className += ' Dropdown--select'; } - getButtonContent() { - const activeChild = this.props.children.filter((child) => child.props.active)[0]; - let label = (activeChild && activeChild.props.children) || this.props.defaultLabel; + getButtonContent(attrs, children) { + const activeChild = children.filter((child) => child.attrs.active)[0]; + let label = (activeChild && activeChild.children) || attrs.defaultLabel; if (label instanceof Array) label = label[0]; - return [{label}, icon(this.props.caretIcon, { className: 'Button-caret' })]; + return [{label}, icon(attrs.caretIcon, { className: 'Button-caret' })]; } }