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 Feb 20, 2024
1 parent 0ff7701 commit 829fc6d
Show file tree
Hide file tree
Showing 268 changed files with 3,381 additions and 3,352 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 @@ -144,6 +144,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.

21 changes: 8 additions & 13 deletions src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Suspense } from 'react';
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,18 +22,15 @@ 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>
</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.

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.

5 changes: 1 addition & 4 deletions src/app/components/account/account-addresses.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HStack } from 'leather-styles/jsx';

import { useViewportMinWidth } from '@app/common/hooks/use-media-query';
import { BulletSeparator } from '@app/ui/components/bullet-separator/bullet-separator';
import { Caption } from '@app/ui/components/typography/caption';
import { truncateMiddle } from '@app/ui/utils/truncate-middle';
Expand All @@ -12,13 +11,11 @@ interface AccountAddressesProps {
index: number;
}
export function AcccountAddresses({ index }: AccountAddressesProps) {
const isBreakpointSm = useViewportMinWidth('sm');

return (
<HStack alignItems="center" gap="space.02" whiteSpace="nowrap">
<BulletSeparator>
<StacksAccountLoader index={index}>
{account => <Caption>{truncateMiddle(account.address, isBreakpointSm ? 4 : 3)}</Caption>}
{account => <Caption>{truncateMiddle(account.address, 4)}</Caption>}
</StacksAccountLoader>
<BitcoinNativeSegwitAccountLoader index={index}>
{signer => <Caption>{truncateMiddle(signer.address, 5)}</Caption>}
Expand Down
Loading

0 comments on commit 829fc6d

Please sign in to comment.