-
+
+
{navIndex !== 0 && (
-
-
+
)}
{chunkedTabs[navIndex].map((tab, index) => (
-
))}
{hasNextNavIndex() && (
-
-
+
)}
-
+
- {chunkedTabs[navIndex].map((tab, index) => (
+ {currentIndex !== false ? (
+ chunkedTabs[navIndex].map((tab, index) => (
+
+ {tab.content}
+
+ ))
+ ) : (
+ // Render if the selected tab index is outside the current rendered chunked array
- {tab.content}
+ {chunkedTabs[value[0]][value[1]].content}
- ))}
+ )}
);
};
-
-export default Tabs;
diff --git a/packages/core/src/components/Tabs/index.ts b/packages/core/src/components/Tabs/index.ts
index 03995fe2ea..835ab5a8c3 100644
--- a/packages/core/src/components/Tabs/index.ts
+++ b/packages/core/src/components/Tabs/index.ts
@@ -14,4 +14,4 @@
* limitations under the License.
*/
-export { default } from './Tabs';
+export { Tabs as default } from './Tabs';
diff --git a/packages/core/src/components/Tabs/utils.ts b/packages/core/src/components/Tabs/utils.ts
index d3fa0dbd3e..3e0ab6f2c3 100644
--- a/packages/core/src/components/Tabs/utils.ts
+++ b/packages/core/src/components/Tabs/utils.ts
@@ -13,30 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { useState, useEffect } from 'react';
+import { TabProps } from './Tabs';
-export const chunkArray = (myArray: any[], chunkSize: number) => {
+export const chunkArray = (
+ myArray: TabProps[],
+ chunkSize: number,
+): TabProps[][] => {
const results = [];
while (myArray.length) {
results.push(myArray.splice(0, chunkSize));
}
return results;
};
-
-export const useWindowWidth = () => {
- const isClient = typeof window === 'object';
- const getWidth = () => (isClient ? window.innerWidth : undefined);
- const [windowWidth, setWindowWidth] = useState(getWidth);
-
- useEffect((): any => {
- if (!isClient) {
- return false;
- }
-
- const handleResize = () => setWindowWidth(getWidth());
-
- window.addEventListener('resize', handleResize);
- return () => window.removeEventListener('resize', handleResize);
- }, []);
- return windowWidth;
-};
diff --git a/packages/theme/src/themes.ts b/packages/theme/src/themes.ts
index 630e81c146..3071c0289e 100644
--- a/packages/theme/src/themes.ts
+++ b/packages/theme/src/themes.ts
@@ -62,7 +62,6 @@ export const lightTheme = createTheme({
},
tabbar: {
indicator: '#9BF0E1',
- background: '#FFFFFF',
},
},
});
@@ -112,7 +111,6 @@ export const darkTheme = createTheme({
},
tabbar: {
indicator: '#9BF0E1',
- background: '#424242',
},
},
});
diff --git a/packages/theme/src/types.ts b/packages/theme/src/types.ts
index 8d18caf4d1..fdb9e09869 100644
--- a/packages/theme/src/types.ts
+++ b/packages/theme/src/types.ts
@@ -46,7 +46,6 @@ type PaletteAdditions = {
sidebar: string;
tabbar: {
indicator: string;
- background: string;
};
bursts: {
fontColor: string;