galadrim-feedback 0.0.62 → 0.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,22 +1,73 @@
1
- Installation
1
+ # Installation Guide for Galadrim Feedback
2
2
 
3
- Pré-requis :
4
- axios
3
+ ## Prérequis
5
4
 
6
- yarn add galadrim-feedback axios
5
+ Avant d'installer **Galadrim Feedback**, assurez-vous d'avoir **axios** installé dans votre projet.
7
6
 
8
- ajouter "babel-plugin-react-generate-paths" comme plugin babel
7
+ ```bash
8
+ yarn add axios
9
+ ```
9
10
 
10
- add the FeedbackRoot to the root of your app (it needs to be inside the router)
11
+ Ensuite, installez **Galadrim Feedback** :
11
12
 
13
+ ```bash
14
+ yarn add galadrim-feedback
15
+ ```
16
+
17
+ ## Configuration Babel
18
+
19
+ Ajoutez le plugin **babel-plugin-react-generate-paths** dans votre configuration Babel.
20
+
21
+ ### Option 1: Dans `vite.config.ts`
22
+
23
+ Si vous utilisez Vite, ajoutez le plugin dans le fichier `vite.config.ts` comme suit :
24
+
25
+ ```typescript
26
+ import { defineConfig } from "vite";
27
+ import react from "@vitejs/plugin-react";
28
+
29
+ // https://vitejs.dev/config/
30
+ export default defineConfig({
31
+ plugins: [
32
+ react({
33
+ babel: {
34
+ plugins: [["babel-plugin-react-generate-paths"]],
35
+ },
36
+ }),
37
+ ],
38
+ });
39
+ ```
40
+
41
+ ### Option 2: Dans `.babelrc`
42
+
43
+ Si vous utilisez un fichier `.babelrc`, ajoutez le plugin dans la section `plugins` :
44
+
45
+ ```json
46
+ {
47
+ "plugins": ["babel-plugin-react-generate-paths"]
48
+ }
49
+ ```
50
+
51
+ ## Intégration de FeedbackRoot
52
+
53
+ Ajoutez le composant **FeedbackRoot** à la racine de votre application. Il doit être placé à l'intérieur du **router**.
54
+
55
+ ```javascript
12
56
  import FeedbackRoot from "galadrim-feedback";
13
- import "galadrim-feedback/dist/styles.css";
57
+ import "galadrim-feedback/dist/styles.css"; // N'oubliez pas d'importer les styles CSS
14
58
 
15
- add the following props to the FeedbackRoot component :
59
+ // Ajoutez FeedbackRoot à votre application
16
60
  <FeedbackRoot
17
- rootDir="/path/to/your/project"
18
- projectId="your-project-id"
19
- navigate={(path) => navigate(path)}
20
- />
61
+ rootDir="/path/to/your/project"
62
+ projectId="your-project-id" // L'id de votre projet dans Galadmin
63
+ navigate={(path) => navigate(path)} // Fonction de navigation pour utiliser votre router
64
+ />;
65
+ ```
66
+
67
+ ### Explication des Props :
68
+
69
+ - **rootDir** : Le chemin vers la racine de votre projet.
70
+ - **projectId** : L'identifiant de votre projet dans **Galadmin**.
71
+ - **navigate** : Une fonction qui prend un chemin et vous permet de naviguer en utilisant votre **router**.
21
72
 
22
- navigate is a function that takes a path and navigates to it using your router
73
+ Cela conclut l'installation de **Galadrim Feedback** dans votre projet !