From a14ed40a19e78d0ad15006458ee4119ea96e77a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Bardaj=C3=AD=20Puig?= Date: Thu, 21 Mar 2024 13:52:36 +0100 Subject: [PATCH] Refactor var names --- src/lib/WalletProviderOption.tsx | 4 ++-- src/lib/WalletProviderSelector.tsx | 8 +++++--- src/lib/utils.ts | 4 ++-- src/mocks.ts | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/lib/WalletProviderOption.tsx b/src/lib/WalletProviderOption.tsx index 52c77d6..67ac4ea 100644 --- a/src/lib/WalletProviderOption.tsx +++ b/src/lib/WalletProviderOption.tsx @@ -1,8 +1,8 @@ import { createSignal } from "solid-js"; -import { ProviderOption } from "./utils"; +import { WalletProviderOption } from "./utils"; -interface Props extends ProviderOption { +interface Props extends WalletProviderOption { onProviderSelected: (walletId: string) => void; } diff --git a/src/lib/WalletProviderSelector.tsx b/src/lib/WalletProviderSelector.tsx index c7cff2c..8f8a755 100644 --- a/src/lib/WalletProviderSelector.tsx +++ b/src/lib/WalletProviderSelector.tsx @@ -5,12 +5,14 @@ import { CssReset } from "./CssReset"; import { WalletProviderOption } from "./WalletProviderOption"; import { XCircle } from "./XCircle"; import { cancel, close, open, select } from "./constants"; -import { ProviderOption } from "./utils"; +import { WalletProviderOption as TWalletProviderOption } from "./utils"; export function WalletProviderSelector() { const [isVisible, setIsVisible] = createSignal(false); const [shouldRender, setShouldRender] = createSignal(false); - const [providers, setProviders] = createSignal>([]); + const [providers, setProviders] = createSignal>( + [], + ); const triggerFadeOut = () => setIsVisible(false); @@ -36,7 +38,7 @@ export function WalletProviderSelector() { }); } - function handleOpen(e: CustomEvent>) { + function handleOpen(e: CustomEvent>) { batch(() => { setIsVisible(true); setShouldRender(true); diff --git a/src/lib/utils.ts b/src/lib/utils.ts index fb1bce5..2c49d40 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -36,7 +36,7 @@ export interface InstallPrompt { url: string; } -export interface ProviderOption { +export interface WalletProviderOption { name: string; id: string; icon: string; @@ -44,7 +44,7 @@ export interface ProviderOption { } export function selectWalletProvider( - walletProviders: Array, + walletProviders: Array, ): Promise { return new Promise((resolve, reject) => { const walletSelectorElement = getWalletProviderSelectorElement(); diff --git a/src/mocks.ts b/src/mocks.ts index 8d3b33c..bd66366 100644 --- a/src/mocks.ts +++ b/src/mocks.ts @@ -1,6 +1,6 @@ -import { ProviderOption } from "./lib"; +import { WalletProviderOption } from "./lib"; -export function mockGetAvailableProviders(): Array { +export function mockGetAvailableProviders(): Array { return [ { name: "Walet (uninstalled)",