2020-07-03 23:32:39 +02:00
|
|
|
import { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
|
2020-10-09 19:35:46 +02:00
|
|
|
import { _ } from 'lib/locale';
|
2020-07-03 23:32:39 +02:00
|
|
|
|
|
|
|
export const declaration:CommandDeclaration = {
|
|
|
|
name: 'toggleSidebar',
|
|
|
|
label: () => _('Toggle sidebar'),
|
|
|
|
iconName: 'fa-bars',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const runtime = (comp:any):CommandRuntime => {
|
|
|
|
return {
|
|
|
|
execute: async () => {
|
|
|
|
comp.props.dispatch({
|
|
|
|
type: 'SIDEBAR_VISIBILITY_TOGGLE',
|
|
|
|
});
|
|
|
|
},
|
2020-07-04 11:33:04 +02:00
|
|
|
title: () => {
|
|
|
|
return _('Toggle sidebar');
|
|
|
|
},
|
2020-07-03 23:32:39 +02:00
|
|
|
};
|
|
|
|
};
|