From 4476cb4d3c210624ccf976ae827d5dff5cb5d412 Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Thu, 1 Jul 2021 21:30:59 +1000 Subject: [PATCH] run prettier --- www/src/components/fields/index.tsx | 12 +++++++----- www/src/constants/fields.ts | 1 - www/src/firebase/callables.ts | 6 +++--- www/src/firebase/index.ts | 2 +- www/src/hooks/useFiretable/index.ts | 4 ++-- www/src/utils/fns.ts | 5 ++++- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/www/src/components/fields/index.tsx b/www/src/components/fields/index.tsx index 8f8bb0da..e224d2e1 100644 --- a/www/src/components/fields/index.tsx +++ b/www/src/components/fields/index.tsx @@ -76,7 +76,7 @@ export const FIELDS: IFieldConfig[] = [ // FIRETABLE User, Id, - Status + Status, ]; /** @@ -104,7 +104,9 @@ export const isFieldType = (fieldType: any) => { * Returns array of fieldTypes with dataType included dataTypes array * @param dataTypes */ -export const hasDataTypes = (dataTypes:string[])=>{ - const fieldTypes = FIELDS.map((field) => field.type); - return fieldTypes.filter((fieldType)=>dataTypes.includes(getFieldProp("dataType",fieldType))) -} \ No newline at end of file +export const hasDataTypes = (dataTypes: string[]) => { + const fieldTypes = FIELDS.map((field) => field.type); + return fieldTypes.filter((fieldType) => + dataTypes.includes(getFieldProp("dataType", fieldType)) + ); +}; diff --git a/www/src/constants/fields.ts b/www/src/constants/fields.ts index 0b92cef4..13962464 100644 --- a/www/src/constants/fields.ts +++ b/www/src/constants/fields.ts @@ -41,4 +41,3 @@ export enum FieldType { last = "LAST", status = "STATUS", } - diff --git a/www/src/firebase/callables.ts b/www/src/firebase/callables.ts index 9ac7ff71..7f582dea 100644 --- a/www/src/firebase/callables.ts +++ b/www/src/firebase/callables.ts @@ -2,7 +2,7 @@ import { functions } from "./index"; export enum CLOUD_FUNCTIONS { ImpersonatorAuth = "callable-ImpersonatorAuth", - getAlgoliaSearchKey = 'getAlgoliaSearchKey' + getAlgoliaSearchKey = "getAlgoliaSearchKey", } export const cloudFunction = ( @@ -29,5 +29,5 @@ export const cloudFunction = ( export const ImpersonatorAuth = (email: string) => functions.httpsCallable(CLOUD_FUNCTIONS.ImpersonatorAuth)({ email }); - export const getAlgoliaSearchKey = (index: string) => - functions.httpsCallable(CLOUD_FUNCTIONS.getAlgoliaSearchKey)({ index }); \ No newline at end of file +export const getAlgoliaSearchKey = (index: string) => + functions.httpsCallable(CLOUD_FUNCTIONS.getAlgoliaSearchKey)({ index }); diff --git a/www/src/firebase/index.ts b/www/src/firebase/index.ts index 9a98d06d..b03f596a 100644 --- a/www/src/firebase/index.ts +++ b/www/src/firebase/index.ts @@ -20,7 +20,7 @@ db.enablePersistence({ synchronizeTabs: true }); export const bucket = firebase.storage(); export const functions = firebase.functions(); -export const projectId = process.env.REACT_APP_FIREBASE_PROJECT_ID +export const projectId = process.env.REACT_APP_FIREBASE_PROJECT_ID; export const WEBHOOK_URL = `https://${(functions as any).region_}-${ appConfig.projectId }.cloudfunctions.net/webhook`; diff --git a/www/src/hooks/useFiretable/index.ts b/www/src/hooks/useFiretable/index.ts index 9f32c8f9..70a91ca7 100644 --- a/www/src/hooks/useFiretable/index.ts +++ b/www/src/hooks/useFiretable/index.ts @@ -11,7 +11,7 @@ export type FiretableActions = { update: Function; reorder: Function; }; - row: { add: Function; delete: Function; more: Function, update:Function}; + row: { add: Function; delete: Function; more: Function; update: Function }; table: { set: Function; filter: Function; @@ -94,7 +94,7 @@ const useFiretable = ( }, row: { add: tableActions.addRow, - update:tableActions.updateRow, + update: tableActions.updateRow, delete: tableActions.deleteRow, more: tableActions.moreRows, }, diff --git a/www/src/utils/fns.ts b/www/src/utils/fns.ts index 9facffec..aeacbc2c 100644 --- a/www/src/utils/fns.ts +++ b/www/src/utils/fns.ts @@ -27,7 +27,10 @@ export const arrayMover = ( return arr; // for testing purposes }; -export const missingFieldsReducer = (data: any) => (acc: string[], curr: string) => { +export const missingFieldsReducer = (data: any) => ( + acc: string[], + curr: string +) => { if (data[curr] === undefined) { return [...acc, curr]; } else return acc;