Skip to content

Commit

Permalink
feat(global): change onBackground to isOnBackground
Browse files Browse the repository at this point in the history
  • Loading branch information
mtorres3 committed Oct 25, 2023
1 parent c704a74 commit 23bbd23
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const FullWidth = {
),
};

export const OnBackground = {
export const isOnBackground = {
render: () => (
<div
style={{
Expand All @@ -195,7 +195,7 @@ export const OnBackground = {
>
A menu on background
</PharosButton>
<PharosDropdownMenu id="my-menu-on-background" show-selected on-background>
<PharosDropdownMenu id="my-menu-on-background" show-selected is-on-background>
<PharosDropdownMenuItem selected>Item One</PharosDropdownMenuItem>
<PharosDropdownMenuItem>Item Two</PharosDropdownMenuItem>
<PharosDropdownMenuItem disabled>Item Three</PharosDropdownMenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class PharosDropdownMenuItem extends ScopedRegistryMixin(FocusMixin(Pharo
* @attr is-on-background
*/
@property({ type: Boolean, reflect: true, attribute: 'is-on-background' })
public onBackground = false;
public isOnBackground = false;

@state()
private _first = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class PharosDropdownMenu extends ScopedRegistryMixin(FocusMixin(OverlayEl
* @attr is-on-background
*/
@property({ type: Boolean, reflect: true, attribute: 'is-on-background' })
public onBackground = false;
public isOnBackground = false;

@state()
private _navMenu = false;
Expand Down Expand Up @@ -268,9 +268,9 @@ export class PharosDropdownMenu extends ScopedRegistryMixin(FocusMixin(OverlayEl
top: `${y}px`,
});
});
if (this.onBackground) {
if (this.isOnBackground) {
this._allMenuItems.forEach((menuItem) => {
menuItem.onBackground = true;
menuItem.isOnBackground = true;
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const FullWidth = {
},
};

export const OnBackground = {
export const isOnBackground = {
render: () => {
const effect = () => {
useEffect(() => {
Expand All @@ -197,7 +197,7 @@ export const OnBackground = {
>
A menu on background
</storybook-pharos-button>
<storybook-pharos-dropdown-menu id="my-menu-on-background" show-selected on-background>
<storybook-pharos-dropdown-menu id="my-menu-on-background" show-selected is-on-background>
<storybook-pharos-dropdown-menu-item selected>
Item One
</storybook-pharos-dropdown-menu-item>
Expand Down
2 changes: 1 addition & 1 deletion packages/pharos/src/components/dropdown-menu/storyArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ export const defaultArgs = {
open: false,
showSelected: false,
fullWidth: false,
onBackground: false,
isOnBackground: false,
};

0 comments on commit 23bbd23

Please sign in to comment.