disable errors tab in output for mobile

This commit is contained in:
vchikalkin 2024-07-02 18:12:29 +03:00
parent e9ca1cc752
commit 2ea1b1bd69
2 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ const Wrapper = styled(Background)`
}
`;
export const Output = observer(() => {
export const Output = observer(({ tabs }) => {
const { $results } = useStore();
const [activeKey, setActiveKey] = useState(undefined);
const { hasErrors } = useErrors();
@ -52,15 +52,15 @@ export const Output = observer(() => {
setActiveKey('payments-table');
}
if (hasErrors) {
if (!tabs && hasErrors) {
setActiveKey('validation');
}
}, [$results.payments.length, hasErrors]);
}, [$results.payments.length, hasErrors, tabs]);
return (
<Wrapper>
<Tabs
items={items}
items={tabs ? items.filter((x) => x.key !== 'validation') : items}
activeKey={activeKey}
onChange={(key) => {
setActiveKey(key);

View File

@ -58,7 +58,7 @@ export function Tabs({ tabs }) {
return tabs.map(({ Component, key }) => (
<Display key={key} visible={key === currentTab}>
<Component key={key} />
<Component key={key} tabs />
</Display>
));
}