Skip to content

Commit

Permalink
feat(n-porrtal-io-app): fix build errors and publish new version
Browse files Browse the repository at this point in the history
  • Loading branch information
datumgeek committed Dec 11, 2022
1 parent 871ffd2 commit e4975ad
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
6 changes: 4 additions & 2 deletions apps/n/porrtal-io-app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ import { ShellBlueprint } from '@porrtal/r-shell-blueprint';
import { useEffect, useState } from 'react';
import Head from 'next/head';
import styles from './index.module.scss';
import { getBannerData } from '../page-data/data';
import { getBannerData, getReactUiLibrary } from '../page-data/data';
import { porrtalIoViews } from '../page-data/porrtal-io-views';

export function Index() {
const [isSSR, setIsSSR] = useState(true);

const reactUiLibrary = isSSR ? '' : getReactUiLibrary();

useEffect(() => {
setIsSSR(false);
}, []);

const quickStartBannerData = {
...getBannerData(),
...getBannerData('blueprint'),
displayText: `porrtal.io`,
};

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/n/porrtal-io-app/public/angular/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<style>.mat-typography{font:400 14px/20px Roboto,sans-serif;letter-spacing:.0178571429em}html,body{height:100%}body{margin:0;font-family:Roboto,Helvetica Neue,sans-serif}</style><link rel="stylesheet" href="styles.0fa8aa483e2d1628.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.0fa8aa483e2d1628.css"></noscript></head>
<body class="mat-typography">
<porrtal-io-root></porrtal-io-root>
<script src="runtime.daa6717c403f30fb.js" type="module"></script><script src="polyfills.5411f381e8254a9c.js" type="module"></script><script src="scripts.14163a64b07b11bf.js" defer></script><script src="main.d5aca661681f4ef3.js" type="module"></script>
<script src="runtime.f641f46a36b75b4c.js" type="module"></script><script src="polyfills.5411f381e8254a9c.js" type="module"></script><script src="scripts.14163a64b07b11bf.js" defer></script><script src="main.d5aca661681f4ef3.js" type="module"></script>

</body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 14 additions & 18 deletions libs/porrtal/r-shell-material/src/lib/context-menu/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import React, {useState, forwardRef} from 'react';
import React, { useState, forwardRef } from 'react';
import Menu from '@mui/material/Menu';
import {MenuItemData, nestedMenuItemsFromObject} from 'mui-nested-menu';
import { MenuItemData, nestedMenuItemsFromObject } from 'mui-nested-menu';

export interface ContextMenuProps {
children?: React.ReactNode;
Expand All @@ -44,32 +44,28 @@ interface Position {
}

export const ContextMenu = forwardRef<HTMLDivElement, ContextMenuProps>(
({children, menuItems, menuItemsData}, ref) => {
({ children, menuItemsData }, ref) => {
const [menuPosition, setMenuPosition] = useState<Position | null>(null);

const handleItemClick = () => setMenuPosition(null);

const handleContextMenu = (e: React.MouseEvent) => {
e.preventDefault();
setMenuPosition({top: e.clientY, left: e.clientX});
}
setMenuPosition({ top: e.clientY, left: e.clientX });
};

const menuContents =
menuItems ??
(menuItemsData &&
nestedMenuItemsFromObject({
menuItemsData: menuItemsData,
isOpen: !!menuPosition,
handleClose: handleItemClick,
}));
menuItemsData &&
nestedMenuItemsFromObject({
menuItemsData: menuItemsData,
isOpen: !!menuPosition,
handleClose: handleItemClick,
});

return (
<div
ref={ref}
onContextMenu={handleContextMenu}
>
<div ref={ref} onContextMenu={handleContextMenu}>
<Menu
onContextMenu={e => e.preventDefault()}
onContextMenu={(e) => e.preventDefault()}
open={!!menuPosition}
onClose={() => setMenuPosition(null)}
anchorReference="anchorPosition"
Expand All @@ -80,7 +76,7 @@ export const ContextMenu = forwardRef<HTMLDivElement, ContextMenuProps>(
{children}
</div>
);
},
}
);

ContextMenu.displayName = 'ContextMenu';

0 comments on commit e4975ad

Please sign in to comment.