diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..a14ae90e --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +src/shared/translations \ No newline at end of file diff --git a/package.json b/package.json index 0e0426a4..573858bf 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build:prod": "webpack --mode=production", "clean": "yarn run rimraf dist", "dev": "yarn start", - "lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check 'src/**/*.tsx'", + "lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check \"src/**/*.{ts,tsx}\"", "prepare": "husky install", "start": "yarn build:dev --watch" }, diff --git a/src/shared/components/common/emoji-picker.tsx b/src/shared/components/common/emoji-picker.tsx index 11495833..aea986ad 100644 --- a/src/shared/components/common/emoji-picker.tsx +++ b/src/shared/components/common/emoji-picker.tsx @@ -5,6 +5,7 @@ import { Icon } from "./icon"; interface EmojiPickerProps { onEmojiClick?(val: any): any; + disabled?: boolean; } interface EmojiPickerState { @@ -15,8 +16,9 @@ export class EmojiPicker extends Component { private emptyState: EmojiPickerState = { showPicker: false, }; + state: EmojiPickerState; - constructor(props: any, context: any) { + constructor(props: EmojiPickerProps, context: any) { super(props, context); this.state = this.emptyState; this.handleEmojiClick = this.handleEmojiClick.bind(this); @@ -28,6 +30,7 @@ export class EmojiPicker extends Component { className="btn btn-sm text-muted" data-tippy-content={i18n.t("emoji")} aria-label={i18n.t("emoji")} + disabled={this.props.disabled} onClick={linkEvent(this, this.togglePicker)} > diff --git a/src/shared/components/common/language-select.tsx b/src/shared/components/common/language-select.tsx index 64cbac49..feada32a 100644 --- a/src/shared/components/common/language-select.tsx +++ b/src/shared/components/common/language-select.tsx @@ -10,11 +10,12 @@ interface LanguageSelectProps { allLanguages: Language[]; siteLanguages: number[]; selectedLanguageIds?: number[]; - multiple: boolean; + multiple?: boolean; onChange(val: number[]): any; showAll?: boolean; showSite?: boolean; iconVersion?: boolean; + disabled?: boolean; } export class LanguageSelect extends Component { @@ -55,19 +56,19 @@ export class LanguageSelect extends Component { )}
{this.selectBtn} {this.props.multiple && ( @@ -87,8 +88,8 @@ export class LanguageSelect extends Component { } get selectBtn() { - let selectedLangs = this.props.selectedLanguageIds; - let filteredLangs = selectableLanguages( + const selectedLangs = this.props.selectedLanguageIds; + const filteredLangs = selectableLanguages( this.props.allLanguages, this.props.siteLanguages, this.props.showAll, @@ -98,14 +99,17 @@ export class LanguageSelect extends Component { return (