modaq
Version:
Quiz Bowl Reader using TypeScript, React, and MobX
56 lines • 3.19 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomizeGameFormatDialog = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const React = __importStar(require("react"));
const mobx_react_lite_1 = require("mobx-react-lite");
const react_1 = require("@fluentui/react");
const CustomizeGameFormatDialogController = __importStar(require("./CustomGameFormatDialogController"));
require("../../state/AppState");
const StateContext_1 = require("../../contexts/StateContext");
const ModalVisibilityStatus_1 = require("../../state/ModalVisibilityStatus");
const ModalDialog_1 = require("./ModalDialog");
const CustomizeGameFormatForm_1 = require("../CustomizeGameFormatForm");
const content = {
type: react_1.DialogType.normal,
title: "Customize Game Format",
closeButtonAriaLabel: "Close",
showCloseButton: true,
styles: {
innerContent: {
display: "flex",
flexDirection: "column",
marginBottom: 30,
},
},
};
// TODO: Look into making a DefaultDialog, which handles the footers and default props
exports.CustomizeGameFormatDialog = mobx_react_lite_1.observer(function CustomizeGameFormatDialog() {
const appState = React.useContext(StateContext_1.StateContext);
if (appState.uiState.dialogState.customizeGameFormat == undefined) {
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
}
return (jsx_runtime_1.jsxs(ModalDialog_1.ModalDialog, Object.assign({ title: "Customize Game Format", visibilityStatus: ModalVisibilityStatus_1.ModalVisibilityStatus.CustomizeGameFormat, dialogContentProps: content, onDismiss: CustomizeGameFormatDialogController.cancel }, { children: [jsx_runtime_1.jsx(CustomizeGameFormatForm_1.CustomizeGameFormatForm, { state: appState.uiState.dialogState.customizeGameFormat }, void 0),
jsx_runtime_1.jsxs(react_1.DialogFooter, { children: [jsx_runtime_1.jsx(react_1.PrimaryButton, { text: "Save", onClick: CustomizeGameFormatDialogController.submit }, void 0),
jsx_runtime_1.jsx(react_1.DefaultButton, { text: "Cancel", onClick: CustomizeGameFormatDialogController.cancel }, void 0)] }, void 0)] }), void 0));
});
//# sourceMappingURL=CustomizeGameFormatDialog.js.map