Files
gas-react-sheets/src/server/ui.js
T
Pencho BELNEYSKI 4718f4b870 add initial support for tailwindcss (#134)
Add support for and demo using tailwindcss
2022-11-17 23:37:00 -05:00

37 lines
1.2 KiB
JavaScript

export const onOpen = () => {
const menu = SpreadsheetApp.getUi()
.createMenu('My Sample React Project') // edit me!
.addItem('Sheet Editor', 'openDialog')
.addItem('Sheet Editor (Bootstrap)', 'openDialogBootstrap')
.addItem('Sheet Editor (Tailwind CSS)', 'openDialogTailwindCSS')
.addItem('About me', 'openAboutSidebar');
menu.addToUi();
};
export const openDialog = () => {
const html = HtmlService.createHtmlOutputFromFile('dialog-demo')
.setWidth(600)
.setHeight(600);
SpreadsheetApp.getUi().showModalDialog(html, 'Sheet Editor');
};
export const openDialogBootstrap = () => {
const html = HtmlService.createHtmlOutputFromFile('dialog-demo-bootstrap')
.setWidth(600)
.setHeight(600);
SpreadsheetApp.getUi().showModalDialog(html, 'Sheet Editor (Bootstrap)');
};
export const openDialogTailwindCSS = () => {
const html = HtmlService.createHtmlOutputFromFile('dialog-demo-tailwindcss')
.setWidth(600)
.setHeight(600);
SpreadsheetApp.getUi().showModalDialog(html, 'Sheet Editor (Tailwind CSS)');
};
export const openAboutSidebar = () => {
const html = HtmlService.createHtmlOutputFromFile('sidebar-about-page');
SpreadsheetApp.getUi().showSidebar(html);
};