diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-07-23 20:08:52 -0600 |
---|---|---|
committer | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2023-07-25 07:45:23 +0000 |
commit | 8c131073730ec684145c2cc8ee8d6b39bbe9278d (patch) | |
tree | 1129d432ae88475909f0e5d38960395b75364902 /src/components | |
parent | 6.4.1-nightly.11 [skip ci] (diff) | |
download | ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.tar.gz ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.tar.zst ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.zip |
chore: improve lint setup
- update eslint config
- merged eslint rules for JS and TS to avoid duplicates
- extended stricter lint ruleset from typescript-eslint
- corrected wrong setup for certain eslint rulesets
- opt in to reportUnusedDisableDirectives config option
- fix or disable a lot of lint issues throughout codebase
- remove trailingComma: all from prettier config which is default in prettier v3
- add volta configuration to package.json to autoload correct node and pnpm versions
- upgrade all eslint and prettier related dependencies to latest
- remove config options from settings.json which are default anyways
- remove config options from settings.json which are outdated/unknown
- set up prettier as default formatter in settings.json
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/AppUpdateInfoBar.tsx | 1 | ||||
-rw-r--r-- | src/components/auth/Login.tsx | 1 | ||||
-rw-r--r-- | src/components/auth/Welcome.tsx | 4 | ||||
-rw-r--r-- | src/components/layout/Sidebar.tsx | 248 | ||||
-rw-r--r-- | src/components/services/tabs/TabBarSortableList.tsx | 2 | ||||
-rw-r--r-- | src/components/services/tabs/TabItem.tsx | 8 | ||||
-rw-r--r-- | src/components/services/tabs/Tabbar.tsx | 2 | ||||
-rw-r--r-- | src/components/settings/navigation/SettingsNavigation.tsx | 6 | ||||
-rw-r--r-- | src/components/settings/supportFerdium/SupportFerdiumDashboard.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/AppLoader/index.tsx | 23 | ||||
-rw-r--r-- | src/components/ui/Link.tsx | 4 | ||||
-rw-r--r-- | src/components/ui/Select.tsx | 4 | ||||
-rw-r--r-- | src/components/ui/Tabs/Tabs.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/WebviewLoader/index.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/colorPickerInput/index.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/headline/index.tsx | 11 | ||||
-rw-r--r-- | src/components/ui/select/index.tsx | 6 |
17 files changed, 153 insertions, 175 deletions
diff --git a/src/components/AppUpdateInfoBar.tsx b/src/components/AppUpdateInfoBar.tsx index b27578d10..b8e1bb61e 100644 --- a/src/components/AppUpdateInfoBar.tsx +++ b/src/components/AppUpdateInfoBar.tsx | |||
@@ -38,6 +38,7 @@ const AppUpdateInfoBar = (props: IProps) => { | |||
38 | type="primary" | 38 | type="primary" |
39 | ctaLabel={intl.formatMessage(messages.buttonInstallUpdate)} | 39 | ctaLabel={intl.formatMessage(messages.buttonInstallUpdate)} |
40 | onClick={event => { | 40 | onClick={event => { |
41 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions | ||
41 | !isWinPortable && onInstallUpdate(event); | 42 | !isWinPortable && onInstallUpdate(event); |
42 | }} | 43 | }} |
43 | onHide={onHide} | 44 | onHide={onHide} |
diff --git a/src/components/auth/Login.tsx b/src/components/auth/Login.tsx index 0a95b0565..eaa04256c 100644 --- a/src/components/auth/Login.tsx +++ b/src/components/auth/Login.tsx | |||
@@ -68,7 +68,6 @@ interface IProps extends WrappedComponentProps { | |||
68 | isTokenExpired: boolean; | 68 | isTokenExpired: boolean; |
69 | isServerLogout: boolean; | 69 | isServerLogout: boolean; |
70 | signupRoute: string; | 70 | signupRoute: string; |
71 | // eslint-disable-next-line react/no-unused-prop-types | ||
72 | passwordRoute: string; // TODO: Uncomment this line after fixing password recovery in-app | 71 | passwordRoute: string; // TODO: Uncomment this line after fixing password recovery in-app |
73 | error: GlobalError; | 72 | error: GlobalError; |
74 | } | 73 | } |
diff --git a/src/components/auth/Welcome.tsx b/src/components/auth/Welcome.tsx index 1aa8da4d6..047512ea4 100644 --- a/src/components/auth/Welcome.tsx +++ b/src/components/auth/Welcome.tsx | |||
@@ -44,10 +44,6 @@ interface IProps extends Partial<StoresProps>, WrappedComponentProps { | |||
44 | @inject('actions') | 44 | @inject('actions') |
45 | @observer | 45 | @observer |
46 | class Welcome extends Component<IProps> { | 46 | class Welcome extends Component<IProps> { |
47 | constructor(props: IProps) { | ||
48 | super(props); | ||
49 | } | ||
50 | |||
51 | useLocalServer(): void { | 47 | useLocalServer(): void { |
52 | serverlessLogin(this.props.actions); | 48 | serverlessLogin(this.props.actions); |
53 | } | 49 | } |
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 2b1e87023..ceb9cfff9 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx | |||
@@ -205,133 +205,131 @@ class Sidebar extends Component<IProps, IState> { | |||
205 | hibernateService={this.props.hibernateService} | 205 | hibernateService={this.props.hibernateService} |
206 | wakeUpService={this.props.wakeUpService} | 206 | wakeUpService={this.props.wakeUpService} |
207 | /> | 207 | /> |
208 | <> | 208 | {numberActiveButtons <= 1 || hideCollapseButton ? null : ( |
209 | {numberActiveButtons <= 1 || hideCollapseButton ? null : ( | 209 | <button |
210 | <button | 210 | type="button" |
211 | type="button" | 211 | onClick={() => toggleCollapseMenu()} |
212 | onClick={() => toggleCollapseMenu()} | 212 | className="sidebar__button sidebar__button--hamburger-menu" |
213 | className="sidebar__button sidebar__button--hamburger-menu" | 213 | > |
214 | > | 214 | {isMenuCollapsed ? <Icon icon={mdiMenu} size={1.5} /> : null} |
215 | {isMenuCollapsed ? <Icon icon={mdiMenu} size={1.5} /> : null} | ||
216 | 215 | ||
217 | {!isMenuCollapsed && !useHorizontalStyle ? ( | 216 | {!isMenuCollapsed && !useHorizontalStyle ? ( |
218 | <Icon icon={mdiChevronDown} size={1.5} /> | 217 | <Icon icon={mdiChevronDown} size={1.5} /> |
219 | ) : null} | 218 | ) : null} |
220 | 219 | ||
221 | {!isMenuCollapsed && useHorizontalStyle ? ( | 220 | {!isMenuCollapsed && useHorizontalStyle ? ( |
222 | <Icon icon={mdiChevronRight} size={1.5} /> | 221 | <Icon icon={mdiChevronRight} size={1.5} /> |
223 | ) : null} | 222 | ) : null} |
224 | </button> | 223 | </button> |
225 | )} | 224 | )} |
226 | {!hideRecipesButton && !isMenuCollapsed ? ( | 225 | {!hideRecipesButton && !isMenuCollapsed ? ( |
227 | <button | 226 | <button |
228 | type="button" | 227 | type="button" |
229 | onClick={() => openSettings({ path: 'recipes' })} | 228 | onClick={() => openSettings({ path: 'recipes' })} |
230 | className="sidebar__button sidebar__button--new-service" | 229 | className="sidebar__button sidebar__button--new-service" |
231 | data-tooltip-id="tooltip-sidebar-button" | 230 | data-tooltip-id="tooltip-sidebar-button" |
232 | data-tooltip-content={`${intl.formatMessage( | 231 | data-tooltip-content={`${intl.formatMessage( |
233 | messages.addNewService, | 232 | messages.addNewService, |
234 | )} (${addNewServiceShortcutKey(false)})`} | 233 | )} (${addNewServiceShortcutKey(false)})`} |
235 | > | 234 | > |
236 | <Icon icon={mdiPlusBox} size={1.5} /> | 235 | <Icon icon={mdiPlusBox} size={1.5} /> |
237 | </button> | 236 | </button> |
238 | ) : null} | 237 | ) : null} |
239 | {!hideSplitModeButton && !isMenuCollapsed ? ( | 238 | {!hideSplitModeButton && !isMenuCollapsed ? ( |
240 | <button | 239 | <button |
241 | type="button" | 240 | type="button" |
242 | onClick={() => { | 241 | onClick={() => { |
243 | actions!.settings.update({ | 242 | actions!.settings.update({ |
244 | type: 'app', | 243 | type: 'app', |
245 | data: { | 244 | data: { |
246 | splitMode: !splitMode, | 245 | splitMode: !splitMode, |
247 | }, | 246 | }, |
248 | }); | 247 | }); |
249 | }} | 248 | }} |
250 | className="sidebar__button sidebar__button--split-mode-toggle" | 249 | className="sidebar__button sidebar__button--split-mode-toggle" |
251 | data-tooltip-id="tooltip-sidebar-button" | 250 | data-tooltip-id="tooltip-sidebar-button" |
252 | data-tooltip-content={`${intl.formatMessage( | 251 | data-tooltip-content={`${intl.formatMessage( |
253 | messages.splitModeToggle, | 252 | messages.splitModeToggle, |
254 | )} (${splitModeToggleShortcutKey(false)})`} | 253 | )} (${splitModeToggleShortcutKey(false)})`} |
255 | > | 254 | > |
256 | <Icon icon={mdiViewSplitVertical} size={1.5} /> | 255 | <Icon icon={mdiViewSplitVertical} size={1.5} /> |
257 | </button> | 256 | </button> |
258 | ) : null} | 257 | ) : null} |
259 | {!hideWorkspacesButton && !isMenuCollapsed ? ( | 258 | {!hideWorkspacesButton && !isMenuCollapsed ? ( |
260 | <button | 259 | <button |
261 | type="button" | 260 | type="button" |
262 | onClick={() => { | 261 | onClick={() => { |
263 | toggleWorkspaceDrawer(); | 262 | toggleWorkspaceDrawer(); |
264 | this.updateToolTip(); | 263 | this.updateToolTip(); |
265 | }} | 264 | }} |
266 | className={`sidebar__button sidebar__button--workspaces ${ | 265 | className={`sidebar__button sidebar__button--workspaces ${ |
267 | isWorkspaceDrawerOpen ? 'is-active' : '' | 266 | isWorkspaceDrawerOpen ? 'is-active' : '' |
268 | }`} | 267 | }`} |
269 | data-tooltip-id="tooltip-sidebar-button" | 268 | data-tooltip-id="tooltip-sidebar-button" |
270 | data-tooltip-content={`${intl.formatMessage( | 269 | data-tooltip-content={`${intl.formatMessage( |
271 | workspaceToggleMessage, | 270 | workspaceToggleMessage, |
272 | )} (${workspaceToggleShortcutKey(false)})`} | 271 | )} (${workspaceToggleShortcutKey(false)})`} |
273 | > | 272 | > |
274 | <Icon icon={mdiViewGrid} size={1.5} /> | 273 | <Icon icon={mdiViewGrid} size={1.5} /> |
275 | </button> | 274 | </button> |
276 | ) : null} | 275 | ) : null} |
277 | {!hideNotificationsButton && !isMenuCollapsed ? ( | 276 | {!hideNotificationsButton && !isMenuCollapsed ? ( |
278 | <button | 277 | <button |
279 | type="button" | 278 | type="button" |
280 | onClick={() => { | 279 | onClick={() => { |
281 | toggleMuteApp(); | 280 | toggleMuteApp(); |
282 | this.updateToolTip(); | 281 | this.updateToolTip(); |
283 | }} | 282 | }} |
284 | className={`sidebar__button sidebar__button--audio ${ | 283 | className={`sidebar__button sidebar__button--audio ${ |
285 | isAppMuted ? 'is-muted' : '' | 284 | isAppMuted ? 'is-muted' : '' |
286 | }`} | 285 | }`} |
287 | data-tooltip-id="tooltip-sidebar-button" | 286 | data-tooltip-id="tooltip-sidebar-button" |
288 | data-tooltip-content={`${intl.formatMessage( | 287 | data-tooltip-content={`${intl.formatMessage( |
289 | isAppMuted ? messages.unmute : messages.mute, | 288 | isAppMuted ? messages.unmute : messages.mute, |
290 | )} (${muteFerdiumShortcutKey(false)})`} | 289 | )} (${muteFerdiumShortcutKey(false)})`} |
291 | > | 290 | > |
292 | <Icon icon={isAppMuted ? mdiBellOff : mdiBell} size={1.5} /> | 291 | <Icon icon={isAppMuted ? mdiBellOff : mdiBell} size={1.5} /> |
293 | </button> | 292 | </button> |
294 | ) : null} | 293 | ) : null} |
295 | {todosStore.isFeatureEnabledByUser && !isMenuCollapsed ? ( | 294 | {todosStore.isFeatureEnabledByUser && !isMenuCollapsed ? ( |
296 | <button | 295 | <button |
297 | type="button" | 296 | type="button" |
298 | onClick={() => { | 297 | onClick={() => { |
299 | todoActions.toggleTodosPanel(); | 298 | todoActions.toggleTodosPanel(); |
300 | this.updateToolTip(); | 299 | this.updateToolTip(); |
301 | }} | 300 | }} |
302 | disabled={isTodosServiceActive} | 301 | disabled={isTodosServiceActive} |
303 | className={`sidebar__button sidebar__button--todos ${ | 302 | className={`sidebar__button sidebar__button--todos ${ |
304 | todosStore.isTodosPanelVisible ? 'is-active' : '' | 303 | todosStore.isTodosPanelVisible ? 'is-active' : '' |
305 | }`} | 304 | }`} |
306 | data-tooltip-id="tooltip-sidebar-button" | 305 | data-tooltip-id="tooltip-sidebar-button" |
307 | data-tooltip-content={`${intl.formatMessage( | 306 | data-tooltip-content={`${intl.formatMessage( |
308 | todosToggleMessage, | 307 | todosToggleMessage, |
309 | )} (${todosToggleShortcutKey(false)})`} | 308 | )} (${todosToggleShortcutKey(false)})`} |
310 | > | 309 | > |
311 | <Icon icon={mdiCheckAll} size={1.5} /> | 310 | <Icon icon={mdiCheckAll} size={1.5} /> |
312 | </button> | 311 | </button> |
313 | ) : null} | 312 | ) : null} |
314 | {stores!.settings.all.app.lockingFeatureEnabled ? ( | 313 | {stores!.settings.all.app.lockingFeatureEnabled ? ( |
315 | <button | 314 | <button |
316 | type="button" | 315 | type="button" |
317 | className="sidebar__button" | 316 | className="sidebar__button" |
318 | onClick={() => { | 317 | onClick={() => { |
319 | actions!.settings.update({ | 318 | actions!.settings.update({ |
320 | type: 'app', | 319 | type: 'app', |
321 | data: { | 320 | data: { |
322 | locked: true, | 321 | locked: true, |
323 | }, | 322 | }, |
324 | }); | 323 | }); |
325 | }} | 324 | }} |
326 | data-tooltip-id="tooltip-sidebar-button" | 325 | data-tooltip-id="tooltip-sidebar-button" |
327 | data-tooltip-content={`${intl.formatMessage( | 326 | data-tooltip-content={`${intl.formatMessage( |
328 | messages.lockFerdium, | 327 | messages.lockFerdium, |
329 | )} (${lockFerdiumShortcutKey(false)})`} | 328 | )} (${lockFerdiumShortcutKey(false)})`} |
330 | > | 329 | > |
331 | <Icon icon={mdiLock} size={1.5} /> | 330 | <Icon icon={mdiLock} size={1.5} /> |
332 | </button> | 331 | </button> |
333 | ) : null} | 332 | ) : null} |
334 | </> | ||
335 | {this.state.tooltipEnabled && ( | 333 | {this.state.tooltipEnabled && ( |
336 | <ReactTooltip | 334 | <ReactTooltip |
337 | id="tooltip-sidebar-button" | 335 | id="tooltip-sidebar-button" |
diff --git a/src/components/services/tabs/TabBarSortableList.tsx b/src/components/services/tabs/TabBarSortableList.tsx index 5f711c30d..a30587470 100644 --- a/src/components/services/tabs/TabBarSortableList.tsx +++ b/src/components/services/tabs/TabBarSortableList.tsx | |||
@@ -51,7 +51,7 @@ class TabBarSortableList extends Component<IProps> { | |||
51 | {services.map((service, index) => ( | 51 | {services.map((service, index) => ( |
52 | <TabItem | 52 | <TabItem |
53 | key={service.id} | 53 | key={service.id} |
54 | // @ts-ignore | 54 | // @ts-expect-error Fix me |
55 | clickHandler={() => setActive({ serviceId: service.id })} | 55 | clickHandler={() => setActive({ serviceId: service.id })} |
56 | service={service} | 56 | service={service} |
57 | index={index} | 57 | index={index} |
diff --git a/src/components/services/tabs/TabItem.tsx b/src/components/services/tabs/TabItem.tsx index c25af4427..287dedfcb 100644 --- a/src/components/services/tabs/TabItem.tsx +++ b/src/components/services/tabs/TabItem.tsx | |||
@@ -234,7 +234,7 @@ class TabItem extends Component<IProps, IState> { | |||
234 | } = this.props; | 234 | } = this.props; |
235 | const { intl } = this.props; | 235 | const { intl } = this.props; |
236 | 236 | ||
237 | const menuTemplate: Array<MenuItemConstructorOptions> = [ | 237 | const menuTemplate: MenuItemConstructorOptions[] = [ |
238 | { | 238 | { |
239 | label: service.name || service.recipe.name, | 239 | label: service.name || service.recipe.name, |
240 | enabled: false, | 240 | enabled: false, |
@@ -295,7 +295,7 @@ class TabItem extends Component<IProps, IState> { | |||
295 | ? messages.wakeUpService | 295 | ? messages.wakeUpService |
296 | : messages.hibernateService, | 296 | : messages.hibernateService, |
297 | ), | 297 | ), |
298 | // eslint-disable-next-line no-confusing-arrow | 298 | |
299 | click: () => | 299 | click: () => |
300 | service.isHibernating ? wakeUpService() : hibernateService(), | 300 | service.isHibernating ? wakeUpService() : hibernateService(), |
301 | enabled: service.isEnabled && service.canHibernate, | 301 | enabled: service.isEnabled && service.canHibernate, |
@@ -311,7 +311,7 @@ class TabItem extends Component<IProps, IState> { | |||
311 | { | 311 | { |
312 | label: intl.formatMessage(messages.deleteService), | 312 | label: intl.formatMessage(messages.deleteService), |
313 | click: () => { | 313 | click: () => { |
314 | // @ts-ignore | 314 | // @ts-expect-error Fix me |
315 | const selection = dialog.showMessageBoxSync(app.mainWindow, { | 315 | const selection = dialog.showMessageBoxSync(app.mainWindow, { |
316 | type: 'question', | 316 | type: 'question', |
317 | message: intl.formatMessage(messages.deleteService), | 317 | message: intl.formatMessage(messages.deleteService), |
@@ -417,6 +417,6 @@ class TabItem extends Component<IProps, IState> { | |||
417 | } | 417 | } |
418 | 418 | ||
419 | export default injectIntl( | 419 | export default injectIntl( |
420 | // @ts-ignore | 420 | // @ts-expect-error Fix me |
421 | SortableElement(injectSheet(styles, { injectTheme: true })(TabItem)), | 421 | SortableElement(injectSheet(styles, { injectTheme: true })(TabItem)), |
422 | ); | 422 | ); |
diff --git a/src/components/services/tabs/Tabbar.tsx b/src/components/services/tabs/Tabbar.tsx index f09877b2f..d19a4b8de 100644 --- a/src/components/services/tabs/Tabbar.tsx +++ b/src/components/services/tabs/Tabbar.tsx | |||
@@ -99,7 +99,7 @@ class TabBar extends Component<IProps> { | |||
99 | return ( | 99 | return ( |
100 | <div> | 100 | <div> |
101 | <TabBarSortableList | 101 | <TabBarSortableList |
102 | // @ts-ignore | 102 | // @ts-expect-error Fix me |
103 | services={services} | 103 | services={services} |
104 | setActive={setActive} | 104 | setActive={setActive} |
105 | onSortEnd={this.onSortEnd} | 105 | onSortEnd={this.onSortEnd} |
diff --git a/src/components/settings/navigation/SettingsNavigation.tsx b/src/components/settings/navigation/SettingsNavigation.tsx index 6ffaa411f..66763c6a6 100644 --- a/src/components/settings/navigation/SettingsNavigation.tsx +++ b/src/components/settings/navigation/SettingsNavigation.tsx | |||
@@ -53,10 +53,6 @@ interface IProps extends Partial<StoresProps>, WrappedComponentProps { | |||
53 | @inject('stores', 'actions') | 53 | @inject('stores', 'actions') |
54 | @observer | 54 | @observer |
55 | class SettingsNavigation extends Component<IProps> { | 55 | class SettingsNavigation extends Component<IProps> { |
56 | constructor(props: IProps) { | ||
57 | super(props); | ||
58 | } | ||
59 | |||
60 | handleLogout(): void { | 56 | handleLogout(): void { |
61 | const isUsingWithoutAccount = | 57 | const isUsingWithoutAccount = |
62 | this.props.stores!.settings.app.server === LOCAL_SERVER; | 58 | this.props.stores!.settings.app.server === LOCAL_SERVER; |
@@ -186,7 +182,7 @@ class SettingsNavigation extends Component<IProps> { | |||
186 | <span className="settings-navigation__expander" /> | 182 | <span className="settings-navigation__expander" /> |
187 | <button | 183 | <button |
188 | type="button" | 184 | type="button" |
189 | // @ts-ignore | 185 | // @ts-expect-error Fix me |
190 | to="/auth/logout" // TODO: [TS DEBT] Need to check if button take this prop | 186 | to="/auth/logout" // TODO: [TS DEBT] Need to check if button take this prop |
191 | className="settings-navigation__link" | 187 | className="settings-navigation__link" |
192 | onClick={this.handleLogout.bind(this)} | 188 | onClick={this.handleLogout.bind(this)} |
diff --git a/src/components/settings/supportFerdium/SupportFerdiumDashboard.tsx b/src/components/settings/supportFerdium/SupportFerdiumDashboard.tsx index f3b7c718c..065690fb5 100644 --- a/src/components/settings/supportFerdium/SupportFerdiumDashboard.tsx +++ b/src/components/settings/supportFerdium/SupportFerdiumDashboard.tsx | |||
@@ -50,7 +50,7 @@ const SupportFerdiumDashboard = () => { | |||
50 | src="https://img.shields.io/github/stars/ferdium/ferdium-app?style=social" | 50 | src="https://img.shields.io/github/stars/ferdium/ferdium-app?style=social" |
51 | /> | 51 | /> |
52 | </a> | 52 | </a> |
53 | <a target="_blank" href={FERDIUM_TRANSLATION}> | 53 | <a target="_blank" href={FERDIUM_TRANSLATION} rel="noreferrer"> |
54 | <img | 54 | <img |
55 | src="https://badges.crowdin.net/ferdium-app/localized.svg" | 55 | src="https://badges.crowdin.net/ferdium-app/localized.svg" |
56 | alt="Crowdin" | 56 | alt="Crowdin" |
diff --git a/src/components/ui/AppLoader/index.tsx b/src/components/ui/AppLoader/index.tsx index f4d9b8e73..64c840aaa 100644 --- a/src/components/ui/AppLoader/index.tsx +++ b/src/components/ui/AppLoader/index.tsx | |||
@@ -61,18 +61,17 @@ class AppLoader extends Component<IProps, IState> { | |||
61 | className={classes.component} | 61 | className={classes.component} |
62 | spinnerColor={theme.colorAppLoaderSpinner} | 62 | spinnerColor={theme.colorAppLoaderSpinner} |
63 | > | 63 | > |
64 | {texts && | 64 | {texts?.map((text, i) => ( |
65 | texts.map((text, i) => ( | 65 | <span |
66 | <span | 66 | key={text} |
67 | key={text} | 67 | className={classnames({ |
68 | className={classnames({ | 68 | [`${classes.slogan}`]: true, |
69 | [`${classes.slogan}`]: true, | 69 | [`${classes.visible}`]: step === i, |
70 | [`${classes.visible}`]: step === i, | 70 | })} |
71 | })} | 71 | > |
72 | > | 72 | {text} |
73 | {text} | 73 | </span> |
74 | </span> | 74 | ))} |
75 | ))} | ||
76 | </FullscreenLoader> | 75 | </FullscreenLoader> |
77 | ); | 76 | ); |
78 | } | 77 | } |
diff --git a/src/components/ui/Link.tsx b/src/components/ui/Link.tsx index b5890ebd1..a9a429d3a 100644 --- a/src/components/ui/Link.tsx +++ b/src/components/ui/Link.tsx | |||
@@ -20,10 +20,6 @@ interface IProps extends Partial<StoresProps> { | |||
20 | @inject('stores') | 20 | @inject('stores') |
21 | @observer | 21 | @observer |
22 | class Link extends Component<IProps> { | 22 | class Link extends Component<IProps> { |
23 | constructor(props: IProps) { | ||
24 | super(props); | ||
25 | } | ||
26 | |||
27 | onClick(e: MouseEvent<HTMLAnchorElement>): void { | 23 | onClick(e: MouseEvent<HTMLAnchorElement>): void { |
28 | const { disabled = false, target = '', to } = this.props; | 24 | const { disabled = false, target = '', to } = this.props; |
29 | if (disabled) { | 25 | if (disabled) { |
diff --git a/src/components/ui/Select.tsx b/src/components/ui/Select.tsx index 8ae2945ce..a2ed4216f 100644 --- a/src/components/ui/Select.tsx +++ b/src/components/ui/Select.tsx | |||
@@ -24,10 +24,6 @@ class Select extends Component<IProps> { | |||
24 | private element: RefObject<HTMLSelectElement> = | 24 | private element: RefObject<HTMLSelectElement> = |
25 | createRef<HTMLSelectElement>(); | 25 | createRef<HTMLSelectElement>(); |
26 | 26 | ||
27 | constructor(props: IProps) { | ||
28 | super(props); | ||
29 | } | ||
30 | |||
31 | multipleChange(e: ChangeEvent<HTMLSelectElement>): void { | 27 | multipleChange(e: ChangeEvent<HTMLSelectElement>): void { |
32 | e.preventDefault(); | 28 | e.preventDefault(); |
33 | if (!this.element.current) { | 29 | if (!this.element.current) { |
diff --git a/src/components/ui/Tabs/Tabs.tsx b/src/components/ui/Tabs/Tabs.tsx index 2c34d7e24..d7f75c8b8 100644 --- a/src/components/ui/Tabs/Tabs.tsx +++ b/src/components/ui/Tabs/Tabs.tsx | |||
@@ -41,6 +41,7 @@ class Tab extends Component<IProps, IState> { | |||
41 | <div className="content-tabs__tabs"> | 41 | <div className="content-tabs__tabs"> |
42 | {Children.map(children, (child, i) => ( | 42 | {Children.map(children, (child, i) => ( |
43 | <button | 43 | <button |
44 | // eslint-disable-next-line react/no-array-index-key | ||
44 | key={i} | 45 | key={i} |
45 | className={classnames({ | 46 | className={classnames({ |
46 | 'content-tabs__item': true, | 47 | 'content-tabs__item': true, |
@@ -56,6 +57,7 @@ class Tab extends Component<IProps, IState> { | |||
56 | <div className="content-tabs__content"> | 57 | <div className="content-tabs__content"> |
57 | {Children.map(children, (child, i) => ( | 58 | {Children.map(children, (child, i) => ( |
58 | <div | 59 | <div |
60 | // eslint-disable-next-line react/no-array-index-key | ||
59 | key={i} | 61 | key={i} |
60 | className={classnames({ | 62 | className={classnames({ |
61 | 'content-tabs__item': true, | 63 | 'content-tabs__item': true, |
diff --git a/src/components/ui/WebviewLoader/index.tsx b/src/components/ui/WebviewLoader/index.tsx index 81923b6ca..c4e9c724c 100644 --- a/src/components/ui/WebviewLoader/index.tsx +++ b/src/components/ui/WebviewLoader/index.tsx | |||
@@ -32,7 +32,7 @@ class WebviewLoader extends Component<IProps> { | |||
32 | return ( | 32 | return ( |
33 | <FullscreenLoader | 33 | <FullscreenLoader |
34 | className={classes.component} | 34 | className={classes.component} |
35 | title={`${intl.formatMessage(messages.loading, { service: name })}`} | 35 | title={intl.formatMessage(messages.loading, { service: name })} |
36 | loaded={loaded} | 36 | loaded={loaded} |
37 | /> | 37 | /> |
38 | ); | 38 | ); |
diff --git a/src/components/ui/colorPickerInput/index.tsx b/src/components/ui/colorPickerInput/index.tsx index 9bab6efec..2367175bd 100644 --- a/src/components/ui/colorPickerInput/index.tsx +++ b/src/components/ui/colorPickerInput/index.tsx | |||
@@ -25,7 +25,7 @@ class ColorPickerInput extends Component<IProps> { | |||
25 | 25 | ||
26 | componentDidMount(): void { | 26 | componentDidMount(): void { |
27 | const { focus = false } = this.props; | 27 | const { focus = false } = this.props; |
28 | if (focus && this.inputElement && this.inputElement.current) { | 28 | if (focus && this.inputElement?.current) { |
29 | this.inputElement.current.focus(); | 29 | this.inputElement.current.focus(); |
30 | } | 30 | } |
31 | } | 31 | } |
diff --git a/src/components/ui/headline/index.tsx b/src/components/ui/headline/index.tsx index bebd8adcf..424190a6a 100644 --- a/src/components/ui/headline/index.tsx +++ b/src/components/ui/headline/index.tsx | |||
@@ -67,12 +67,11 @@ class HeadlineComponent extends Component<IProps> { | |||
67 | } | 67 | } |
68 | 68 | ||
69 | const Headline = injectStyle(styles, { injectTheme: true })(HeadlineComponent); | 69 | const Headline = injectStyle(styles, { injectTheme: true })(HeadlineComponent); |
70 | const createH = (level: number) => (props: Omit<IProps, 'classes'>) => | 70 | const createH = (level: number) => (props: Omit<IProps, 'classes'>) => ( |
71 | ( | 71 | <Headline level={level} {...props}> |
72 | <Headline level={level} {...props}> | 72 | {props.children} |
73 | {props.children} | 73 | </Headline> |
74 | </Headline> | 74 | ); |
75 | ); | ||
76 | 75 | ||
77 | export const H1 = createH(1); | 76 | export const H1 = createH(1); |
78 | export const H2 = createH(2); | 77 | export const H2 = createH(2); |
diff --git a/src/components/ui/select/index.tsx b/src/components/ui/select/index.tsx index 017de5423..902eb7748 100644 --- a/src/components/ui/select/index.tsx +++ b/src/components/ui/select/index.tsx | |||
@@ -301,11 +301,7 @@ class SelectComponent extends Component<IProps, IState> { | |||
301 | this.select(Object.keys(options!)[selected]); | 301 | this.select(Object.keys(options!)[selected]); |
302 | } | 302 | } |
303 | 303 | ||
304 | if ( | 304 | if (this.activeOptionRef?.current && this.scrollContainerRef?.current) { |
305 | this.activeOptionRef?.current && | ||
306 | this.scrollContainerRef && | ||
307 | this.scrollContainerRef.current | ||
308 | ) { | ||
309 | const containerTopOffset = this.scrollContainerRef.current.offsetTop; | 305 | const containerTopOffset = this.scrollContainerRef.current.offsetTop; |
310 | const optionTopOffset = this.activeOptionRef.current.offsetTop; | 306 | const optionTopOffset = this.activeOptionRef.current.offsetTop; |
311 | 307 | ||