Skip to content

Commit

Permalink
fix(@porrtal/r-shell-material): fix banner key and banner menu icons
Browse files Browse the repository at this point in the history
  • Loading branch information
datumgeek committed Dec 11, 2022
1 parent e84ab38 commit b40746f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions apps/n/porrtal-io-app/page-data/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ export const getAngularUiLibrary = (): string => {
return 'material';
}

export const getBannerData = (): BannerData => {
export const getBannerData = (reactUiLibrary: string): BannerData => {
const displayIcon = reactUiLibrary === 'blueprint' ? 'hurricane' : 'cyclone';
return {
displayText: 'porrtal.io',
displayIcon: 'hurricane',
displayIcon: displayIcon,
childData: [
{
key: 'porrtal.io',
displayIcon: 'hurricane',
displayIcon: displayIcon,
displayText: 'porrtal.io',
targetUrl: '/',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/n/porrtal-io-app/pages/react/quick-start/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function QuickStart(props: QuickStartProps) {
}, []);

const quickStartBannerData = {
...getBannerData(),
...getBannerData(reactUiLibrary),
displayText: `quick-start ${reactUiLibrary ? '(' : ''}${reactUiLibrary}${
reactUiLibrary ? ')' : ''
}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/n/porrtal-io-app/pages/react/samples/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function Samples(props: SamplesProps) {
}, []);

const quickStartBannerData = {
...getBannerData(),
...getBannerData(reactUiLibrary),
displayText: `samples ${reactUiLibrary ? '(' : ''}${reactUiLibrary}${
reactUiLibrary ? ')' : ''
}`,
Expand Down
2 changes: 1 addition & 1 deletion libs/porrtal/r-shell-material/src/lib/banner/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function BannerMenu(props: BannerProps & { children: ReactNode | undefined }) {
>
{props.bannerData.childData.map((menuItem) => (
<IconMenuItem
key={menuItem.displayText}
key={menuItem.key ?? menuItem.displayText}
leftIcon={
<>
{menuItem.displayIcon && <Icon>{menuItem.displayIcon}</Icon>}
Expand Down

0 comments on commit b40746f

Please sign in to comment.