Skip to content

Commit

Permalink
feature: add new deploys list item (#1031)
Browse files Browse the repository at this point in the history
* add new deploy list item and update deploys status component

* remove unused imports

* small improvements

* fix issue with rendering order

* add deploys details page

* Add casper-wallet-core initial usage

* added deploys plate, deploy details page, and fix infinite scrolling

* fix e2e tests for buy cspr

* Update casper-wallet-core

* Remove redundant types

---------

Co-authored-by: Dmytro Vynnyk <[email protected]>
  • Loading branch information
ost-ptk and Comp0te authored Sep 4, 2024
1 parent ac18807 commit 7a0e5a5
Show file tree
Hide file tree
Showing 93 changed files with 4,467 additions and 2,960 deletions.
10 changes: 1 addition & 9 deletions e2e-tests/popup/buy-cspr/buy-cspr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ popup.describe('Popup UI: buy cspr', () => {
).toBeVisible();
await popupPage.getByRole('button', { name: 'Next' }).click();

await popupExpect(
popupPage.getByRole('heading', { name: 'Review provider option' })
).toBeVisible();

await popupPage.getByText('Topper by Uphold').click();

await popupExpect(
Expand All @@ -43,7 +39,7 @@ popup.describe('Popup UI: buy cspr', () => {
}
);

popup.skip(
popup(
'should redirect to Ramp provider page',
async ({ popupPage, unlockVault, context }) => {
await unlockVault();
Expand All @@ -64,10 +60,6 @@ popup.describe('Popup UI: buy cspr', () => {
).toBeVisible();
await popupPage.getByRole('button', { name: 'Next' }).click();

await popupExpect(
popupPage.getByRole('heading', { name: 'Pick provider' })
).toBeVisible();

await popupExpect(
popupPage.getByRole('button', { name: 'Confirm' })
).toBeDisabled();
Expand Down
846 changes: 534 additions & 312 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@
"@noble/ciphers": "^0.3.0",
"@scure/bip32": "1.3.2",
"@scure/bip39": "1.2.1",
"@tanstack/react-query": "^5.52.3",
"@types/argon2-browser": "1.18.1",
"@types/webextension-polyfill": "0.9.2",
"@zondax/ledger-casper": "^2.6.1",
"base64-loader": "1.0.0",
"big.js": "^6.2.1",
"casper-cep18-js-client": "1.0.2",
"casper-js-sdk": "2.15.4",
"casper-wallet-core": "git+ssh://[email protected]:make-software/casper-wallet-core.git#v0.9.1",
"date-fns": "^2.30.0",
"i18next": "^23.11.0",
"i18next-browser-languagedetector": "^7.2.1",
Expand Down
7 changes: 2 additions & 5 deletions src/apps/popup/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { HashRouter, Route, Routes } from 'react-router-dom';
import { useUserActivityTracker } from '@src/hooks/use-user-activity-tracker';

import { AccountSettingsPage } from '@popup/pages/account-settings';
import { ActivityDetailsPage } from '@popup/pages/activity-details';
import { AddContactPage } from '@popup/pages/add-contact';
import { AllAccountsPage } from '@popup/pages/all-accounts';
import { BackupSecretPhrasePage } from '@popup/pages/backup-secret-phrase';
Expand All @@ -16,6 +15,7 @@ import { ConnectedSitesPage } from '@popup/pages/connected-sites';
import { ContactDetailsPage } from '@popup/pages/contact-details';
import { ContactsBookPage } from '@popup/pages/contacts';
import { CreateAccountPage } from '@popup/pages/create-account';
import { DeployDetailsPage } from '@popup/pages/deploy-details';
import { DownloadAccountKeysPage } from '@popup/pages/download-account-keys';
import { HomePageContent } from '@popup/pages/home';
import { ImportAccountFromLedgerPage } from '@popup/pages/import-account-from-ledger';
Expand Down Expand Up @@ -203,10 +203,6 @@ function AppRoutes() {
element={<DownloadAccountKeysPage />}
/>
<Route path={RouterPath.Transfer} element={<TransferPage />} />
<Route
path={RouterPath.ActivityDetails}
element={<ActivityDetailsPage />}
/>
<Route path={RouterPath.Token} element={<TokenDetailPage />} />
<Route path={RouterPath.Receive} element={<ReceivePage />} />
<Route path={RouterPath.NftDetails} element={<NftDetailsPage />} />
Expand Down Expand Up @@ -252,6 +248,7 @@ function AppRoutes() {
path={RouterPath.SignWithLedgerInNewWindow}
element={<SignWithLedgerInNewWindowPage />}
/>
<Route path={RouterPath.DeployDetails} element={<DeployDetailsPage />} />
</Routes>
);
}
23 changes: 20 additions & 3 deletions src/apps/popup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React, { Suspense, useState } from 'react';
import { createRoot } from 'react-dom/client';
// skeleton styles
Expand Down Expand Up @@ -26,6 +27,20 @@ import { AppRouter } from './app-router';
const Tree = () => {
const [state, setState] = useState<PopupState | null>(null);

const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 3 * 60 * 1000,
refetchInterval: 3 * 60 * 1000,
gcTime: 3 * 60 * 1000,
retry: false
},
mutations: {
retry: false
}
}
});

setCSPForSafari();

const isSystemDarkTheme = useSystemThemeDetector();
Expand Down Expand Up @@ -60,9 +75,11 @@ const Tree = () => {
<ThemeProvider theme={isDarkMode ? darkTheme : lightTheme}>
<GlobalStyle />
<ReduxProvider store={store}>
<ErrorBoundary>
<AppRouter />
</ErrorBoundary>
<QueryClientProvider client={queryClient}>
<ErrorBoundary>
<AppRouter />
</ErrorBoundary>
</QueryClientProvider>
</ReduxProvider>
</ThemeProvider>
</Suspense>
Expand Down
Loading

0 comments on commit 7a0e5a5

Please sign in to comment.