-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #636 from ar-io/PE-7274-funding-source
feat(PE-7274): funding source
- Loading branch information
Showing
23 changed files
with
2,213 additions
and
316 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,6 @@ docs | |
dist-id.txt | ||
dist-manifest.csv | ||
dist-manifest.json | ||
test-results | ||
test-results | ||
storybook-static | ||
*storybook.log |
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,22 @@ | ||
import type { StorybookConfig } from '@storybook/react-vite'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
|
||
addons: [ | ||
'@storybook/addon-onboarding', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
], | ||
|
||
framework: { | ||
name: '@storybook/react-vite', | ||
options: {}, | ||
}, | ||
|
||
typescript: { | ||
reactDocgen: 'react-docgen-typescript', | ||
}, | ||
}; | ||
export default config; |
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,14 @@ | ||
import type { Preview } from '@storybook/react'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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
165 changes: 165 additions & 0 deletions
165
src/components/data-display/TransactionDetails/TransactionDetails.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,165 @@ | ||
import '@src/index.css'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
|
||
import { TransactionDetails } from './TransactionDetails'; | ||
|
||
const meta = { | ||
title: 'Inputs/TransactionDetails', | ||
component: TransactionDetails, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
decorators: [ | ||
(Story, { parameters }) => { | ||
const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: false, | ||
initialData: () => parameters.costDetail, | ||
}, | ||
}, | ||
}); | ||
|
||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<div className="flex w-[700px] h-[500px] bg-background p-10 rounded-xl"> | ||
<Story /> | ||
</div> | ||
</QueryClientProvider> | ||
); | ||
}, | ||
], | ||
} as Meta<typeof TransactionDetails>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const BalancesBuyRecord: Story = { | ||
parameters: { | ||
costDetail: { | ||
tokenCost: 10000000000, | ||
discounts: [], | ||
fundingPlan: { | ||
balance: 10000000000, | ||
address: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
stakes: {}, | ||
shortfall: 0, | ||
}, | ||
}, | ||
}, | ||
args: { | ||
details: { | ||
name: 'ardrive', | ||
intent: 'Buy-Record', | ||
type: 'permabuy', | ||
fromAddress: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
}, | ||
}, | ||
}; | ||
|
||
export const BalancesDiscountBuyRecord: Story = { | ||
parameters: { | ||
discount: true, | ||
costDetail: { | ||
tokenCost: 10000000000, | ||
discounts: [ | ||
{ | ||
name: 'blah', | ||
discountTotal: 10000000000 / 2, | ||
multiplier: 1, | ||
}, | ||
], | ||
fundingPlan: { | ||
balance: 10000000000, | ||
address: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
stakes: {}, | ||
shortfall: 0, | ||
}, | ||
}, | ||
}, | ||
args: { | ||
details: { | ||
name: 'ardrive', | ||
intent: 'Buy-Record', | ||
type: 'permabuy', | ||
fromAddress: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
}, | ||
}, | ||
}; | ||
export const StakesDiscountBuyRecord: Story = { | ||
parameters: { | ||
discount: true, | ||
costDetail: { | ||
tokenCost: 10000000000, | ||
discounts: [ | ||
{ | ||
name: 'blah', | ||
discountTotal: 10000000000 / 2, | ||
multiplier: 1, | ||
}, | ||
], | ||
fundingPlan: { | ||
balance: 0, | ||
address: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
stakes: { | ||
stake1: { | ||
delegatedStake: 5000000000, | ||
vaults: { | ||
vault1: 2500000000, | ||
vault2: 2500000000, | ||
}, | ||
}, | ||
}, | ||
shortfall: 0, | ||
}, | ||
}, | ||
}, | ||
args: { | ||
details: { | ||
name: 'ardrive', | ||
intent: 'Buy-Record', | ||
type: 'permabuy', | ||
fromAddress: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
}, | ||
}, | ||
}; | ||
|
||
export const AnyDiscountBuyRecord: Story = { | ||
parameters: { | ||
discount: true, | ||
costDetail: { | ||
tokenCost: 10000000000, | ||
discounts: [ | ||
{ | ||
name: 'blah', | ||
discountTotal: 10000000000 / 2, | ||
multiplier: 1, | ||
}, | ||
], | ||
fundingPlan: { | ||
balance: 1000000000, | ||
address: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
stakes: { | ||
stake1: { | ||
delegatedStake: 4000000000, | ||
vaults: { | ||
vault1: 2500000000, | ||
vault2: 2500000000, | ||
}, | ||
}, | ||
}, | ||
shortfall: 0, | ||
}, | ||
}, | ||
}, | ||
args: { | ||
details: { | ||
name: 'ardrive', | ||
intent: 'Buy-Record', | ||
type: 'permabuy', | ||
fromAddress: '5Gru9gQCIiRaIPV7fU7RXcpaVShG4u9nIcPVmm2FJSM', | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.