-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ToggleMenuServiceItem): parse default nav endpoint
- Loading branch information
Showing
3 changed files
with
13 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import Text from './misc/Text.js'; | ||
import NavigationEndpoint from './NavigationEndpoint.js'; | ||
import { YTNode } from '../helpers.js'; | ||
import type { RawNode } from '../index.js'; | ||
|
||
class ToggleMenuServiceItem extends YTNode { | ||
export default class ToggleMenuServiceItem extends YTNode { | ||
static type = 'ToggleMenuServiceItem'; | ||
|
||
text: Text; | ||
toggled_text: Text; | ||
icon_type: string; | ||
toggled_icon_type: string; | ||
endpoint: NavigationEndpoint; | ||
default_endpoint: NavigationEndpoint; | ||
toggled_endpoint: NavigationEndpoint; | ||
|
||
constructor(data: any) { | ||
constructor(data: RawNode) { | ||
super(); | ||
this.text = new Text(data.defaultText); | ||
this.toggled_text = new Text(data.toggledText); | ||
this.icon_type = data.defaultIcon.iconType; | ||
this.toggled_icon_type = data.toggledIcon.iconType; | ||
this.endpoint = new NavigationEndpoint(data.toggledServiceEndpoint); | ||
this.default_endpoint = new NavigationEndpoint(data.defaultServiceEndpoint); | ||
this.toggled_endpoint = new NavigationEndpoint(data.toggledServiceEndpoint); | ||
} | ||
} | ||
|
||
export default ToggleMenuServiceItem; | ||
} |
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