-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5743 from topcoder-platform/develop
Release v1.13.5
- Loading branch information
Showing
9 changed files
with
240 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Generic Login Modal Dialog | ||
*/ | ||
/* global window */ | ||
|
||
import PT from 'prop-types'; | ||
import React from 'react'; | ||
import { Modal, PrimaryButton } from 'topcoder-react-ui-kit'; | ||
import { config, Link } from 'topcoder-react-utils'; | ||
import tc from 'components/buttons/themed/tc.scss'; | ||
import modalStyle from './modal.scss'; | ||
|
||
/** Themes for buttons | ||
* those overwrite PrimaryButton style to match achieve various styles. | ||
* Should implement pattern of classes. | ||
*/ | ||
const buttonThemes = { | ||
tc, | ||
}; | ||
|
||
function LoginModal({ | ||
onCancel, | ||
retUrl, | ||
utmSource, | ||
modalTitle, | ||
modalText, | ||
infoNode, | ||
}) { | ||
return ( | ||
<Modal | ||
onCancel={onCancel} | ||
theme={modalStyle} | ||
> | ||
<div className={modalStyle.loginRequired}> | ||
<h3 className={modalStyle.title}>{modalTitle}</h3> | ||
<p className={modalStyle.loginMsg}>{modalText}</p> | ||
<div className={modalStyle.ctaButtons}> | ||
<PrimaryButton | ||
onClick={() => { | ||
window.location = `${config.URL.AUTH}/member?retUrl=${encodeURIComponent(retUrl)}`; | ||
}} | ||
theme={{ | ||
button: buttonThemes.tc['primary-green-md'], | ||
}} | ||
> | ||
LOGIN | ||
</PrimaryButton> | ||
<Link to={`${config.URL.AUTH}/member/registration?retUrl=${encodeURIComponent(retUrl)}&mode=signUp${utmSource ? `&utm_source=${utmSource}` : ''}`} className={buttonThemes.tc['primary-white-md']}>REGISTER</Link> | ||
</div> | ||
{infoNode} | ||
</div> | ||
</Modal> | ||
); | ||
} | ||
|
||
LoginModal.defaultProps = { | ||
utmSource: null, | ||
infoNode: null, | ||
}; | ||
|
||
LoginModal.propTypes = { | ||
onCancel: PT.func.isRequired, | ||
retUrl: PT.string.isRequired, | ||
utmSource: PT.string, | ||
modalTitle: PT.string.isRequired, | ||
modalText: PT.string.isRequired, | ||
infoNode: PT.node, | ||
}; | ||
|
||
export default LoginModal; |
Oops, something went wrong.