diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..44eced6 --- /dev/null +++ b/.npmignore @@ -0,0 +1,6 @@ +example/ +node_modules/ +src/ +.editorconfig +tsconfig.json +yarn.lock diff --git a/package.json b/package.json index 2c514f9..9c956e9 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,30 @@ { - "version": "0.1.1", + "version": "0.2.0", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", "files": [ - "dist", - "src" + "dist" ], + "publishing": { + "github": { + "repository": "https://github.com/TheoryOfNekomata/viewfinder.git", + "publishConfig": { + "registry": "https://npm.pkg.github.com" + } + }, + "master": { + "repository": "https://code.modal.sh/TheoryOfNekomata/viewfinder.git", + "publishConfig": { + "registry": "https://js.pack.modal.sh" + } + }, + "npm": { + "publishConfig": { + "registry": "https://registry.npmjs.com" + } + } + }, "engines": { "node": ">=10" }, @@ -28,7 +46,7 @@ "pre-commit": "tsdx lint" } }, - "name": "@tesseract-design/viewfinder", + "name": "@theoryofnekomata/viewfinder", "description": "Layout scaffolding for Web apps.", "author": "TheoryOfNekomata ", "module": "dist/viewfinder.esm.js", diff --git a/src/index.tsx b/src/index.ts similarity index 100% rename from src/index.tsx rename to src/index.ts diff --git a/src/layouts/LeftSidebarWithMenu/index.tsx b/src/layouts/LeftSidebarWithMenu/index.tsx index 78bb516..421c3e8 100644 --- a/src/layouts/LeftSidebarWithMenu/index.tsx +++ b/src/layouts/LeftSidebarWithMenu/index.tsx @@ -296,7 +296,7 @@ export type MenuItem = BaseMenuItem & { type Props = { brand?: React.ReactNode, - sidebarMain: React.ReactChild, + sidebarMain?: React.ReactChild, sidebarMainOpen?: boolean, sidebarMenuItems: MenuItem[], moreItemsOpen?: boolean, @@ -353,7 +353,7 @@ export const Layout: React.FC = ({ {topBarCenter} @@ -404,13 +404,21 @@ export const Layout: React.FC = ({ - - - - - + { + ( + morePrimarySidebarMenuItems.length > 0 + || moreSecondarySidebarMenuItems.length > 0 + ) + && ( + + + + + + ) + } { visibleSecondarySidebarMenuItems.length > 0 && ( @@ -429,9 +437,14 @@ export const Layout: React.FC = ({ } - - {sidebarMain} - + { + (sidebarMain as unknown) + && ( + + {sidebarMain} + + ) + } {children}