mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
put backend sources into src setup circleci don't use react-loadable because it seems unnecessary
38 lines
847 B
JavaScript
38 lines
847 B
JavaScript
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import PropTypes from "prop-types";
|
|
import { ButtonBase } from "@material-ui/core";
|
|
|
|
import { logout } from "../../actions/user";
|
|
|
|
function Link({ onClick, children }) {
|
|
return (
|
|
<ButtonBase
|
|
style={{
|
|
marginLeft: "auto",
|
|
marginRight: 0,
|
|
padding: "0 1rem",
|
|
}}
|
|
onClick={(e) => {
|
|
e.preventDefault();
|
|
onClick();
|
|
}}
|
|
>
|
|
{children}
|
|
</ButtonBase>
|
|
);
|
|
}
|
|
|
|
Link.propTypes = {
|
|
onClick: PropTypes.func.isRequired,
|
|
children: PropTypes.node.isRequired,
|
|
};
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
onClick: () => dispatch(logout()),
|
|
};
|
|
}
|
|
|
|
export default connect(null, mapDispatchToProps)(Link);
|