2023-09-02 00:00:11 +00:00
|
|
|
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
2023-08-22 09:17:10 +00:00
|
|
|
import { usePositionsStore } from '../positions-container';
|
2023-11-16 03:10:39 +00:00
|
|
|
import { useT } from '../../lib/use-t';
|
2023-08-22 09:17:10 +00:00
|
|
|
|
|
|
|
export const PositionsMenu = () => {
|
2023-11-16 03:10:39 +00:00
|
|
|
const t = useT();
|
2023-08-22 09:17:10 +00:00
|
|
|
const showClosed = usePositionsStore((store) => store.showClosedMarkets);
|
|
|
|
const toggle = usePositionsStore((store) => store.toggleClosedMarkets);
|
|
|
|
return (
|
|
|
|
<TradingButton
|
|
|
|
size="extra-small"
|
|
|
|
data-testid="open-transfer"
|
|
|
|
onClick={toggle}
|
|
|
|
>
|
|
|
|
{showClosed ? t('Hide closed markets') : t('Show closed markets')}
|
|
|
|
</TradingButton>
|
|
|
|
);
|
|
|
|
};
|