2023-08-08 16:50:51 +02:00
|
|
|
|
|
|
|
import * as React from 'react';
|
|
|
|
import Button, { ButtonLevel } from '../../Button/Button';
|
|
|
|
import { _ } from '@joplin/lib/locale';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
onClick: ()=> void;
|
|
|
|
advancedSettingsVisible: boolean;
|
2024-08-02 15:49:15 +02:00
|
|
|
'aria-controls': string;
|
2023-08-08 16:50:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const ToggleAdvancedSettingsButton: React.FunctionComponent<Props> = props => {
|
|
|
|
const iconName = props.advancedSettingsVisible ? 'fa fa-angle-down' : 'fa fa-angle-right';
|
|
|
|
return (
|
|
|
|
<div style={{ marginBottom: 10 }}>
|
|
|
|
<Button
|
|
|
|
level={ButtonLevel.Secondary}
|
|
|
|
onClick={props.onClick}
|
|
|
|
iconName={iconName}
|
2024-08-02 15:49:15 +02:00
|
|
|
|
|
|
|
aria-controls={props['aria-controls']}
|
|
|
|
aria-expanded={props.advancedSettingsVisible}
|
|
|
|
|
2023-08-08 16:50:51 +02:00
|
|
|
title={_('Show Advanced Settings')}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
export default ToggleAdvancedSettingsButton;
|