From 2ea1b1bd69f7f01d70316e61b44342f77bfa2ca6 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 2 Jul 2024 18:12:29 +0300 Subject: [PATCH] disable errors tab in output for mobile --- apps/web/Components/Calculation/Output/index.jsx | 8 ++++---- apps/web/Components/Layout/Navigation.jsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/Components/Calculation/Output/index.jsx b/apps/web/Components/Calculation/Output/index.jsx index 7b80501..9624b08 100644 --- a/apps/web/Components/Calculation/Output/index.jsx +++ b/apps/web/Components/Calculation/Output/index.jsx @@ -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 ( x.key !== 'validation') : items} activeKey={activeKey} onChange={(key) => { setActiveKey(key); diff --git a/apps/web/Components/Layout/Navigation.jsx b/apps/web/Components/Layout/Navigation.jsx index b4655aa..d692878 100644 --- a/apps/web/Components/Layout/Navigation.jsx +++ b/apps/web/Components/Layout/Navigation.jsx @@ -58,7 +58,7 @@ export function Tabs({ tabs }) { return tabs.map(({ Component, key }) => ( - + )); }