Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Mar 24, 2023
1 parent 78a3698 commit 8da5300
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Expand Up @@ -23,7 +23,7 @@ export const InterfaceCreateSoulname = (): JSX.Element => {
};

const values: { name: PaymentMethod; value: string }[] = [];
for (let token in tokensAvailable) {
for (const token in tokensAvailable) {
values.push({
name: token as PaymentMethod,
value: tokensAvailable[token],
Expand Down Expand Up @@ -148,7 +148,7 @@ export const InterfaceCreateSoulname = (): JSX.Element => {
handlePurchaseIdentityWithSoulname,
identity,
closeModal,
paymentMethod
paymentMethod,
]);

if (isLoading) return <MasaLoading />;
Expand Down Expand Up @@ -270,8 +270,9 @@ export const InterfaceCreateSoulname = (): JSX.Element => {
<Select
label="Payment asset"
values={paymentMethods}
onChange={(e: any) => {
setPaymentMethod(e.target?.value);
onChange={(e: unknown) => {
const event = e as { target: { value: PaymentMethod } };
setPaymentMethod(event.target?.value);
}}
readOnly={true}
/>
Expand Down
12 changes: 9 additions & 3 deletions src/components/select/select.tsx
Expand Up @@ -2,9 +2,15 @@ import React from 'react';
interface InputProps extends React.HTMLProps<HTMLSelectElement> {
label?: string;
required?: boolean;
values?: any[];
values?: { name: string; value: string }[];
}
export const Select = ({ label, required, values, className, ...rest }: InputProps) => {
export const Select = ({
label,
required,
values,
className,
...rest
}: InputProps) => {
return (
<div className="masa-input-container">
{label && (
Expand All @@ -14,7 +20,7 @@ export const Select = ({ label, required, values, className, ...rest }: InputPro
)}
<select className={`masa-input ${className}`} {...rest}>
{values &&
values.map((v) => {
values.map((v: { name: string }) => {
return <option value={v.name}>{v.name}</option>;
})}
</select>
Expand Down
2 changes: 1 addition & 1 deletion src/provider/modules/scopes/scopes.ts
Expand Up @@ -30,7 +30,7 @@ export const useScopes = (
}

return true;
}, [soulnames, scope, isLoggedIn, verbose]);
}, [soulnames, scope, isLoggedIn, verbose, identity]);

return { scope, setScope, areScopesFullfiled };
};
1 change: 0 additions & 1 deletion stories/masa.stories.tsx
Expand Up @@ -3,7 +3,6 @@
import React, { useCallback } from 'react';
import { MasaProvider, queryClient, useMasa } from '../src';
import { Args, Meta, Story } from '@storybook/react';
import { EnvironmentName } from '@masa-finance/masa-sdk';

const meta: Meta = {
title: 'SDK Test',
Expand Down

0 comments on commit 8da5300

Please sign in to comment.