npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ta-interaktiv/react-user-feedback

v4.2.2

Published

Show a component where the user can rate the interactive and see how others rated it

Downloads

68

Readme

React User Feedback Component

Install and use as a component

Installing the package from npmjs with yarn:

yarn add @ta-interaktiv/react-user-feedback

or with npm:

yarn add @ta-interaktiv/react-user-feedback

And afterwards, import it in the top section of your own component:

import UserFeedback from '@ta-interaktiv/react-user-feedback'

API

Table of Contents

DatabaseFormat

How the data is stored in https://ta-user-feedback.firebaseio.com/v2/stories/.

The property names are super short, so we need as little bandwidth as possible.

Please note: The previous version also saved the questions in the database. This no longer happens. Votes are only tracked positionally: the first number for the first question, the second number for the second question, etc. If you already have collected votes and then decide to change the wording of the questions or their order, you will receive "wrong" results. You might want to delete the previously collected votes directly in the Firebase Admin view and start over.

Type: {p: number, v: Array<number>}

Properties

MESSAGES

Translatable messages.

UserFeedback

Extends Component

Allows people to rate the standalone on various questions.

Parameters

  • props Props
    • props.answerText string? The text people see when the overall rating average is above the top 20%.
    • props.articleId string The article ID related to this feedback.
    • props.className string? Additional class names to pass to the component.
    • props.inverted boolean Whether the component is displayed on a dark background. (optional, default false)
    • props.questions Array<string>? A list of questions to ask the readers. Defaults to 'Wie lehrreich war der Beitrag?', 'Wie unterhaltsam war er?' and 'Wie gefällt Ihnen die Gestaltung?'.
    • props.starAmount number The number of stars to use. (optional, default 5)
    • props.starColor SemanticUIColors The color of the stars and the submit button. (optional, default yellow)
    • props.title string The overall title of the component (optional, default 'Wie bewerten Sie diesen Beitrag?')
    • props.locale ("de" | "fr") The locale in which to show the component. Currently can be either French (fr) or German (de). (optional, default 'de')

Examples

<UserFeedback
  articleId='20919286'
  starColor='yellow'
  title='Wie bewerten Sie diese Geschichte?'
  answerText='Die meisten Leserinnen und Leser bewerten den Artikel als sehr
              gut. Das freut uns.'
  questions={['Wie lehrreich war der Beitrag?', 'Wie unterhaltsam war er?',
              'Wie gefällt Ihnen die Gestaltung?']}
/>

setupTest

Set up the capability we want to test for. This attaches an event listener to the window (meaning: EVERYTHING!). Upon the first interaction of that kind (like: a touch, or a mouse over, which, it being the window, should happen pretty fast), it will call the appropriate

Parameters
  • eventToTestFor string
  • actionHandler function (isAble: boolean): void

Question

Extends Component

Renders a single question, including the interactive stars

Parameters

  • props Props
    • props.averageRating number?
    • props.inverted boolean (optional, default false)
    • props.question string
    • props.ratingHandler Function
    • props.starAmount number (optional, default 5)
    • props.starColor SemanticUIColors (optional, default yellow)
    • props.votingIsOver boolean (optional, default false)

Handle clicks on a star

SemanticUIColors

The available colors in Semantic UI

Type: ("red" | "orange" | "yellow" | "olive" | "green" | "teal" | "blue" | "violet" | "purple" | "pink" | "brown" | "grey" | "black")

Stars

Extends Component

Appends stars and returns the event when clicking on them

Parameters

  • props Props
    • props.averageRating number? The rating value after rating has been done.
    • props.clickHandler Function
    • props.inverted boolean (optional, default false)
    • props.currentlySelectedRating number The currently chosen rating by the user.
    • props.starAmount number The amount of stars to show and choose from. (optional, default 5)
    • props.starColor SemanticUIColors The color of the icons (optional, default yellow)
    • props.votingIsOver boolean Whether the user is allowed to vote (optional, default false)