Skip to content

Commit

Permalink
feat(wallet): revert not '_component' imports.
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
  • Loading branch information
panteleymonchuk committed Aug 12, 2024
1 parent 44c7a27 commit 91e171c
Show file tree
Hide file tree
Showing 114 changed files with 232 additions and 231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import { type IotaSignMessageOutput } from '@iota/wallet-standard';

import { isBasePayload, type BasePayload, type Payload } from '_payloads';
import { isBasePayload, type BasePayload } from '../BasePayload';
import { type Payload } from '../Payload';

export interface SignMessageRequest extends BasePayload {
type: 'sign-message-request';
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/shared/utils/url.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { getUrlWithDeviceId } from '_src/shared/analytics/amplitude';
import { getUrlWithDeviceId } from '../analytics/amplitude';

const IOTA_DAPPS = ['iotafrens.com', 'iotans.io'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { type IotaClient } from '@iota/iota.js/client';
import type { SerializedSignature } from '@iota/iota.js/cryptography';

import type { BackgroundClient } from '.';
import { WalletSigner } from '_app/WalletSigner';
import { WalletSigner } from '../WalletSigner';

export class BackgroundServiceSigner extends WalletSigner {
readonly #account: SerializedUIAccount;
Expand Down
8 changes: 4 additions & 4 deletions apps/wallet/src/ui/app/background-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import { toB64 } from '@iota/iota.js/utils';
import { type QueryKey } from '@tanstack/react-query';
import { lastValueFrom, map, take } from 'rxjs';

import { growthbook } from '_app/experimentation/feature-gating';
import { ACCOUNTS_QUERY_KEY } from '_app/helpers/query-client-keys';
import { queryClient } from '_app/helpers/queryClient';
import { ACCOUNT_SOURCES_QUERY_KEY } from '_app/hooks/useAccountSources';
import { growthbook } from '../experimentation/feature-gating';
import { ACCOUNTS_QUERY_KEY } from '../helpers/query-client-keys';
import { queryClient } from '../helpers/queryClient';
import { ACCOUNT_SOURCES_QUERY_KEY } from '../hooks/useAccountSources';
import { AccountSourceType } from '_src/background/account-sources/AccountSource';
import {
type DeriveBipPathAccountsFinder,
Expand Down
6 changes: 3 additions & 3 deletions apps/wallet/src/ui/app/components/DAppInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { getValidDAppUrl } from '_src/shared/utils';
import { CheckFill16 } from '@iota/icons';
import cn from 'clsx';

import { useAccountByAddress } from '_app/hooks/useAccountByAddress';
import { Heading } from '_app/shared/heading';
import { Link } from '_app/shared/Link';
import { useAccountByAddress } from '../hooks/useAccountByAddress';
import { Heading } from '../shared/heading';
import { Link } from '../shared/Link';
import { AccountIcon } from './accounts/AccountIcon';
import { AccountItem } from './accounts/AccountItem';
import { LockUnlockButton } from './accounts/LockUnlockButton';
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/DAppPermissionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { PermissionType } from '_messages/payloads/permissions';
import { CheckFill12 } from '@iota/icons';

import { Text } from '_app/shared/text';
import { Text } from '../shared/text';

export interface DAppPermissionsListProps {
permissions: PermissionType[];
Expand Down
6 changes: 3 additions & 3 deletions apps/wallet/src/ui/app/components/HideShowDisplayBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Copy16, EyeClose16, EyeOpen16 } from '@iota/icons';
import { cx } from 'class-variance-authority';
import { useEffect, useState } from 'react';

import { useCopyToClipboard } from '_app/hooks/useCopyToClipboard';
import { Link } from '_app/shared/Link';
import { Text } from '_app/shared/text';
import { useCopyToClipboard } from '../hooks/useCopyToClipboard';
import { Link } from '../shared/Link';
import { Text } from '../shared/text';

const AUTO_HIDE_INTERVAL = 3 * 60 * 1000;

Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { cva, type VariantProps } from 'class-variance-authority';

import { ButtonOrLink, type ButtonOrLinkProps } from '_app/shared/utils/ButtonOrLink';
import { ButtonOrLink, type ButtonOrLinkProps } from '../shared/utils/ButtonOrLink';

interface IconButtonProps extends ButtonOrLinkProps, VariantProps<typeof buttonStyles> {
icon: JSX.Element;
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/SectionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { Text } from '_app/shared/text';
import { Text } from '../shared/text';

interface SectionHeaderProps {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/SummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import clsx from 'clsx';
import type { ReactNode } from 'react';

import { Text } from '_app/shared/text';
import { Text } from '../shared/text';

export interface SummaryCardProps {
header?: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet/src/ui/app/components/WalletListSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import { cx } from 'class-variance-authority';
import { useMemo } from 'react';

import { useAccounts } from '_app/hooks/useAccounts';
import { Link } from '_app/shared/Link';
import { useAccounts } from '../hooks/useAccounts';
import { Link } from '../shared/Link';
import { SummaryCard } from './SummaryCard';
import { WalletListSelectItem, type WalletListSelectItemProps } from './WalletListSelectItem';

Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/WalletListSelectItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { formatAddress } from '@iota/iota.js/utils';
import { cva, cx, type VariantProps } from 'class-variance-authority';
import { useEffect, useRef } from 'react';

import { Text } from '_app/shared/text';
import { Text } from '../shared/text';

const styles = cva('transition flex flex-row flex-nowrap items-center gap-3 py-2 cursor-pointer', {
variants: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { Copy12 } from '@iota/icons';
import { Text } from '_src/ui/app/shared/text';
import { formatAddress } from '@iota/iota.js/utils';
import { useCopyToClipboard } from '_app/hooks/useCopyToClipboard';
import { useCopyToClipboard } from '../../hooks/useCopyToClipboard';
import { IconButton } from '_components/IconButton';
import { type SerializedUIAccount } from '_src/background/accounts/Account';
import { useBalance, useFormatCoin } from '@iota/core';
Expand Down
6 changes: 3 additions & 3 deletions apps/wallet/src/ui/app/components/accounts/AccountItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { formatAddress } from '@iota/iota.js/utils';
import cn from 'clsx';
import { forwardRef, type ReactNode } from 'react';

import { useAccounts } from '_app/hooks/useAccounts';
import { useCopyToClipboard } from '_app/hooks/useCopyToClipboard';
import { useExplorerLink } from '_app/hooks/useExplorerLink';
import { useAccounts } from '../../hooks/useAccounts';
import { useCopyToClipboard } from '../../hooks/useCopyToClipboard';
import { useExplorerLink } from '../../hooks/useExplorerLink';
import { ExplorerLinkType } from '_components/explorer-link/ExplorerLinkType';
import { IconButton } from '_components/IconButton';
import { EditableAccountName } from './EditableAccountName';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { type SerializedUIAccount } from '_src/background/accounts/Account';

import { useActiveAccount } from '_app/hooks/useActiveAccount';
import { useActiveAccount } from '../../hooks/useActiveAccount';
import { AccountIcon } from './AccountIcon';
import { AccountItem } from './AccountItem';
import { LockUnlockButton } from './LockUnlockButton';
Expand Down
8 changes: 4 additions & 4 deletions apps/wallet/src/ui/app/components/accounts/AccountsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { Filter16, Plus12 } from '@iota/icons';
import * as ToggleGroup from '@radix-ui/react-toggle-group';
import { useMemo, useState } from 'react';

import { useAccountGroups } from '_app/hooks/useAccountGroups';
import { useActiveAccount } from '_app/hooks/useActiveAccount';
import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { Heading } from '_app/shared/heading';
import { useAccountGroups } from '../../hooks/useAccountGroups';
import { useActiveAccount } from '../../hooks/useActiveAccount';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { Heading } from '../../shared/heading';
import { AccountListItem } from './AccountListItem';
import { FooterLink } from './FooterLink';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { useEffect } from 'react';
import { useFormContext } from 'react-hook-form';
import { z } from 'zod';

import { CheckboxField } from '_app/shared/forms/CheckboxField';
import { Input } from '_app/shared/forms/controls/Input';
import FormField from '_app/shared/forms/FormField';
import { SelectField } from '_app/shared/forms/SelectField';
import { CheckboxField } from '../../shared/forms/CheckboxField';
import { Input } from '../../shared/forms/controls/Input';
import FormField from '../../shared/forms/FormField';
import { SelectField } from '../../shared/forms/SelectField';

const LOCK_INTERVALS = [
{ id: 'day', label: 'Day' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { forwardRef, useRef } from 'react';
import toast from 'react-hot-toast';
import { z } from 'zod';

import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { Form } from '_app/shared/forms/Form';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { Form } from '../../shared/forms/Form';

interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'className'> {}

Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/accounts/FooterLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { forwardRef } from 'react';

import { Link, type LinkProps } from '_app/shared/Link';
import { Link, type LinkProps } from '../../shared/Link';

interface FooterLinkProps extends LinkProps {
icon?: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { type SubmitHandler } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import { z } from 'zod';

import { privateKeyValidation } from '_app/helpers/validation/privateKeyValidation';
import { Form } from '_app/shared/forms/Form';
import { TextAreaField } from '_app/shared/forms/TextAreaField';
import { privateKeyValidation } from '../../helpers/validation/privateKeyValidation';
import { Form } from '../../shared/forms/Form';
import { TextAreaField } from '../../shared/forms/TextAreaField';
import Alert from '_components/alert';

const formSchema = z.object({
Expand Down
6 changes: 3 additions & 3 deletions apps/wallet/src/ui/app/components/accounts/ImportSeedForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { type SubmitHandler } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import { z } from 'zod';

import { seedValidation } from '_app/helpers/validation/seedValidation';
import { Form } from '_app/shared/forms/Form';
import { TextAreaField } from '_app/shared/forms/TextAreaField';
import { seedValidation } from '../../helpers/validation/seedValidation';
import { Form } from '../../shared/forms/Form';
import { TextAreaField } from '../../shared/forms/TextAreaField';

const formSchema = z.object({
seed: seedValidation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { LockLocked16, LockUnlocked16 } from '@iota/icons';
import { type ComponentPropsWithoutRef } from 'react';

import { Tooltip } from '_app/shared/tooltip';
import { Tooltip } from '../../shared/tooltip';
import LoadingIndicator from '_components/loading/LoadingIndicator';

interface LockUnlockButtonProps extends ComponentPropsWithoutRef<'button'> {
Expand Down
10 changes: 5 additions & 5 deletions apps/wallet/src/ui/app/components/accounts/NicknameDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import { useState } from 'react';
import toast from 'react-hot-toast';
import { z } from 'zod';

import { useAccounts } from '_app/hooks/useAccounts';
import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { Button } from '_app/shared/ButtonUI';
import { Form } from '_app/shared/forms/Form';
import { TextField } from '_app/shared/forms/TextField';
import { useAccounts } from '../../hooks/useAccounts';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { Button } from '../../shared/ButtonUI';
import { Form } from '../../shared/forms/Form';
import { TextField } from '../../shared/forms/TextField';

const formSchema = z.object({
nickname: z.string().trim(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import { toast } from 'react-hot-toast';
import { v4 as uuidV4 } from 'uuid';
import { z } from 'zod';

import { useAccountSources } from '_app/hooks/useAccountSources';
import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { PasswordInput } from '_app/shared/forms/controls/PasswordInput';
import { Form } from '_app/shared/forms/Form';
import FormField from '_app/shared/forms/FormField';
import { Link } from '_app/shared/Link';
import { useAccountSources } from '../../hooks/useAccountSources';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { PasswordInput } from '../../shared/forms/controls/PasswordInput';
import { Form } from '../../shared/forms/Form';
import FormField from '../../shared/forms/FormField';
import { Link } from '../../shared/Link';
import { AccountSourceType } from '_src/background/account-sources/AccountSource';

const formSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { useNavigate } from 'react-router-dom';
import { z } from 'zod';
import zxcvbn from 'zxcvbn';

import { parseAutoLock, useAutoLockMinutes } from '_app/hooks/useAutoLockMinutes';
import { CheckboxField } from '_app/shared/forms/CheckboxField';
import { Form } from '_app/shared/forms/Form';
import { TextField } from '_app/shared/forms/TextField';
import { Link } from '_app/shared/Link';
import { parseAutoLock, useAutoLockMinutes } from '../../hooks/useAutoLockMinutes';
import { CheckboxField } from '../../shared/forms/CheckboxField';
import { Form } from '../../shared/forms/Form';
import { TextField } from '../../shared/forms/TextField';
import { Link } from '../../shared/Link';
import { AutoLockSelector, zodSchema } from './AutoLockSelector';

function addDot(str: string | undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import { type SerializedUIAccount } from '_src/background/accounts/Account';
import { CheckFill16 } from '@iota/icons';

import { Link } from '_app/shared/Link';
import { Text } from '_app/shared/text';
import { Tooltip } from '_app/shared/tooltip';
import { Link } from '../../shared/Link';
import { Text } from '../../shared/text';
import { Tooltip } from '../../shared/tooltip';
import { AccountListItem } from './AccountListItem';

export interface RecoverAccountsGroupProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { type SerializedUIAccount } from '_src/background/accounts/Account';

import { Button } from '_app/shared/ButtonUI';
import { Button } from '../../shared/ButtonUI';
import { useUnlockAccount } from './UnlockAccountContext';

export interface UnlockAccountButtonProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { type SerializedUIAccount } from '_src/background/accounts/Account';
import React, { createContext, useCallback, useContext, useState, type ReactNode } from 'react';
import { toast } from 'react-hot-toast';

import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { useUnlockMutation } from '_app/hooks/useUnlockMutation';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { useUnlockMutation } from '../../hooks/useUnlockMutation';
import { UnlockAccountModal } from './UnlockAccountModal';

interface UnlockAccountContextType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { type SerializedUIAccount } from '_src/background/accounts/Account';
import { toast } from 'react-hot-toast';

import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { PasswordModalDialog } from './PasswordInputDialog';

interface UnlockAccountModalProps {
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet/src/ui/app/components/explorer-link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { ArrowUpRight16 } from '@iota/icons';
import { formatAddress } from '@iota/iota.js/utils';
import type { ReactNode } from 'react';

import { useExplorerLink, type ExplorerLinkConfig } from '_app/hooks/useExplorerLink';
import { Text } from '_app/shared/text';
import { useExplorerLink, type ExplorerLinkConfig } from '../../hooks/useExplorerLink';
import { Text } from '../../shared/text';
import st from './ExplorerLink.module.scss';
import { ExplorerLinkType } from './ExplorerLinkType';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { prepareLinkToCompare } from '_src/shared/utils';
import { useFeature } from '@growthbook/growthbook-react';
import { useEffect, useMemo } from 'react';

import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { permissionsSelectors } from '_redux/slices/permissions';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { permissionsSelectors } from '../../redux/slices/permissions';
import Loading from '_components/loading';
import { IotaApp, type DAppEntry } from './IotaApp';
import { IotaAppEmpty } from './IotaAppEmpty';
Expand Down
6 changes: 3 additions & 3 deletions apps/wallet/src/ui/app/components/iota-apps/DisconnectApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { useMutation } from '@tanstack/react-query';
import { useEffect, useMemo, useState } from 'react';
import { toast } from 'react-hot-toast';

import { useBackgroundClient } from '_app/hooks/useBackgroundClient';
import { Button } from '_app/shared/ButtonUI';
import { Text } from '_app/shared/text';
import { useBackgroundClient } from '../../hooks/useBackgroundClient';
import { Button } from '../../shared/ButtonUI';
import { Text } from '../../shared/text';
import { DAppInfoCard } from '_components/DAppInfoCard';
import { DAppPermissionsList } from '_components/DAppPermissionsList';
import { SummaryCard } from '_components/SummaryCard';
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/iota-apps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useFeature } from '@growthbook/growthbook-react';
import { useMemo } from 'react';
import { useParams } from 'react-router-dom';

import { permissionsSelectors } from '_redux/slices/permissions';
import { permissionsSelectors } from '../../redux/slices/permissions';
import { AppsPageBanner } from './Banner';
import { IotaApp, type DAppEntry } from './IotaApp';
import { IotaAppEmpty } from './IotaAppEmpty';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { Text } from '_src/ui/app/shared/text';
import { useState } from 'react';

import { Link } from '_app/shared/Link';
import { Link } from '../../shared/Link';

interface ConnectLedgerModalProps {
onClose: () => void;
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/ui/app/components/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Activity32, Apps32, Nft132, Tokens32 } from '@iota/icons';
import cl from 'clsx';
import { NavLink } from 'react-router-dom';

import { useActiveAccount } from '_app/hooks/useActiveAccount';
import { useActiveAccount } from '../../hooks/useActiveAccount';
import st from './Navigation.module.scss';

export function Navigation() {
Expand Down
Loading

0 comments on commit 91e171c

Please sign in to comment.