Add prettier for codestyle and re-format everything (#1294)

This commit is contained in:
Erik Michelson 2021-06-06 23:14:00 +02:00 committed by GitHub
parent 8b78154075
commit 0aae1f70d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
319 changed files with 4809 additions and 3936 deletions

View file

@ -17,7 +17,13 @@ import { IconName } from '../../components/common/fork-awesome/types'
export const DEFAULT_DURATION_IN_SECONDS = 10
export const dispatchUiNotification = (title: string, content: string, durationInSecond = DEFAULT_DURATION_IN_SECONDS, icon?: IconName, buttons?: UiNotificationButton[]): void => {
export const dispatchUiNotification = (
title: string,
content: string,
durationInSecond = DEFAULT_DURATION_IN_SECONDS,
icon?: IconName,
buttons?: UiNotificationButton[]
): void => {
store.dispatch({
type: UiNotificationActionType.DISPATCH_NOTIFICATION,
notification: {
@ -39,7 +45,9 @@ export const dismissUiNotification = (notificationId: number): void => {
} as DismissUiNotificationAction)
}
export const showErrorNotification = (message: string) => (error: Error): void => {
console.error(message, error)
dispatchUiNotification(i18n.t('common.errorOccurred'), message, DEFAULT_DURATION_IN_SECONDS, 'exclamation-triangle')
}
export const showErrorNotification =
(message: string) =>
(error: Error): void => {
console.error(message, error)
dispatchUiNotification(i18n.t('common.errorOccurred'), message, DEFAULT_DURATION_IN_SECONDS, 'exclamation-triangle')
}

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Reducer } from 'redux'
import {
DismissUiNotificationAction,
@ -14,7 +13,10 @@ import {
UiNotificationState
} from './types'
export const UiNotificationReducer: Reducer<UiNotificationState, UiNotificationAction> = (state: UiNotificationState = [], action: UiNotificationAction) => {
export const UiNotificationReducer: Reducer<UiNotificationState, UiNotificationAction> = (
state: UiNotificationState = [],
action: UiNotificationAction
) => {
switch (action.type) {
case UiNotificationActionType.DISPATCH_NOTIFICATION:
return state.concat((action as DispatchUiNotificationAction).notification)
@ -25,7 +27,10 @@ export const UiNotificationReducer: Reducer<UiNotificationState, UiNotificationA
}
}
const dismissNotification = (notificationState: UiNotificationState, notificationIndex: number): UiNotificationState => {
const dismissNotification = (
notificationState: UiNotificationState,
notificationIndex: number
): UiNotificationState => {
const newArray = [...notificationState]
const oldNotification = newArray[notificationIndex]
newArray[notificationIndex] = {

View file

@ -14,7 +14,7 @@ export enum UiNotificationActionType {
}
export interface UiNotificationButton {
label: string,
label: string
onClick: () => void
}