@@ -3,26 +3,21 @@ import PropTypes from "prop-types"
33
44export default class AuthorizeBtn extends React . Component {
55 static propTypes = {
6- className : PropTypes . string
7- }
8-
9- onClick = ( ) => {
10- let { authActions, authSelectors } = this . props
11- let definitions = authSelectors . definitionsToAuthorize ( )
12-
13- authActions . showDefinitions ( definitions )
6+ onClick : PropTypes . func ,
7+ isAuthorized : PropTypes . bool ,
8+ showPopup : PropTypes . bool ,
9+ getComponent : PropTypes . func . isRequired
1410 }
1511
1612 render ( ) {
17- let { authSelectors, getComponent } = this . props
13+ let { isAuthorized, showPopup, onClick, getComponent } = this . props
14+
1815 //must be moved out of button component
1916 const AuthorizationPopup = getComponent ( "authorizationPopup" , true )
20- let showPopup = ! ! authSelectors . shownDefinitions ( )
21- let isAuthorized = ! ! authSelectors . authorized ( ) . size
2217
2318 return (
2419 < div className = "auth-wrapper" >
25- < button className = { isAuthorized ? "btn authorize locked" : "btn authorize unlocked" } onClick = { this . onClick } >
20+ < button className = { isAuthorized ? "btn authorize locked" : "btn authorize unlocked" } onClick = { onClick } >
2621 < span > Authorize</ span >
2722 < svg width = "20" height = "20" >
2823 < use href = { isAuthorized ? "#locked" : "#unlocked" } xlinkHref = { isAuthorized ? "#locked" : "#unlocked" } />
@@ -32,12 +27,4 @@ export default class AuthorizeBtn extends React.Component {
3227 </ div >
3328 )
3429 }
35-
36-
37- static propTypes = {
38- getComponent : PropTypes . func . isRequired ,
39- authSelectors : PropTypes . object . isRequired ,
40- errActions : PropTypes . object . isRequired ,
41- authActions : PropTypes . object . isRequired ,
42- }
4330}
0 commit comments