mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
79deeca640
Co-authored-by: Yohan Boniface <yohanboniface@free.fr>
23 lines
860 B
TypeScript
23 lines
860 B
TypeScript
import {makeT} from 'app/client/lib/localization';
|
|
import {menuItem, menuSubHeader} from 'app/client/ui2018/menus';
|
|
import {dom} from 'grainjs';
|
|
|
|
interface IFieldOptions {
|
|
useSeparate: () => void;
|
|
saveAsCommon: () => void;
|
|
revertToCommon: () => void;
|
|
}
|
|
|
|
const t = makeT('FieldMenus');
|
|
|
|
export function FieldSettingsMenu(useColOptions: boolean, disableSeparate: boolean, actions: IFieldOptions) {
|
|
useColOptions = useColOptions || disableSeparate;
|
|
return [
|
|
menuSubHeader(t('UsingSettings', {context: useColOptions ? 'common' : 'separate'})),
|
|
useColOptions ? menuItem(actions.useSeparate, t('Settings', {context: 'useseparate'}), dom.cls('disabled', disableSeparate)) : [
|
|
menuItem(actions.saveAsCommon, t('Settings', {context: 'savecommon'})),
|
|
menuItem(actions.revertToCommon, t('Settings', {context: 'revertcommon'})),
|
|
]
|
|
];
|
|
}
|