Skip to content

Commit

Permalink
default lib name react
Browse files Browse the repository at this point in the history
  • Loading branch information
BipanKishore committed May 18, 2024
1 parent 7982e15 commit 24dbd59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions packages/demo-app/src/components/demo-header/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -33,7 +27,13 @@ export const getDetailsByLib = () => {
npmLink,
libType
}
default:
return {
libName,
title: getTitle(`React`),
npmLink,
libType
}
}

return {}
}
6 changes: 3 additions & 3 deletions packages/demo-app/src/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { getDetailsByLib } from '../demo-header/utils'
const Header = () => {
const { title, npmLink, libType } = getDetailsByLib()
return (
<div className='header bg-gray-100 leading-9 p-1.5 mt-5 mb-10 rounded-xl py-3 px-2.5 top-0 z-40'>
<div className='header bg-gray-100 leading-9 mt-5 mb-10 rounded-xl py-2.5 px-2.5 top-0 z-40'>
<div className='md:grid md:grid-cols-3'>
<div />
<h2 className='m0 text-center text-3xl'>{title}</h2>

<div className='grid place-center md:mt-0 mt-4'>
<div className='grid place-center md:mt-1.5 mt-4'>
<Links selectedLib={libType} npmLink={npmLink} className='flex md:mr-2' />
</div>
</div>
</div>
</div>
)
Expand Down

0 comments on commit 24dbd59

Please sign in to comment.