2020-06-30 11:47:21 -07:00
|
|
|
import * as ViewModels from "../../Contracts/ViewModels";
|
2020-07-15 13:58:43 -07:00
|
|
|
import { GalleryAndNotebookViewerComponentProps } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponent";
|
|
|
|
import { GalleryAndNotebookViewerComponentAdapter } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponentAdapter";
|
|
|
|
import { GalleryTab as GalleryViewerTab, SortBy } from "../Controls/NotebookGallery/GalleryViewerComponent";
|
2020-06-30 11:47:21 -07:00
|
|
|
import TabsBase from "./TabsBase";
|
2020-05-25 21:30:55 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notebook gallery tab
|
|
|
|
*/
|
|
|
|
export default class GalleryTab extends TabsBase implements ViewModels.Tab {
|
|
|
|
private container: ViewModels.Explorer;
|
2020-07-15 13:58:43 -07:00
|
|
|
public galleryAndNotebookViewerComponentAdapter: GalleryAndNotebookViewerComponentAdapter;
|
2020-05-25 21:30:55 -05:00
|
|
|
|
|
|
|
constructor(options: ViewModels.GalleryTabOptions) {
|
|
|
|
super(options);
|
2020-06-30 11:47:21 -07:00
|
|
|
|
2020-05-25 21:30:55 -05:00
|
|
|
this.container = options.container;
|
2020-07-15 13:58:43 -07:00
|
|
|
const props: GalleryAndNotebookViewerComponentProps = {
|
2020-06-30 11:47:21 -07:00
|
|
|
container: options.container,
|
|
|
|
junoClient: options.junoClient,
|
|
|
|
notebookUrl: options.notebookUrl,
|
|
|
|
galleryItem: options.galleryItem,
|
|
|
|
isFavorite: options.isFavorite,
|
|
|
|
selectedTab: GalleryViewerTab.OfficialSamples,
|
|
|
|
sortBy: SortBy.MostViewed,
|
|
|
|
searchText: undefined
|
|
|
|
};
|
2020-05-25 21:30:55 -05:00
|
|
|
|
2020-07-15 13:58:43 -07:00
|
|
|
this.galleryAndNotebookViewerComponentAdapter = new GalleryAndNotebookViewerComponentAdapter(props);
|
2020-05-25 21:30:55 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
protected getContainer(): ViewModels.Explorer {
|
|
|
|
return this.container;
|
|
|
|
}
|
|
|
|
}
|