Skip to content

Commit

Permalink
chore: replace drawer with dialog, add containers and global header f…
Browse files Browse the repository at this point in the history
…ooters, refactor onboarding, ref #4371
  • Loading branch information
pete-watters committed Mar 4, 2024
1 parent 4fdeea4 commit 276ccfe
Show file tree
Hide file tree
Showing 292 changed files with 3,542 additions and 3,758 deletions.
6 changes: 6 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ const config: StorybookConfig = {
},
],
},

{
test: /\.(ts|tsx)$/,
loader: 'esbuild-loader',
options: { tsconfig: './tsconfig.json', target: 'es2020' },
},
],
},
},
Expand Down
7 changes: 7 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Preview } from '@storybook/react';

import '../src/app/index.css';
import { customViewports } from './viewports';

const preview: Preview = {
parameters: {
Expand All @@ -24,6 +25,12 @@ const preview: Preview = {
date: /Date$/i,
},
},
viewport: {
viewports: {
...customViewports,
},
},
toc: true,
},
};

Expand Down
49 changes: 49 additions & 0 deletions .storybook/viewports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { breakpoints } from '@leather-wallet/tokens';

// TODO import from '@leather-wallet/tokens'
import { tokens } from '../theme/tokens';

export const customViewports = {
popup: {
name: 'Popup',
styles: {
width: tokens.sizes.popupWidth.value,
height: tokens.sizes.popupHeight.value,
},
},
sm: {
name: 'sm',
styles: {
width: breakpoints.sm,
height: '100%',
},
},
md: {
name: 'md',
styles: {
width: breakpoints.md,
height: '100%',
},
},
lg: {
name: 'lg',
styles: {
width: breakpoints.lg,
height: '100%',
},
},
xl: {
name: 'xl',
styles: {
width: breakpoints.xl,
height: '100%',
},
},
'2xl': {
name: '2xl',
styles: {
width: breakpoints['2xl'],
height: '100%',
},
},
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"@radix-ui/react-tabs": "1.0.4",
"@radix-ui/react-tooltip": "1.0.7",
"@radix-ui/themes": "2.0.3",
"@radix-ui/react-dialog": "1.0.5",
"@reduxjs/toolkit": "1.9.6",
"@scure/base": "1.1.3",
"@scure/bip32": "1.3.2",
Expand Down
12 changes: 0 additions & 12 deletions public/html/popup-center.html

This file was deleted.

28 changes: 15 additions & 13 deletions src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Suspense } from 'react';
import { Toaster } from 'react-hot-toast';
import { Provider as ReduxProvider } from 'react-redux';

import { radixBaseCSS } from '@radix-ui/themes/styles.css';
import { QueryClientProvider } from '@tanstack/react-query';
import { styled } from 'leather-styles/jsx';
import { PersistGate } from 'redux-persist/integration/react';

import { queryClient } from '@app/common/persistence';
Expand All @@ -24,19 +23,22 @@ export function App() {
<ReduxProvider store={store}>
<PersistGate loading={<FullPageLoadingSpinner />} persistor={persistor}>
<HeadProvider />
{/* TODO: this works but investigate importing radixBaseCSS in panda layer config */}
<ThemeSwitcherProvider>
<styled.div css={radixBaseCSS}>
<QueryClientProvider client={queryClient}>
<Suspense fallback={<FullPageLoadingSpinner />}>
<AppErrorBoundary>
<AppRoutes />
</AppErrorBoundary>
{reactQueryDevToolsEnabled && <Devtools />}
</Suspense>
</QueryClientProvider>
</styled.div>
<QueryClientProvider client={queryClient}>
<Suspense fallback={<FullPageLoadingSpinner />}>
<AppErrorBoundary>
<AppRoutes />
</AppErrorBoundary>
{reactQueryDevToolsEnabled && <Devtools />}
</Suspense>
</QueryClientProvider>
</ThemeSwitcherProvider>
<Toaster
position="bottom-center"
toastOptions={{
style: { fontSize: '14px' },
}}
/>
</PersistGate>
</ReduxProvider>
);
Expand Down
26 changes: 0 additions & 26 deletions src/app/common/hooks/use-drawers.ts

This file was deleted.

74 changes: 0 additions & 74 deletions src/app/common/hooks/use-event-listener.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/common/hooks/use-latest-ref.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/app/common/hooks/use-media-query.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/app/common/hooks/use-route-header.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/app/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,6 @@ export function isPopupMode() {
return pageMode === 'popup';
}

export function isFullPageMode() {
return pageMode === 'full';
}

interface WhenStacksChainIdMap<T> {
[ChainID.Mainnet]: T;
[ChainID.Testnet]: T;
Expand Down
6 changes: 6 additions & 0 deletions src/app/common/utils/copy-to-clipboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import toast from 'react-hot-toast';

export function copyToClipboard(text: string) {
navigator.clipboard.writeText(text);
toast.success('Copied to clipboard!');
}
26 changes: 0 additions & 26 deletions src/app/common/utils/use-interval.ts

This file was deleted.

39 changes: 0 additions & 39 deletions src/app/common/utils/use-waiting-message.ts

This file was deleted.

Loading

0 comments on commit 276ccfe

Please sign in to comment.