Created
July 22, 2021 06:41
-
-
Save mijms/8246c8c757cb37466cc8b7329028e7b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Authorized extends Component { | |
handleClick = () => { | |
const { onClick } = this.props | |
const authorized = checkAuthorization() | |
if (authorized) { | |
// console.log('authorixes') | |
onClick(d) | |
} | |
// show Not Authorize Popup | |
} | |
render() { | |
return ( | |
<this.props.children onClick={this.handleClick} /> | |
) | |
} | |
} | |
<Authorized onClick={myNormalClick}> | |
{(props)=> | |
(<ClickedComponent onClick={props.onClick}></ClickedComponent>) | |
} | |
</Authorized> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment