@campxdev/shared 1.8.38 → 1.8.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.8.38",
3
+ "version": "1.8.39",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,10 +1,31 @@
1
1
  import { ReactNode } from 'react'
2
2
  import { Helmet as ReactHelmet } from 'react-helmet'
3
3
 
4
- // type MetaProps = JSX.IntrinsicElements['meta']
5
- // type LinkProps = JSX.IntrinsicElements['link']
4
+ const isLocalHost = process.env.NODE_ENV === 'development'
5
+
6
+ const freshDeskInnerHtml = `
7
+ window.fwSettings = {
8
+ widget_id: 85000000149,
9
+ }
10
+ !(function () {
11
+ window.openFreshDeskWidget = function openFreshDeskWidget() {
12
+ FreshworksWidget('open', 'ticketForm')
13
+ }
14
+ if ('function' != typeof window.FreshworksWidget) {
15
+ var n = function () {
16
+ n.q.push(arguments)
17
+ }
18
+ ;(n.q = []), (window.FreshworksWidget = n)
19
+ }
20
+ FreshworksWidget('hide', 'launcher')
21
+ })()
22
+
23
+ `
6
24
 
7
25
  const getInnerHtml = (user: any) => {
26
+ if (isLocalHost) {
27
+ return ''
28
+ }
8
29
  const fcWidgetMessengerConfig = {
9
30
  config: {
10
31
  headerProperty: {
@@ -29,13 +50,6 @@ const getInnerHtml = (user: any) => {
29
50
 
30
51
  `
31
52
  }
32
- // window.fcWidget.user.setPhone('${user?.mobile}')
33
-
34
- // window.fcWidget.user.clear().then(function() {
35
- // console.log('User cleared');
36
- // }, function() {
37
- // console.log("User Not cleared");
38
- // });
39
53
 
40
54
  interface IHelmetProps {
41
55
  appTitle: string
@@ -61,37 +75,24 @@ export default function Helmet({
61
75
  {extraMetaTags}
62
76
  <link rel="icon" href={favicon} />
63
77
  <link rel="apple-touch-icon" href={favicon} />
64
- <script
65
- type="text/javascript"
66
- src="//in.fw-cdn.com/30814322/430238.js"
67
- defer
68
- />
78
+ {isLocalHost && (
79
+ <script
80
+ type="text/javascript"
81
+ src="//in.fw-cdn.com/30814322/430238.js"
82
+ defer
83
+ />
84
+ )}
69
85
  <script defer>{getInnerHtml(user)}</script>
70
-
71
86
  <script async defer>
72
- {`
73
- window.fwSettings = {
74
- widget_id: 85000000149,
75
- }
76
- !(function () {
77
- window.openFreshDeskWidget = function openFreshDeskWidget() {
78
- FreshworksWidget('open', 'ticketForm')
79
- }
80
- if ('function' != typeof window.FreshworksWidget) {
81
- var n = function () {
82
- n.q.push(arguments)
83
- }
84
- ;(n.q = []), (window.FreshworksWidget = n)
85
- }
86
- FreshworksWidget('hide', 'launcher')
87
- })()
88
- `}
87
+ {freshDeskInnerHtml}
89
88
  </script>
90
- <script
91
- type="text/javascript"
92
- src="https://ind-widget.freshworks.com/widgets/85000000149.js"
93
- defer
94
- ></script>
89
+ {isLocalHost && (
90
+ <script
91
+ type="text/javascript"
92
+ src="https://ind-widget.freshworks.com/widgets/85000000149.js"
93
+ defer
94
+ ></script>
95
+ )}
95
96
  <style type="text/css">
96
97
  {`
97
98
  #fc_frame {