-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Description: Add recommendations buttons and modal for painted door experiment VAN-1601
- Loading branch information
1 parent
86a4573
commit 75a7524
Showing
8 changed files
with
157 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { ModalDialog, ActionRow, Button } from '@edx/paragon'; | ||
import { useIntl } from '@edx/frontend-platform/i18n'; | ||
import messages from './messages'; | ||
|
||
export const ModalView = ({ | ||
isOpen, | ||
onClose, | ||
}) => { | ||
const { formatMessage } = useIntl(); | ||
|
||
const handleClose = () => { | ||
onClose(false); | ||
}; | ||
return ( | ||
<div className="containers"> | ||
<ModalDialog | ||
isOpen={isOpen} | ||
onClose={handleClose} | ||
hasCloseButton={false} | ||
isFullscreenScroll | ||
> | ||
<ModalDialog.Header> | ||
<ModalDialog.Title> | ||
<h3 className="mt-2">{formatMessage(messages.recommendationsModalHeading)}</h3> | ||
</ModalDialog.Title> | ||
</ModalDialog.Header> | ||
<ModalDialog.Body> | ||
<div className="modal-continer"> | ||
<p className="mt-2">{formatMessage(messages.recommendationsFeatureText)}</p> | ||
<p>{formatMessage(messages.recommendationsAlertedText)}</p> | ||
</div> | ||
</ModalDialog.Body> | ||
<ModalDialog.Footer> | ||
<ActionRow> | ||
<ModalDialog.CloseButton variant="tertiary"> | ||
{formatMessage(messages.modalSkipButton)} | ||
</ModalDialog.CloseButton> | ||
<Button variant="primary">{formatMessage(messages.modalCountMeButton)}</Button> | ||
</ActionRow> | ||
</ModalDialog.Footer> | ||
</ModalDialog> | ||
</div> | ||
); | ||
}; | ||
|
||
ModalView.defaultProps = { | ||
isOpen: false, | ||
onClose: () => {}, | ||
}; | ||
|
||
ModalView.propTypes = { | ||
onClose: PropTypes.func, | ||
isOpen: PropTypes.bool, | ||
}; | ||
|
||
export default ModalView; |
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,31 @@ | ||
import { defineMessages } from '@edx/frontend-platform/i18n'; | ||
|
||
const messages = defineMessages({ | ||
recommendationsFeatureText: { | ||
id: 'RecommendationsPanel.recommendationsFeatureText', | ||
defaultMessage: 'Personalized recommendations feature is not yet available. We are working hard on bringing it to your learner home in the near future.', | ||
description: 'recommendations feature text', | ||
}, | ||
recommendationsAlertedText: { | ||
id: 'RecommendationsPanel.recommendationsAlertedText', | ||
defaultMessage: 'Would you like to be alerted when it becomes available?', | ||
description: 'recommendations alerted text', | ||
}, | ||
recommendationsModalHeading: { | ||
id: 'RecommendationsPanel.recommendationsModalHeading', | ||
defaultMessage: 'Thank you for your interest!', | ||
description: 'Heading of modal', | ||
}, | ||
modalSkipButton: { | ||
id: 'RecommendationsPanel.modalSkipButton', | ||
defaultMessage: 'Skip for now', | ||
description: 'button for Skip for now', | ||
}, | ||
modalCountMeButton: { | ||
id: 'RecommendationsPanel.modalCountMeButton', | ||
defaultMessage: 'Count me in!', | ||
description: 'button for Count me in!', | ||
}, | ||
}); | ||
|
||
export default messages; |
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