import React from "react";
import classNames from "classnames";
import styles from "./_submit.module.scss";
const SubmitButton = ({ handleClick, text, selector }) => {
let isOutlined;
selector === "contained" ? (isOutlined = false) : (isOutlined = true);
return (
<button
className={classNames(
{ [styles.contained]: !isOutlined },
{ [styles.outlined]: isOutlined },
{ [styles.btn]: true }
)}
onClick={handleClick}
>
{text}
</button>
);
};
export default SubmitButton;
const App = () => {
return (
<div>
<Route exact path='/modernWelcome' component={MainPage} />
<Route exact path='/modernWelcome/messages' component={Messages} />
<Route exact path='/modernWelcome/friends' component={Friends} />
</div>
);
};
const MainPage = (props) => {
return (
<div>
<h1>MainPage</h1>
<NavLink to='modernWelcome/messages'>Message</NavLink>
<NavLink to='modernWelcome/friends'>Friends</NavLink>
</div>
);
};
static getDerivedStateFromProps(nextProps, prevState) {
if (prevState.projects !== nextProps.projects) {
}
return {
projects: nextProps.projects,
};
}