disable errors tab in output for mobile
This commit is contained in:
parent
e9ca1cc752
commit
2ea1b1bd69
@ -42,7 +42,7 @@ const Wrapper = styled(Background)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const Output = observer(() => {
|
export const Output = observer(({ tabs }) => {
|
||||||
const { $results } = useStore();
|
const { $results } = useStore();
|
||||||
const [activeKey, setActiveKey] = useState(undefined);
|
const [activeKey, setActiveKey] = useState(undefined);
|
||||||
const { hasErrors } = useErrors();
|
const { hasErrors } = useErrors();
|
||||||
@ -52,15 +52,15 @@ export const Output = observer(() => {
|
|||||||
setActiveKey('payments-table');
|
setActiveKey('payments-table');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasErrors) {
|
if (!tabs && hasErrors) {
|
||||||
setActiveKey('validation');
|
setActiveKey('validation');
|
||||||
}
|
}
|
||||||
}, [$results.payments.length, hasErrors]);
|
}, [$results.payments.length, hasErrors, tabs]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<Tabs
|
<Tabs
|
||||||
items={items}
|
items={tabs ? items.filter((x) => x.key !== 'validation') : items}
|
||||||
activeKey={activeKey}
|
activeKey={activeKey}
|
||||||
onChange={(key) => {
|
onChange={(key) => {
|
||||||
setActiveKey(key);
|
setActiveKey(key);
|
||||||
|
|||||||
@ -58,7 +58,7 @@ export function Tabs({ tabs }) {
|
|||||||
|
|
||||||
return tabs.map(({ Component, key }) => (
|
return tabs.map(({ Component, key }) => (
|
||||||
<Display key={key} visible={key === currentTab}>
|
<Display key={key} visible={key === currentTab}>
|
||||||
<Component key={key} />
|
<Component key={key} tabs />
|
||||||
</Display>
|
</Display>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user