A prototype of sentiments widget built with ReactJS
Built with ReactJS
. Demo at https://sentiments-widget.azurewebsites.net/
Please pull the code and run the below commands -
npm start
npm run test
6 Test suits and 27 test cases
Browsers tested: MacOS Chrome, MacOS Firefox, Safari, Android Chrome
npm run build
Builds the app for production to the build
folder
This widget is built-up of 5 components. The root component is the SentimentsWidget
.
Inside src/layout/animatable-container, is a higher-order-component who orchestrates the different states’ of the widget and handles the animation.
Each component is isolated
with its own scoped styles
and *.spec.js
file.
Given more time, I would have liked to achieved the below -
src/App.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
emojiSVGUrl | string | no | null | |
step1ButtonText | string | no | null | |
ratingScreenOptions | shape | no | ||
feedbackFormOptions | shape | no | ||
finalThankYouCard | shape | no |
SentimentsWidget
src/components/emoji/index.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
emojiSVGUrl | string | no | defaultSVGUrl |
src/components/feedback-form/index.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
formHeadingText | string | no | ||
questionExperience | string | no | ||
placeholderExperience | string | no | ||
questionImprovement | string | no | ||
placeholderImprovement | string | no | ||
questionEmail | string | no | ||
placeholderEmail | string | no | ||
sumbitButtonText | string | no |
src/components/help-us-improve/index.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
text | string | no |
src/components/layout/close-button/index.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
transitionTo | string | no | ANIMATION_STEP_CLASSES.DEFAULT | |
positionTop | number | no | 0 | |
positionRight | number | no | 0 | |
color | string | no |
src/components/rating-scale/index.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
heading | string | no | ||
showMessageAfterRating | bool | no | true | |
maximumRating | number | no | 6 | |
ratingLowText | string | no | ||
ratingHighText | string | no | ||
messageTextAfterRating | no |
src/components/rating-scale/scale-selector/index.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
maximumRating | number | no | 6 | |
onRatingReceived | func | no | ||
ratingLowText | string | no | ||
ratingHighText | string | no |
src/components/thank-you-card/index.js
Property | Type | Required | Default value | Description |
---|---|---|---|---|
heading | string | no | ||
subtitle | string | no |
This document was generated by the React DOC Generator v1.2.5.