Skip to content

Commit 71c16f9

Browse files
Copilottom2drum
andauthored
[Migration 6-5] Feature: account (blockscout#3459)
* feat(account): migrate account feature files to client/features/account/ Move all account-related files from legacy ui/ locations into the client/features/account/ feature directory structure. - Types: api.ts (merged), client.ts, auth-modal/types.ts, user-profile/types.ts - Stubs: stubs.ts (from stubs/account.ts) - Mocks: verified-addresses.ts, user-profile.ts - Hooks: useGetCsrfToken, useIsAuth, useLogout, useProfileQuery, useRedirectForInvalidAuthToken, useSignInWithWallet, useLinkEmail* - Utils: user-handle.ts (from profile/common/utils.ts) - Components: auth-modal/*, user-profile/*, DeleteModal, TableItemActionButtons, AccountPageDescription - Pages: profile/*, api-keys/*, private-tags/*, watchlist/*, custom-abi/*, verified-addresses/* (including address-verification and token-info) - Update all import paths across the entire repo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: tom2drum <22130104+tom2drum@users.noreply.github.com> * fixes --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tom2drum <22130104+tom2drum@users.noreply.github.com> Co-authored-by: tom <tom@ohhhh.me>
1 parent a2b860a commit 71c16f9

196 files changed

Lines changed: 490 additions & 437 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/api/hooks/useApiFetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useQueryClient } from '@tanstack/react-query';
44
import { omit, pickBy } from 'es-toolkit';
55
import React from 'react';
66

7-
import type { CsrfData } from 'types/client/account';
7+
import type { CsrfData } from 'client/features/account/types/client';
88
import type { ExternalChainExtended } from 'types/externalChains';
99

1010
import * as cookies from 'client/shared/storage/cookies';

client/api/services/admin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: LicenseRef-Blockscout
22

33
import type { ApiResource } from '../types';
4-
import type { TokenInfoApplicationConfig, TokenInfoApplications } from 'types/api/account';
4+
import type { TokenInfoApplicationConfig, TokenInfoApplications } from 'client/features/account/types/api';
55
import type { MarketplaceApp } from 'types/client/marketplace';
66

77
export const ADMIN_API_RESOURCES = {

client/api/services/contract-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: LicenseRef-Blockscout
22

33
import type { ApiResource } from '../types';
4+
import type { VerifiedAddressResponse } from 'client/features/account/types/api';
45
import type { TokenVerifiedInfo } from 'client/features/verified-tokens/types/api';
5-
import type { VerifiedAddressResponse } from 'types/api/account';
66
import type { Pool, PoolsResponse } from 'types/api/pools';
77

88
export const CONTRACT_INFO_API_RESOURCES = {

client/api/services/general/account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: LicenseRef-Blockscout
22

33
import type { ApiResource } from '../../types';
4-
import type { AddressTagsResponse, ApiKeys, CustomAbis, TransactionTagsResponse, UserInfo, WatchlistResponse } from 'types/api/account';
4+
import type { AddressTagsResponse, ApiKeys, CustomAbis, TransactionTagsResponse, UserInfo, WatchlistResponse } from 'client/features/account/types/api';
55

66
export const GENERAL_API_ACCOUNT_RESOURCES = {
77
// ACCOUNT

ui/shared/AccountPageDescription.tsx renamed to client/features/account/components/AccountPageDescription.tsx

File renamed without changes.

ui/shared/DeleteModal.tsx renamed to client/features/account/components/DeleteModal.tsx

File renamed without changes.

ui/shared/TableItemActionButtons.tsx renamed to client/features/account/components/TableItemActionButtons.tsx

File renamed without changes.

ui/snippets/auth/AuthModal.pw.tsx renamed to client/features/account/components/auth-modal/AuthModal.pw.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { BrowserContext } from '@playwright/test';
22
import React from 'react';
33

4-
import * as profileMock from 'mocks/user/profile';
4+
import * as profileMock from 'client/features/account/mocks/user-profile';
5+
56
import { contextWithAuth } from 'playwright/fixtures/auth';
67
import { test, expect } from 'playwright/lib';
78

ui/snippets/auth/AuthModal.pwstory.tsx renamed to client/features/account/components/auth-modal/AuthModal.pwstory.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import { Box } from '@chakra-ui/react';
44
import React from 'react';
55

6+
import useIsAuth from 'client/features/account/hooks/useIsAuth';
7+
68
import { Button } from 'toolkit/chakra/button';
79
import { useDisclosure } from 'toolkit/hooks/useDisclosure';
810

911
import AuthModal from './AuthModal';
10-
import useIsAuth from './useIsAuth';
1112

1213
interface Props {
1314
flow: 'email_login' | 'email_link';

ui/snippets/auth/AuthModal.tsx renamed to client/features/account/components/auth-modal/AuthModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import type { Screen, ScreenSuccess } from './types';
88

99
import { getResourceKey } from 'client/api/hooks/useApiQuery';
1010

11+
import useGetCsrfToken from 'client/features/account/hooks/useGetCsrfToken';
12+
1113
import * as mixpanel from 'client/shared/analytics/mixpanel';
1214

1315
import config from 'configs/app';
1416
import { useRewardsContext } from 'lib/contexts/rewards';
15-
import useGetCsrfToken from 'lib/hooks/useGetCsrfToken';
1617
import { DialogBody, DialogContent, DialogHeader, DialogRoot } from 'toolkit/chakra/dialog';
1718

1819
import AuthModalScreenConnectWallet from './screens/AuthModalScreenConnectWallet';

0 commit comments

Comments
 (0)