Skip to content

Commit

Permalink
chore: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Mar 5, 2024
1 parent 172f707 commit 780454c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 22 deletions.
3 changes: 2 additions & 1 deletion src/app/features/settings/sign-out/sign-out-confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export function SignOut({ isShowing = false, onClose }: SignOutProps) {
useEffect(() => void analytics.track('sign-out'), [analytics]);
const { signOut } = useKeyActions();
const navigate = useNavigate();
// FIXME same bug as SwitchAcccount dialog where we call hooks from useWalletType when no wallet yet set
// #4370 SMELL without this early return the wallet crashes on new install with
// : Wallet is neither of type `ledger` nor `software`
if (!isShowing) return null;
return (
<SignOutDialog
Expand Down
17 changes: 14 additions & 3 deletions src/app/ui/components/containers/dialog/dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useState } from 'react';

import type { Meta } from '@storybook/react';

import { Dialog as Component, RadixDialogProps } from './dialog';
import { Button } from '../../button/button';
import { Dialog as Component } from './dialog';

const meta: Meta<typeof Component> = {
component: Component,
Expand All @@ -10,6 +13,14 @@ const meta: Meta<typeof Component> = {

export default meta;

export function Dialog(args: RadixDialogProps) {
return <Component {...args} />;
export function Dialog() {
const [isShowing, setIsShowing] = useState(false);
return (
<>
<Button onClick={() => setIsShowing(!isShowing)}>Open</Button>
<Component isShowing={isShowing} onClose={() => setIsShowing(false)}>
<h1>Some Dialog</h1>
</Component>
</>
);
}
15 changes: 0 additions & 15 deletions src/app/ui/components/containers/footers/footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Meta } from '@storybook/react';
import { Flex, styled } from 'leather-styles/jsx';

import { Button } from '@app/ui/components/button/button';
import { AvailableBalance } from '@app/ui/components/containers/footers/available-balance';

import { Footer as Component } from './footer';

Expand Down Expand Up @@ -124,20 +123,6 @@ export function FooterWithLink() {
);
}

export function FooterWithBalance() {
return (
<Component>
<Button onClick={() => null} type="submit">
Button
</Button>
<AvailableBalance
balance="0.00048208 BTC"
balanceTooltipLabel="Total balance minus any amounts already represented by transfer inscriptions in your wallet."
/>
</Component>
);
}

export function FooterWithBalancesAbove() {
return (
<Component>
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/components/flag/flag.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Flag as Component } from './flag';
const meta: Meta<typeof Component> = {
component: Component,
tags: ['autodocs'],
title: 'Layout/Flag',
title: 'Design System/Layout/Flag',
argTypes: {
align: {
options: ['top', 'middle', 'bottom'],
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/components/item/item.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ItemLayout as Component } from './item.layout';
const meta: Meta<typeof Component> = {
component: Component,
tags: ['autodocs'],
title: 'Layout/Item',
title: 'Design System/Layout/Item',
};

export default meta;
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/pages/two-column.layout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default meta;
export function TwoColumnLayout() {
return (
<Component title={<>Hello world</>} content={<p>lorem ipsum </p>} action={<>some action</>}>
<Box width="100%" height="dialogHeight" bg="lightModeRed.300" />
<Box width="100%" height="dialogHeight" bg="red" />
</Component>
);
}

0 comments on commit 780454c

Please sign in to comment.