From 24dbd593d3015b3637b93155105a61ca629e26ff Mon Sep 17 00:00:00 2001 From: BipanKishore Date: Sat, 18 May 2024 14:51:55 +0530 Subject: [PATCH] default lib name react --- .../src/components/demo-header/utils.ts | 18 +++++++++--------- .../demo-app/src/components/header/index.tsx | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/demo-app/src/components/demo-header/utils.ts b/packages/demo-app/src/components/demo-header/utils.ts index e6c5379..2716a77 100644 --- a/packages/demo-app/src/components/demo-header/utils.ts +++ b/packages/demo-app/src/components/demo-header/utils.ts @@ -5,20 +5,14 @@ export const js = 'js' export const next = 'next' export const getDetailsByLib = () => { - const libType = getLibName() + const libType = getLibName() ?? react + const npmLink = `https://www.npmjs.com/package/resizable-panes-${libType}` const libName = `resizable-panes-${libType}` const getTitle = (type: string) => `Resizable Panes ${type}` switch (libType) { - case react: - return { - libName, - title: getTitle(`React`), - npmLink, - libType - } case js: return { libName, @@ -33,7 +27,13 @@ export const getDetailsByLib = () => { npmLink, libType } + default: + return { + libName, + title: getTitle(`React`), + npmLink, + libType + } } - return {} } \ No newline at end of file diff --git a/packages/demo-app/src/components/header/index.tsx b/packages/demo-app/src/components/header/index.tsx index 306a9a8..be38a3d 100644 --- a/packages/demo-app/src/components/header/index.tsx +++ b/packages/demo-app/src/components/header/index.tsx @@ -8,14 +8,14 @@ import { getDetailsByLib } from '../demo-header/utils' const Header = () => { const { title, npmLink, libType } = getDetailsByLib() return ( -
+

{title}

-
+
-
+
)