Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com> Co-authored-by: Alessio Gravili <alessio@gravili.de> Co-authored-by: PatrikKozak <patrik@trbl.design> Co-authored-by: Lucas Blancas <lablancas@gmail.com> Co-authored-by: Stef Gootzen <37367280+stefgootzen@users.noreply.github.com> Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com> Co-authored-by: Jessica Chowdhury <67977755+JessChowdhury@users.noreply.github.com> Co-authored-by: PatrikKozak <35232443+PatrikKozak@users.noreply.github.com> Co-authored-by: Greg Willard <Wickett06@gmail.com> Co-authored-by: James Mikrut <james@payloadcms.com> Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com> Co-authored-by: Elliot DeNolf <denolfe@gmail.com> fix: WhereBuilder component does not accept all valid Where queries (#3087) fix: passes in height to resizeOptions upload option to allow height resize (#3171)
51 lines
1.0 KiB
TypeScript
51 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { Link } from 'react-router-dom';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useConfig } from '../../utilities/Config';
|
|
import RenderCustomComponent from '../../utilities/RenderCustomComponent';
|
|
import LogOut from '../../icons/LogOut';
|
|
|
|
const baseClass = 'nav';
|
|
|
|
const DefaultLogout = () => {
|
|
const { t } = useTranslation('authentication');
|
|
const config = useConfig();
|
|
const {
|
|
routes: { admin },
|
|
admin: {
|
|
logoutRoute,
|
|
components: { logout },
|
|
},
|
|
} = config;
|
|
return (
|
|
<Link
|
|
to={`${admin}${logoutRoute}`}
|
|
className={`${baseClass}__log-out`}
|
|
aria-label={t('logOut')}
|
|
>
|
|
<LogOut />
|
|
</Link>
|
|
);
|
|
};
|
|
|
|
const Logout: React.FC = () => {
|
|
const {
|
|
admin: {
|
|
components: {
|
|
logout: { Button: CustomLogout } = {
|
|
Button: undefined,
|
|
},
|
|
} = {},
|
|
} = {},
|
|
} = useConfig();
|
|
|
|
return (
|
|
<RenderCustomComponent
|
|
CustomComponent={CustomLogout}
|
|
DefaultComponent={DefaultLogout}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Logout;
|