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 [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);
|
||||
|
||||
@ -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>
|
||||
));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user