fix(learn): remove cta and add current challenge button (#38807)
This commit is contained in:
@@ -11,7 +11,8 @@ const currentChallengeApi = '/challenges/current-challenge';
|
||||
|
||||
const propTypes = {
|
||||
children: PropTypes.any,
|
||||
hardGoTo: PropTypes.func.isRequired
|
||||
hardGoTo: PropTypes.func.isRequired,
|
||||
isLargeBtn: PropTypes.bool
|
||||
};
|
||||
|
||||
const mapStateToProps = () => ({});
|
||||
@@ -23,10 +24,16 @@ const createClickHandler = hardGoTo => e => {
|
||||
return hardGoTo(`${apiLocation}${currentChallengeApi}`);
|
||||
};
|
||||
|
||||
function CurrentChallengeLink({ children, hardGoTo }) {
|
||||
function CurrentChallengeLink({ children, hardGoTo, isLargeBtn }) {
|
||||
let classNames;
|
||||
if (isLargeBtn) {
|
||||
classNames = 'btn btn-lg btn-primary btn-block';
|
||||
} else {
|
||||
classNames = 'btn btn-cta-big btn-primary btn-block';
|
||||
}
|
||||
return (
|
||||
<a
|
||||
className='btn-cta-big btn btn-primary btn-block'
|
||||
className={classNames}
|
||||
href={currentChallengeApi}
|
||||
onClick={createClickHandler(hardGoTo)}
|
||||
>
|
||||
|
Reference in New Issue
Block a user