Skip to content

Commit

Permalink
Refactor var names
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Mar 21, 2024
1 parent 3769652 commit a14ed40
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/lib/WalletProviderOption.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createSignal } from "solid-js";

import { ProviderOption } from "./utils";
import { WalletProviderOption } from "./utils";

Check failure on line 3 in src/lib/WalletProviderOption.tsx

View workflow job for this annotation

GitHub Actions / build-and-publish

Import 'WalletProviderOption' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.

interface Props extends ProviderOption {
interface Props extends WalletProviderOption {
onProviderSelected: (walletId: string) => void;
}

Expand Down
8 changes: 5 additions & 3 deletions src/lib/WalletProviderSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Array<ProviderOption>>([]);
const [providers, setProviders] = createSignal<Array<TWalletProviderOption>>(
[],
);

const triggerFadeOut = () => setIsVisible(false);

Expand All @@ -36,7 +38,7 @@ export function WalletProviderSelector() {
});
}

function handleOpen(e: CustomEvent<Array<ProviderOption>>) {
function handleOpen(e: CustomEvent<Array<TWalletProviderOption>>) {
batch(() => {
setIsVisible(true);
setShouldRender(true);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export interface InstallPrompt {
url: string;
}

export interface ProviderOption {
export interface WalletProviderOption {
name: string;
id: string;
icon: string;
installPrompt?: InstallPrompt;
}

export function selectWalletProvider(
walletProviders: Array<ProviderOption>,
walletProviders: Array<WalletProviderOption>,
): Promise<string> {
return new Promise((resolve, reject) => {
const walletSelectorElement = getWalletProviderSelectorElement();
Expand Down
4 changes: 2 additions & 2 deletions src/mocks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ProviderOption } from "./lib";
import { WalletProviderOption } from "./lib";

export function mockGetAvailableProviders(): Array<ProviderOption> {
export function mockGetAvailableProviders(): Array<WalletProviderOption> {
return [
{
name: "Walet (uninstalled)",
Expand Down

0 comments on commit a14ed40

Please sign in to comment.