mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
32 lines
876 B
TypeScript
32 lines
876 B
TypeScript
import * as React from 'react';
|
|
|
|
import { _ } from '@joplin/lib/locale';
|
|
import ToolbarButton from './ToolbarButton';
|
|
import { ButtonSpec, StyleSheetData } from './types';
|
|
|
|
type OnToggleOverflowCallback = ()=> void;
|
|
interface ToggleOverflowButtonProps {
|
|
overflowVisible: boolean;
|
|
onToggleOverflowVisible: OnToggleOverflowCallback;
|
|
styleSheet: StyleSheetData;
|
|
}
|
|
|
|
// Button that shows/hides the overflow menu.
|
|
const ToggleOverflowButton: React.FC<ToggleOverflowButtonProps> = (props: ToggleOverflowButtonProps) => {
|
|
const spec: ButtonSpec = {
|
|
icon: 'material dots-horizontal',
|
|
description:
|
|
props.overflowVisible ? _('Hide more actions') : _('Show more actions'),
|
|
active: props.overflowVisible,
|
|
onPress: props.onToggleOverflowVisible,
|
|
};
|
|
|
|
return (
|
|
<ToolbarButton
|
|
styleSheet={props.styleSheet}
|
|
spec={spec}
|
|
/>
|
|
);
|
|
};
|
|
export default ToggleOverflowButton;
|