2020-08-13 18:57:00 +02:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { FormField } from 'component/common/form';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
toTrayWhenClosed: boolean,
|
2021-08-05 10:41:45 +02:00
|
|
|
setToTrayWhenClosed: (boolean) => void,
|
|
|
|
noLabels?: boolean,
|
2020-08-13 18:57:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function SettingClosingBehavior(props: Props) {
|
2021-08-05 10:41:45 +02:00
|
|
|
const { toTrayWhenClosed, setToTrayWhenClosed, noLabels } = props;
|
2020-08-13 18:57:00 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<React.Fragment>
|
|
|
|
<FormField
|
|
|
|
type="checkbox"
|
|
|
|
name="totraywhenclosed"
|
2021-08-05 10:41:45 +02:00
|
|
|
onChange={(e) => {
|
2020-08-13 18:57:00 +02:00
|
|
|
setToTrayWhenClosed(e.target.checked);
|
|
|
|
}}
|
|
|
|
checked={toTrayWhenClosed}
|
2021-08-05 10:41:45 +02:00
|
|
|
label={noLabels ? '' : __('Leave app running in notification area when the window is closed')}
|
2020-08-13 18:57:00 +02:00
|
|
|
/>
|
|
|
|
</React.Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingClosingBehavior;
|