@campxdev/shared 1.8.15 → 1.8.17

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.15",
3
+ "version": "1.8.17",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,5 +1,6 @@
1
1
  import { HelpOutline } from '@mui/icons-material'
2
2
  import { Button } from '@mui/material'
3
+ import DropDownButton from '../../../DropDownButton/DropDownButton'
3
4
 
4
5
  export default function FreshDeskHelpButton() {
5
6
  const handleOpenFreshDeskWidget = () => {
@@ -10,15 +11,40 @@ export default function FreshDeskHelpButton() {
10
11
  console.error('Error launching Freshdesk')
11
12
  }
12
13
  }
14
+
15
+ const handleFreshChat = () => {
16
+ try {
17
+ ;(window as any)?.fcWidget?.open()
18
+ } catch (error) {
19
+ // eslint-disable-next-line no-console
20
+ console.error('Error launching Freshdesk Chat')
21
+ }
22
+ }
13
23
  return (
14
- <Button
15
- variant="text"
16
- color="secondary"
17
- startIcon={<HelpOutline />}
18
- onClick={handleOpenFreshDeskWidget}
19
- sx={{ padding: '20px' }}
20
- >
21
- Help
22
- </Button>
24
+ <>
25
+ <DropDownButton
26
+ anchor={({ open }) => (
27
+ <Button
28
+ variant="text"
29
+ color="secondary"
30
+ onClick={open}
31
+ startIcon={<HelpOutline />}
32
+ sx={{ padding: '20px' }}
33
+ >
34
+ Help
35
+ </Button>
36
+ )}
37
+ menu={[
38
+ {
39
+ label: 'Raise a Ticket',
40
+ onClick: handleOpenFreshDeskWidget,
41
+ },
42
+ {
43
+ label: 'Chat with us',
44
+ onClick: handleFreshChat,
45
+ },
46
+ ]}
47
+ />
48
+ </>
23
49
  )
24
50
  }
@@ -44,6 +44,19 @@ export default function Helmet({
44
44
  },
45
45
  ...link,
46
46
  ]}
47
+ script={[
48
+ {
49
+ type: 'text/javascript',
50
+ innerHTML:
51
+ 'window.fcWidgetMessengerConfig = {config: {headerProperty: {hideChatButton: true}}}',
52
+ defer: true,
53
+ },
54
+ {
55
+ type: 'text/javascript',
56
+ src: '//in.fw-cdn.com/30814322/430238.js',
57
+ defer: true,
58
+ },
59
+ ]}
47
60
  />
48
61
  )
49
62
  }
@@ -1,5 +1,5 @@
1
1
  import { alpha, darken, lighten } from '@mui/material'
2
- import { createTheme } from '@mui/material/styles'
2
+ import { ThemeOptions, createTheme } from '@mui/material/styles'
3
3
  import { customCssBaseline } from './customCssBaseline'
4
4
 
5
5
  const borderRadius = {
@@ -94,8 +94,7 @@ const borders = {
94
94
  grayLight: `1px solid ${themeColors.secondaryLight}`,
95
95
  }
96
96
 
97
- // A custom theme for this app
98
- const muiTheme = createTheme({
97
+ const themeOptions = {
99
98
  typography: {
100
99
  fontFamily: ['Poppins', 'Avenir', 'sans-serif'].join(','),
101
100
  },
@@ -590,6 +589,9 @@ const muiTheme = createTheme({
590
589
  styleOverrides: customCssBaseline,
591
590
  },
592
591
  },
593
- })
592
+ }
593
+
594
+ // A custom theme for this app
595
+ const muiTheme = createTheme({ ...themeOptions })
594
596
 
595
597
  export default muiTheme
@@ -70,6 +70,8 @@ declare module '@mui/material/styles' {
70
70
  disabled?: string
71
71
  }
72
72
  }
73
+ components?: Components<Omit<Theme, 'components'>>
74
+ typography?: TypographyOptions | ((palette: Palette) => TypographyOptions)
73
75
  }
74
76
  export function createTheme(options?: CustomThemeOptions): CustomTheme
75
77
  }
package/tsconfig.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES5",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "esModuleInterop": true,
8
- "allowSyntheticDefaultImports": true,
9
- "strict": false,
10
- "forceConsistentCasingInFileNames": true,
11
- "noFallthroughCasesInSwitch": true,
12
- "module": "ESNext",
13
- "moduleResolution": "node",
14
- "resolveJsonModule": true,
15
- "isolatedModules": true,
16
- "noEmit": true,
17
- "jsx": "react-jsx",
18
- "types": ["node"]
19
- },
20
- "include": ["src"]
2
+ "compilerOptions": {
3
+ "target": "ES5",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "esModuleInterop": true,
8
+ "allowSyntheticDefaultImports": true,
9
+ "strict": false,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "noFallthroughCasesInSwitch": true,
12
+ "module": "ESNext",
13
+ "moduleResolution": "node",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+ "types": ["node"]
19
+ },
20
+ "include": ["src"]
21
21
  }