Skip to content

Commit

Permalink
feat(parser): Add ButtonCardView
Browse files Browse the repository at this point in the history
  • Loading branch information
jonz94 committed Dec 11, 2024
1 parent 5f233ae commit a830f77
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/parser/classes/ButtonCardView.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import NavigationEndpoint from './NavigationEndpoint.js';
import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';

export default class ButtonCardView extends YTNode {
static type = 'ButtonCardView';

title: string;
icon_name: string;
on_tap_endpoint: NavigationEndpoint;

constructor(data: RawNode) {
super();
this.title = data.title;
this.icon_name = data.icon.sources[0].clientResource.imageName;
this.on_tap_endpoint = new NavigationEndpoint(data.rendererContext.commandContext.onTap);
}
}
1 change: 1 addition & 0 deletions src/parser/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export { default as BadgeView } from './classes/BadgeView.js';
export { default as BrowseFeedActions } from './classes/BrowseFeedActions.js';
export { default as BrowserMediaSession } from './classes/BrowserMediaSession.js';
export { default as Button } from './classes/Button.js';
export { default as ButtonCardView } from './classes/ButtonCardView.js';
export { default as ButtonView } from './classes/ButtonView.js';
export { default as C4TabbedHeader } from './classes/C4TabbedHeader.js';
export { default as CallToActionButton } from './classes/CallToActionButton.js';
Expand Down

0 comments on commit a830f77

Please sign in to comment.