gristlabs_grist-core/app/client/ui/FieldMenus.ts
Arnaud Peich 79deeca640
Make a good part of the app localizable and add French translations (#325)
Co-authored-by: Yohan Boniface <yohanboniface@free.fr>
2022-10-28 09:11:08 -07:00

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'})),
]
];
}