vega-frontend-monorepo/libs/accounts/.storybook/preview.js
m.ray 907a4e256e
feat(): collateral table, add breakdown ()
* feat:  show progress bar, margin accounts, no used/deposited

* feat:  add collateral tables

* fix:  add deposit asset type and fix tests

* feat:  show deposited value, avaliable and percentage used

* fix:  add styling fixes

* fix:  add deposit new asset button

* fix:  remove disabledSelect
to fix withdraw and deposit dialogs

* fix:  remove global reward from incoming - needs to be party specific

* fix:  integration tests

* fix:  default select deposit & withdraw

* fix:  default select deposit & withdraw

* fix:  pass asset id as default value

* fix:   use only bigint no bignumber, remove NaN check

* fix:   update deposit-form.spec.tsx

* fix: revert update on account fields

* feat: add storybook set up

* chore: ignore apollo errors - to be reverted after API will be fixed

* fix: container moved, progress bar in helpers

* fix:  UI tweaks around accounts container

* feat:  added useDepositAsset and useWithdrawAsset

* fix:  fix progress bar in accounts and positions

* feat:  add storybook

* fix:  added tooltip and updated filtering

* chore:  add get account data test

* fix:  fix lint and type in account story

* fix:   update data provider

* fix:  fix get account data dry & lp link

* fix:  fix breakdown table test

* fix:  account data provider test

* fix:  remove deposit new asset button - subscription does not display a
sset data

* fix:  add defaultValue in select otherwise default is not set up

* feat:  update data provider update method and tables

* fix:  fix accounts tests

* fix:  remove unused getRows

* fix: add decimals

* fix:  fix imports

* fix: update ids

* Update apps/trading/pages/liquidity/[marketId].page.tsx

* fix:  accounts update method check delta

* fix:  use vega value formatters and cell renderers

* fix:  fix imports

* fix:  handle new account else block comment

* fix: accounts and breakdown tables

* fix(): account data provider improvments

* fix:  fix formatters null check and add param

* fix:  fix withdraw test and mock the hook

* fix:  fix console lite grid select market test

* fix: console lite build

* fix: revert withdraw limits

* fix: remove redundant waitFor use vega cell renderer

* fix: breakdown display only use accounts

* fix: breakdown display only use accounts

* fix: updated accounts table

* fix: move update inside try useWithdrawAsset

* fix: update trading-accounts test

* fix: portfolio-page.test.ts

Co-authored-by: Bartłomiej Głownia <bglownia@gmail.com>
2022-09-29 17:40:44 -07:00

51 lines
1.3 KiB
JavaScript

import './styles.scss';
import { ThemeContext } from '@vegaprotocol/react-helpers';
import { useEffect, useState } from 'react';
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
backgrounds: { disable: true },
themes: {
default: 'dark',
list: [
{ name: 'dark', class: ['dark', 'bg-black'], color: '#000' },
{ name: 'light', class: '', color: '#FFF' },
],
},
};
export const decorators = [
(Story, context) => {
// storybook-addon-themes doesn't seem to provide the current selected
// theme in context, we need to provide it in JS as some components
// rely on it for rendering
const [theme, setTheme] = useState(context.parameters.themes.default);
useEffect(() => {
const observer = new MutationObserver((mutationList) => {
if (mutationList.length) {
const body = mutationList[0].target;
if (body.classList.contains('dark')) {
setTheme('dark');
} else {
setTheme('light');
}
}
});
observer.observe(document.body, { attributes: true });
return () => {
observer.disconnect();
};
}, []);
return (
<div style={{ width: '100%', height: 500 }}>
<ThemeContext.Provider value={theme}>
<Story />
</ThemeContext.Provider>
</div>
);
},
];