diff --git a/app/soapbox/base_polyfills.ts b/app/soapbox/base_polyfills.ts index 53146d222..a6e92bb3c 100644 --- a/app/soapbox/base_polyfills.ts +++ b/app/soapbox/base_polyfills.ts @@ -37,7 +37,7 @@ if (!HTMLCanvasElement.prototype.toBlob) { const dataURL = this.toDataURL(type, quality); let data; - if (dataURL.indexOf(BASE64_MARKER) >= 0) { + if (dataURL.includes(BASE64_MARKER)) { const [, base64] = dataURL.split(BASE64_MARKER); data = decodeBase64(base64); } else { diff --git a/app/soapbox/components/autosuggest_input.tsx b/app/soapbox/components/autosuggest_input.tsx index e6a4af6d6..54f126a23 100644 --- a/app/soapbox/components/autosuggest_input.tsx +++ b/app/soapbox/components/autosuggest_input.tsx @@ -30,7 +30,7 @@ const textAtCursorMatchesToken = (str: string, caretPosition: number, searchToke word = str.slice(left, right + caretPosition); } - if (!word || word.trim().length < 3 || searchTokens.indexOf(word[0]) === -1) { + if (!word || word.trim().length < 3 || !searchTokens.includes(word[0])) { return [null, null]; } diff --git a/app/soapbox/components/autosuggest_textarea.tsx b/app/soapbox/components/autosuggest_textarea.tsx index b5d54b670..a475e5ce2 100644 --- a/app/soapbox/components/autosuggest_textarea.tsx +++ b/app/soapbox/components/autosuggest_textarea.tsx @@ -23,7 +23,7 @@ const textAtCursorMatchesToken = (str: string, caretPosition: number) => { word = str.slice(left, right + caretPosition); } - if (!word || word.trim().length < 3 || ['@', ':', '#'].indexOf(word[0]) === -1) { + if (!word || word.trim().length < 3 || !['@', ':', '#'].includes(word[0])) { return [null, null]; } diff --git a/app/soapbox/components/ui/icon-button/icon-button.tsx b/app/soapbox/components/ui/icon-button/icon-button.tsx index 352c7a92c..6b4f5414a 100644 --- a/app/soapbox/components/ui/icon-button/icon-button.tsx +++ b/app/soapbox/components/ui/icon-button/icon-button.tsx @@ -12,12 +12,14 @@ interface IIconButton extends React.ButtonHTMLAttributes { /** Text to display next ot the button. */ text?: string, /** Don't render a background behind the icon. */ - transparent?: boolean + transparent?: boolean, + /** Predefined styles to display for the button. */ + theme?: 'seamless' | 'outlined', } /** A clickable icon. */ const IconButton = React.forwardRef((props: IIconButton, ref: React.ForwardedRef): JSX.Element => { - const { src, className, iconClassName, text, transparent = false, ...filteredProps } = props; + const { src, className, iconClassName, text, transparent = false, theme = 'seamless', ...filteredProps } = props; return (