项目作者: ishannaithani

项目描述 :
A prototype of sentiments widget built with ReactJS
高级语言: JavaScript
项目地址: git://github.com/ishannaithani/sentiments-widget.git
创建时间: 2020-02-28T08:41:36Z
项目社区:https://github.com/ishannaithani/sentiments-widget

开源协议:

下载


Sentiments Widget

Built with ReactJS. Demo at https://sentiments-widget.azurewebsites.net/

Please pull the code and run the below commands -

npm start

Open http://localhost:3000

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

A brief note

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 -

  1. Web Accessibility (e.g. keyboard and tags for screen-readers)
  2. Theming
  3. Better documentation or JSDoc

Component and State Diagram

enter image description here

Components

src/App.js

SentimentsWidget (Main exportable)

Property Type Required Default value Description
emojiSVGUrl string no null
step1ButtonText string no null
ratingScreenOptions shape no
feedbackFormOptions shape no
finalThankYouCard shape no

Child Components of SentimentsWidget

src/components/emoji/index.js

1. Emoji

Property Type Required Default value Description
emojiSVGUrl string no defaultSVGUrl

src/components/feedback-form/index.js

1. FeedbackForm

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

1. HelpUsImprove

Property Type Required Default value Description
text string no

src/components/layout/close-button/index.js

1. CloseButton

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

1. RatingScale

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

1. ScaleSelector

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

1. ThankYouCard

Property Type Required Default value Description
heading string no
subtitle string no

This document was generated by the React DOC Generator v1.2.5.