LoginButton.tsx 468 B

1234567891011121314151617181920
  1. import { useIntl } from "react-intl";
  2. import { Link } from "react-router";
  3. interface IWidget {
  4. target?: React.HTMLAttributeAnchorTarget;
  5. }
  6. const LoginButton = ({ target }: IWidget) => {
  7. const intl = useIntl();
  8. const url = btoa(window.location.href);
  9. return (
  10. <Link to={`/anonymous/users/sign-in?url=${url}`} target={target}>
  11. {intl.formatMessage({
  12. id: "nut.users.sign-in-up.title",
  13. })}
  14. </Link>
  15. );
  16. };
  17. export default LoginButton;