UNPKG

@jbrowse/plugin-linear-genome-view

Version:

JBrowse 2 linear genome view

29 lines (28 loc) 1.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const ui_1 = require("@jbrowse/core/ui"); const material_1 = require("@mui/material"); const mobx_react_1 = require("mobx-react"); const mui_1 = require("tss-react/mui"); const useStyles = (0, mui_1.makeStyles)()({ root: { width: 500, }, }); const SetMaxHeightDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) { const { classes } = useStyles(); const { maxHeight = '' } = model; const [max, setMax] = (0, react_1.useState)(`${maxHeight}`); const ok = max !== '' && !Number.isNaN(+max); return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Set max height", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { className: classes.root, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Set max height for the track. For example, you can increase this if the layout says \"Max height reached\"" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { value: max, onChange: event => { setMax(event.target.value); }, placeholder: "Enter max score" }), !ok ? (0, jsx_runtime_1.jsx)("div", { style: { color: 'red' }, children: "Invalid number" }) : null] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, disabled: !ok, onClick: () => { model.setMaxHeight(+max); handleClose(); }, children: "Submit" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => { handleClose(); }, children: "Cancel" })] })] })); }); exports.default = SetMaxHeightDialog;