@trycourier/react-provider 7.3.1-internal.6fbb6e1.0 → 7.4.1-internal.5c52e6a.0
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 +22 -15
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
- [Version 5.X CSP Migration](#version-5-csp-migration)
|
|
5
5
|
- [Props](#props)
|
|
6
|
-
- [Listening to
|
|
6
|
+
- [Listening to Messages](#listening-to-messages)
|
|
7
7
|
- [Dark Mode / Theme Variables](#dark-mode--theme-variables)
|
|
8
8
|
|
|
9
9
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
@@ -84,7 +84,7 @@ interface Brand {
|
|
|
84
84
|
|
|
85
85
|
<a name="1listening-to-messagesmd"></a>
|
|
86
86
|
|
|
87
|
-
### [Listening to
|
|
87
|
+
### [Listening to Messages](#listening)
|
|
88
88
|
|
|
89
89
|
There are a few ways to listen for messages and being able react.
|
|
90
90
|
|
|
@@ -94,7 +94,7 @@ There are a few ways to listen for messages and being able react.
|
|
|
94
94
|
import { CourierProvider } from "@trycourier/react-provider";
|
|
95
95
|
|
|
96
96
|
const MyApp = ({ children }) => {
|
|
97
|
-
const handleOnMessage = (
|
|
97
|
+
const handleOnMessage = (message: IInboxMessagePreview) => {
|
|
98
98
|
console.log(message);
|
|
99
99
|
return message;
|
|
100
100
|
};
|
|
@@ -176,34 +176,41 @@ import { CourierProvider } from "@trycourier/react-provider";
|
|
|
176
176
|
|
|
177
177
|
const MyApp = ({ children }) => {
|
|
178
178
|
return (
|
|
179
|
-
<CourierProvider
|
|
179
|
+
<CourierProvider theme={{ colorMode: "dark" }}>{children}</CourierProvider>
|
|
180
180
|
);
|
|
181
181
|
};
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
You can customize
|
|
184
|
+
You can customize dark mode by passing in variables to the root level theme:
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
```typescript
|
|
187
187
|
export interface ThemeVariables {
|
|
188
188
|
background?: string;
|
|
189
189
|
textColor?: string;
|
|
190
190
|
titleColor?: string;
|
|
191
191
|
structure?: string;
|
|
192
192
|
icon?: string;
|
|
193
|
-
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
194
195
|
|
|
195
196
|
```tsx
|
|
196
197
|
import { CourierProvider } from "@trycourier/react-provider";
|
|
197
198
|
|
|
198
199
|
const MyApp = ({ children }) => {
|
|
199
200
|
return (
|
|
200
|
-
<CourierProvider
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
<CourierProvider
|
|
202
|
+
theme={{
|
|
203
|
+
variables: {
|
|
204
|
+
background: "red",
|
|
205
|
+
textColor: "blue",
|
|
206
|
+
titleColor: "green",
|
|
207
|
+
structure: "pink",
|
|
208
|
+
icon: "orange",
|
|
209
|
+
},
|
|
210
|
+
}}
|
|
211
|
+
>
|
|
212
|
+
{children}
|
|
213
|
+
</CourierProvider>
|
|
207
214
|
);
|
|
208
215
|
};
|
|
209
|
-
|
|
216
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/react-provider",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.1-internal.5c52e6a.0+5c52e6a",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "typings/index.d.ts",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@trycourier/client-graphql": "^7.
|
|
19
|
-
"@trycourier/core": "^7.
|
|
18
|
+
"@trycourier/client-graphql": "^7.4.1-internal.5c52e6a.0+5c52e6a",
|
|
19
|
+
"@trycourier/core": "^7.4.1-internal.5c52e6a.0+5c52e6a",
|
|
20
20
|
"@trycourier/courier-js": "^1.4.2",
|
|
21
|
-
"@trycourier/transport": "^7.
|
|
21
|
+
"@trycourier/transport": "^7.4.1-internal.5c52e6a.0+5c52e6a",
|
|
22
22
|
"buffer": "^6.0.3",
|
|
23
23
|
"jwt-decode": "^4.0.0",
|
|
24
24
|
"react-use": "^17.2.1",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"dist/",
|
|
35
35
|
"typings/"
|
|
36
36
|
],
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "5c52e6a0122752a6346eec1150f0108195508930"
|
|
38
38
|
}
|