commit 9d432586989f992220c047be0df18ef05e4e3d45 parent 1732185ac1d1dcc783b8f2489f2ce333b5254d92 Author: Sebastian <sebasjm@gmail.com> Date: Thu, 27 May 2021 15:33:09 -0300 fix linting Diffstat:
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/packages/frontend/src/paths/instance/reserves/create/CreatePage.tsx b/packages/frontend/src/paths/instance/reserves/create/CreatePage.tsx @@ -46,8 +46,8 @@ enum Steps { } interface ViewProps { - step : Steps, - setCurrentStep: (s:Steps) => void; + step: Steps, + setCurrentStep: (s: Steps) => void; reserve: Partial<Entity>; onBack?: () => void; submitForm: () => Promise<void>; @@ -56,7 +56,7 @@ interface ViewProps { function ViewStep({ step, setCurrentStep, reserve, onBack, submitForm, setReserve }: ViewProps): VNode { const i18n = useTranslator() const [wireMethods, setWireMethods] = useState<Array<string>>([]) - const [exchangeQueryError, setExchangeQueryError] = useState<string|undefined>(undefined) + const [exchangeQueryError, setExchangeQueryError] = useState<string | undefined>(undefined) useEffect(() => { setExchangeQueryError(undefined) @@ -66,7 +66,7 @@ function ViewStep({ step, setCurrentStep, reserve, onBack, submitForm, setReserv case Steps.EXCHANGE: { const errors: FormErrors<Entity> = { initial_balance: !reserve.initial_balance ? 'cannot be empty' : !(parseInt(reserve.initial_balance.split(':')[1], 10) > 0) ? i18n`it should be greater than 0` : undefined, - exchange_url: !reserve.exchange_url ? i18n`cannot be empty` : !URL_REGEX.test(reserve.exchange_url) ? i18n`must be a valid URL` : !!exchangeQueryError ? exchangeQueryError : undefined, + exchange_url: !reserve.exchange_url ? i18n`cannot be empty` : !URL_REGEX.test(reserve.exchange_url) ? i18n`must be a valid URL` : !exchangeQueryError ? undefined : exchangeQueryError, } const hasErrors = Object.keys(errors).some(k => (errors as any)[k] !== undefined) @@ -87,7 +87,7 @@ function ViewStep({ step, setCurrentStep, reserve, onBack, submitForm, setReserv }) setWireMethods(wireMethods) setCurrentStep(Steps.WIRE_METHOD) - return + return }).catch((r: any) => { setExchangeQueryError(r.message) }) @@ -106,7 +106,7 @@ function ViewStep({ step, setCurrentStep, reserve, onBack, submitForm, setReserv <FormProvider<Entity> object={reserve} errors={errors} valueHandler={setReserve}> <InputCurrency<Entity> name="initial_balance" label={i18n`Initial balance`} readonly /> <Input<Entity> name="exchange_url" label={i18n`Exchange URL`} readonly /> - <InputSelector<Entity> name="wire_method" label={i18n`Wire method`} values={wireMethods} placeholder={i18n`Select one wire method`}/> + <InputSelector<Entity> name="wire_method" label={i18n`Wire method`} values={wireMethods} placeholder={i18n`Select one wire method`} /> </FormProvider> <div class="buttons is-right mt-5"> {onBack && <button class="button" onClick={() => setCurrentStep(Steps.EXCHANGE)} ><Translate>Back</Translate></button>} @@ -137,12 +137,12 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { <div class="tabs is-toggle is-fullwidth is-small"> <ul> - <li class={currentStep === Steps.EXCHANGE?"is-active":""}> + <li class={currentStep === Steps.EXCHANGE ? "is-active" : ""}> <a style={{ cursor: 'initial' }}> <span>Set exchange</span> </a> </li> - <li class={currentStep === Steps.WIRE_METHOD?"is-active":""}> + <li class={currentStep === Steps.WIRE_METHOD ? "is-active" : ""}> <a style={{ cursor: 'initial' }}> <span>Set wire method</span> </a> @@ -150,12 +150,12 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { </ul> </div> - <ViewStep step={currentStep} reserve={reserve} + <ViewStep step={currentStep} reserve={reserve} setCurrentStep={setCurrentStep} setReserve={setReserve} submitForm={submitForm} onBack={onBack} - /> + /> </div> <div class="column" /> </div> diff --git a/packages/frontend/src/paths/instance/reserves/list/AutorizeTipModal.tsx b/packages/frontend/src/paths/instance/reserves/list/AutorizeTipModal.tsx @@ -71,8 +71,8 @@ export function AuthorizeTipModal({ onCancel, onConfirm, tipAuthorized }: Author return <ConfirmModal description="tip" active onCancel={onCancel} disabled={hasErrors} onConfirm={validateAndConfirm}> <FormProvider<State> errors={errors} object={form} valueHandler={setValue} > - <InputCurrency<State> name="amount" label={i18n`Amount`} tooltip={i18n`amount of tip`}/> - <Input<State> name="justification" label={i18n`Justification`} inputType="multiline" tooltip={i18n`reason for the tip`}/> + <InputCurrency<State> name="amount" label={i18n`Amount`} tooltip={i18n`amount of tip`} /> + <Input<State> name="justification" label={i18n`Justification`} inputType="multiline" tooltip={i18n`reason for the tip`} /> <Input<State> name="next_url" label={i18n`URL after tip`} /> </FormProvider> diff --git a/packages/frontend/src/paths/instance/reserves/list/Table.tsx b/packages/frontend/src/paths/instance/reserves/list/Table.tsx @@ -72,8 +72,7 @@ export function CardTable({ instances, onCreate, onSelect, onNewTip, onDelete }: <div class="card has-table"> <header class="card-header"> <p class="card-header-title"><span class="icon"><i class="mdi mdi-cash" /></span><Translate>Reserves ready</Translate></p> - <div class="card-header-icon" aria-label="more options"> - </div> + <div class="card-header-icon" aria-label="more options" /> </header> <div class="card-content"> <div class="b-table has-pagination">