Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aweary/react-mood
render components based on the mood of the user
https://github.com/aweary/react-mood
Last synced: about 2 months ago
JSON representation
render components based on the mood of the user
- Host: GitHub
- URL: https://github.com/aweary/react-mood
- Owner: aweary
- Created: 2017-04-01T16:40:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-01T17:07:46.000Z (over 7 years ago)
- Last Synced: 2024-07-27T22:39:11.483Z (about 2 months ago)
- Size: 17.6 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-mood 😀😢
Render components based on the mood of the user.
## Usage
Are you tried of being insensitive to the mood of your users? Do you want to reward to the happy and ignore the sad? `react-mood` lets you build a UI tailored specifically to your user's mood! All you have to is import the `Mood` component from `react-mood` and use the `renderIf` prop to decide which mood is appropriate for your beautiful handcrafted React component.
### Example
```jsx
import React from 'react'
import Mood from 'react-mood'class AnnoyedAlert extends React.Component {
render() {
return (
Hey there! It looks like you're having an annoying day.
Have you tried adjusting your attitude?
)
}
}
````react-mood` gives you full control over babysitting your users where you see fit. Gone are the days of insensitive one-size-fits-all approaches to pandering.
## Installation
`react-mood` is only available on the Yarn registry, npm support has been dropped.
```
yarn add react-mood
```