-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from GuiLeme/set-display-navbar
feat(plugin): Add new ui-command to display nav-bar
- Loading branch information
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { NavBarEnum } from './enums'; | ||
import { SetDisplayNavBarCommandArguments } from './types'; | ||
|
||
export const navBar = { | ||
/** | ||
* Sets the displayNavBar to true (show it) or false (hide it). | ||
* | ||
* @param setDisplayNavBarCommandArguments: object with a boolean that tells whether to display | ||
* the navbar | ||
*/ | ||
setDisplayNavBar: (setDisplayNavBarCommandArguments: SetDisplayNavBarCommandArguments) => { | ||
const { displayNavBar } = setDisplayNavBarCommandArguments; | ||
window.dispatchEvent( | ||
new CustomEvent< | ||
SetDisplayNavBarCommandArguments | ||
>(NavBarEnum.SET_DISPLAY_NAV_BAR, { | ||
detail: { | ||
displayNavBar, | ||
}, | ||
}), | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum NavBarEnum { | ||
SET_DISPLAY_NAV_BAR = 'SET_DISPLAY_NAV_BAR_COMMAND', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface SetDisplayNavBarCommandArguments { | ||
displayNavBar: boolean; | ||
} | ||
|
||
export interface UiCommandsNavBarObject { | ||
setDisplayNavBar: (setDisplayNavBarCommandArguments: SetDisplayNavBarCommandArguments) => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters