2019-09-26 18:07:11 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import Button from 'component/button';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
button: string,
|
|
|
|
label?: string,
|
2020-04-13 21:16:07 +02:00
|
|
|
doSignOut: () => void,
|
|
|
|
doClearEmailEntry: () => void,
|
|
|
|
doClearPasswordEntry: () => void,
|
2019-09-26 18:07:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function UserSignOutButton(props: Props) {
|
2020-04-13 21:16:07 +02:00
|
|
|
const { button = 'link', doSignOut, doClearEmailEntry, doClearPasswordEntry, label } = props;
|
2019-09-26 18:07:11 +02:00
|
|
|
|
2020-04-13 21:16:07 +02:00
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
button={button}
|
|
|
|
label={label || __('Sign Out')}
|
|
|
|
onClick={() => {
|
|
|
|
doClearPasswordEntry();
|
|
|
|
doClearEmailEntry();
|
|
|
|
doSignOut();
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
2019-09-26 18:07:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default UserSignOutButton;
|