@tugitark/react-widget 1.0.0 → 1.0.1
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/index.md +39 -0
- package/package.json +1 -1
package/index.md
CHANGED
|
@@ -145,4 +145,43 @@ The following optional properties are shared with the full version:
|
|
|
145
145
|
* `open`
|
|
146
146
|
* `visible`
|
|
147
147
|
|
|
148
|
+
Notes
|
|
149
|
+
-------
|
|
150
|
+
|
|
151
|
+
While there can be only one widget on the page there can be multiple `<TugiWidget>` components at once. Which one will be used is non-deterministic - even if you have one `<TugiWidget>` with `visible={true}` and another one with `visible={false}` this will not guarantee that the visible one is the one that gets shown, the invisible one may be "shown", resulting in neither being seen. The one selected is based on internal render and update orders. Further, having two at once may result in the widget being constantly unloaded and reloaded even when nothing has changed as the underlying code flips repeatedly between them. If you have two versions of the widget shown in different circumstances then make sure that the whole component is conditional:
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
return (
|
|
156
|
+
disabled
|
|
157
|
+
? <TugiWidget
|
|
158
|
+
chatDisabledReason="You are not signed in."
|
|
159
|
+
title="FAQ"
|
|
160
|
+
body="Let us help you get started."
|
|
161
|
+
sections={[
|
|
162
|
+
{ title: 'Who are we?', content: 'We are Tugi Tark.' },
|
|
163
|
+
{ title: 'What do we do?', content: 'Make awesome customer support solutions.' },
|
|
164
|
+
{ title: 'How?', content: 'Smart AI agents who know all about your customers and services.' },
|
|
165
|
+
{ title: 'How do I join?', content: 'Click the sign-up botton at the top-right of the page.' },
|
|
166
|
+
]}
|
|
167
|
+
/>
|
|
168
|
+
: <TugiWidget
|
|
169
|
+
jwtFn={jwtFn}
|
|
170
|
+
brandId="a040050697fc4b2db16acfbbad1d0da4"
|
|
171
|
+
brandName="Super Casino"
|
|
172
|
+
tenantId="gb-casinos-ltd"
|
|
173
|
+
httpUrl="https://app.tugi.ai/tugi.widget"
|
|
174
|
+
wsUrl="wss://ws.tugi.ai"
|
|
175
|
+
customize={{
|
|
176
|
+
title: 'Tugi Casino Help',
|
|
177
|
+
showTitle: true,
|
|
178
|
+
fontColor: '#2c3e50',
|
|
179
|
+
primaryColor: '#2c3e50',
|
|
180
|
+
secondaryColor: 'hsla(36, 100%, 50%, 1)',
|
|
181
|
+
homePageBackgroundColor: 'hsla(36, 100%, 37%, 0.2)',
|
|
182
|
+
homePageTextColor: '#2c3e50',
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
);
|
|
186
|
+
```
|
|
148
187
|
|