Ver a proveniência

Republish package, fix left sidebar layout

Use `@theoryofnekomata` scope to publish package on different
registries.

The "More" logic in LeftSidebarWithMenu logic has been updated to only
show when more sidebar items are visible.
master
TheoryOfNekomata há 3 anos
ascendente
cometimento
f6a9a56abb
4 ficheiros alterados com 53 adições e 16 eliminações
  1. +6
    -0
      .npmignore
  2. +22
    -4
      package.json
  3. +0
    -0
      src/index.ts
  4. +25
    -12
      src/layouts/LeftSidebarWithMenu/index.tsx

+ 6
- 0
.npmignore Ver ficheiro

@@ -0,0 +1,6 @@
example/
node_modules/
src/
.editorconfig
tsconfig.json
yarn.lock

+ 22
- 4
package.json Ver ficheiro

@@ -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 <allan.crisostomo@outlook.com>",
"module": "dist/viewfinder.esm.js",


src/index.tsx → src/index.ts Ver ficheiro


+ 25
- 12
src/layouts/LeftSidebarWithMenu/index.tsx Ver ficheiro

@@ -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<Props> = ({
<TopBar
wide
brand={brand}
menuLink={menuLink}
menuLink={sidebarMain ? menuLink : undefined}
userLink={userLink}
>
{topBarCenter}
@@ -404,13 +404,21 @@ export const Layout: React.FC<Props> = ({
</MoreSecondarySidebarMenuGroup>
</MoreItemsScroll>
</MoreItemsComponent>
<MoreToggleSidebarMenuItem>
<SidebarMenuItem>
<LinkComponent
{...moreLinkMenuItem}
/>
</SidebarMenuItem>
</MoreToggleSidebarMenuItem>
{
(
morePrimarySidebarMenuItems.length > 0
|| moreSecondarySidebarMenuItems.length > 0
)
&& (
<MoreToggleSidebarMenuItem>
<SidebarMenuItem>
<LinkComponent
{...moreLinkMenuItem}
/>
</SidebarMenuItem>
</MoreToggleSidebarMenuItem>
)
}
{
visibleSecondarySidebarMenuItems.length > 0
&& (
@@ -429,9 +437,14 @@ export const Layout: React.FC<Props> = ({
}
</SidebarMenuSize>
</SidebarMenu>
<SidebarMainComponent>
{sidebarMain}
</SidebarMainComponent>
{
(sidebarMain as unknown)
&& (
<SidebarMainComponent>
{sidebarMain}
</SidebarMainComponent>
)
}
</SidebarBase>
<ContentBase>
{children}


Carregando…
Cancelar
Guardar