-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
569 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/app/src/features/easy-borrow/components/form/Borrow.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
import { NormalizedUnitNumber } from '@/domain/types/NumericValues' | ||
import { Form } from '@/ui/atoms/form/Form' | ||
import { WithClassname, WithTooltipProvider } from '@sb/decorators' | ||
import { tokens } from '@sb/tokens' | ||
import { useForm } from 'react-hook-form' | ||
import { withRouter } from 'storybook-addon-remix-react-router' | ||
import { Borrow } from './Borrow' | ||
|
||
function BorrowWrapper() { | ||
const form = useForm() as any | ||
|
||
return ( | ||
<Form {...form}> | ||
<Borrow | ||
control={form.control} | ||
selectedAssets={[ | ||
{ | ||
token: tokens.DAI, | ||
balance: NormalizedUnitNumber(1), | ||
}, | ||
]} | ||
changeAsset={() => {}} | ||
allAssets={[ | ||
{ | ||
token: tokens.DAI, | ||
balance: NormalizedUnitNumber(1), | ||
}, | ||
{ | ||
token: tokens.USDS, | ||
balance: NormalizedUnitNumber(2), | ||
}, | ||
]} | ||
alreadyBorrowed={{ | ||
tokens: [tokens.DAI], | ||
totalValueUSD: NormalizedUnitNumber(3000), | ||
}} | ||
/> | ||
</Form> | ||
) | ||
} | ||
|
||
const meta: Meta<typeof BorrowWrapper> = { | ||
title: 'Features/EasyBorrow/Components/Form/Borrow', | ||
decorators: [withRouter, WithTooltipProvider(), WithClassname('w-[425px]')], | ||
component: BorrowWrapper, | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof BorrowWrapper> | ||
|
||
export const Default: Story = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
packages/app/src/features/easy-borrow/components/form/Deposits.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
import { NormalizedUnitNumber } from '@/domain/types/NumericValues' | ||
import { Form } from '@/ui/atoms/form/Form' | ||
import { WithClassname, WithTooltipProvider } from '@sb/decorators' | ||
import { tokens } from '@sb/tokens' | ||
import { useForm } from 'react-hook-form' | ||
import { withRouter } from 'storybook-addon-remix-react-router' | ||
import { Deposits } from './Deposits' | ||
|
||
function DepositsWrapper() { | ||
const form = useForm() as any | ||
|
||
return ( | ||
<Form {...form}> | ||
<Deposits | ||
control={form.control} | ||
selectedAssets={[ | ||
{ | ||
token: tokens.ETH, | ||
balance: NormalizedUnitNumber(1), | ||
}, | ||
{ | ||
token: tokens.wstETH, | ||
balance: NormalizedUnitNumber(1.5), | ||
}, | ||
]} | ||
changeAsset={() => {}} | ||
addAsset={() => {}} | ||
removeAsset={() => {}} | ||
allAssets={[ | ||
{ | ||
token: tokens.ETH, | ||
balance: NormalizedUnitNumber(1), | ||
}, | ||
{ | ||
token: tokens.wstETH, | ||
balance: NormalizedUnitNumber(2), | ||
}, | ||
{ | ||
token: tokens.rETH, | ||
balance: NormalizedUnitNumber(3), | ||
}, | ||
]} | ||
alreadyDeposited={{ | ||
tokens: [tokens.ETH, tokens.wstETH], | ||
totalValueUSD: NormalizedUnitNumber(5000), | ||
}} | ||
assetToMaxValue={{ | ||
[tokens.ETH.symbol]: NormalizedUnitNumber(1), | ||
[tokens.wstETH.symbol]: NormalizedUnitNumber(2), | ||
[tokens.rETH.symbol]: NormalizedUnitNumber(3), | ||
}} | ||
/> | ||
</Form> | ||
) | ||
} | ||
|
||
const meta: Meta<typeof DepositsWrapper> = { | ||
title: 'Features/EasyBorrow/Components/Form/Deposits', | ||
decorators: [withRouter, WithTooltipProvider(), WithClassname('w-[425px]')], | ||
component: DepositsWrapper, | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof DepositsWrapper> | ||
|
||
export const Default: Story = {} |
Oops, something went wrong.