Skip to content

Commit 9ba48fb

Browse files
committed
first commit
0 parents  commit 9ba48fb

41 files changed

Lines changed: 1045 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# pushfeedback-react
2+
3+
Integrate PushFeedback feedback widget into your React project.
4+
5+
## Prerequisites
6+
7+
Before proceeding, ensure you have the following:
8+
9+
- A PushFeedback account ([Sign up for free](https://docs.pushfeedback.com/)).
10+
- A project set up in your PushFeedback dashboard. Follow the Quickstart guide if you haven't done this yet.
11+
- A React application with Node.js installed.
12+
13+
## Installation
14+
15+
1. Open your terminal or command prompt.
16+
2. Navigate to your project's root directory:
17+
18+
```bash
19+
cd path/to/your/project
20+
```
21+
22+
Replace `path/to/your/project` with the actual path to your project directory.
23+
24+
3. Install PushFeedback by running:
25+
26+
```bash
27+
npm install pushfeedback-react
28+
```
29+
30+
> **INFO**: If you're using yarn, use `yarn add pushfeedback-react` instead.
31+
32+
## Embedding the Feedback Button
33+
34+
1. In the main component where you want the feedback button to appear (commonly `src/App.js`), import and embed the PushFeedback button:
35+
36+
```jsx
37+
import React, { useEffect } from 'react';
38+
import { FeedbackButton } from 'pushfeedback-react';
39+
import { defineCustomElements } from 'pushfeedback/loader';
40+
import 'pushfeedback/dist/pushfeedback/pushfeedback.css';
41+
42+
function App() {
43+
44+
useEffect(() => {
45+
if (typeof window !== 'undefined') {
46+
defineCustomElements(window);
47+
}
48+
}, []);
49+
50+
return (
51+
<div className="App">
52+
{/* Other components and content */}
53+
<FeedbackButton project="<YOUR_PROJECT_ID>" button-position="bottom-right" modal-position="bottom-right" button-style="light">Feedback</FeedbackButton>
54+
</div>
55+
);
56+
}
57+
58+
export default App;
59+
```
60+
61+
Replace `<YOUR_PROJECT_ID>` with your project's ID from the PushFeedback dashboard.
62+
63+
2. Start your React application:
64+
65+
```bash
66+
npm start
67+
```
68+
69+
Or if you're using yarn:
70+
71+
```bash
72+
yarn start
73+
```
74+
75+
After compiling successfully, the feedback button should be visible and functional on your site.
76+
77+
## Configuration
78+
79+
For further customization and to explore additional features, refer to the [Configuration section](https://docs.pushfeedback.com/category/configuration).
80+
81+
## Support
82+
83+
Need assistance? Contact [PushFeedback Support](https://docs.pushfeedback.com/support) for help.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
const pushfeedbackReact = require('..');
4+
const assert = require('assert').strict;
5+
6+
assert.strictEqual(pushfeedbackReact(), 'Hello from pushfeedbackReact');
7+
console.info('pushfeedbackReact tests passed');

dist/index.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-component-lib/createComponent.js

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-component-lib/createComponent.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-component-lib/createOverlayComponent.js

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-component-lib/createOverlayComponent.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-component-lib/index.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-component-lib/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)