@campxdev/shared 1.6.1 → 1.6.2

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.6.1",
3
+ "version": "1.6.2",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,4 +1,4 @@
1
- import { Box, Typography } from '@mui/material'
1
+ import { Box, Button, Typography } from '@mui/material'
2
2
  import { ReactNode } from 'react'
3
3
  import { isDevelopment } from '../../../constants/isDevelopment'
4
4
  import { applications } from './applications'
@@ -22,6 +22,7 @@ import {
22
22
  StyledRouterLink,
23
23
  } from './styles'
24
24
  import UserBox from './UserBox'
25
+ import { HelpOutline } from '@mui/icons-material'
25
26
 
26
27
  const imageMap = {
27
28
  ums: collegex,
@@ -51,6 +52,14 @@ export default function AppHeader({
51
52
  userBoxActions = [],
52
53
  cogWheelMenu = [],
53
54
  }: AppHeaderProps) {
55
+ const handleOpenFreshDeskWidget = () => {
56
+ try {
57
+ ;(window as any)?.openFreshDeskWidget()
58
+ } catch (error) {
59
+ // eslint-disable-next-line no-console
60
+ console.error('Error launching Freshdesk')
61
+ }
62
+ }
54
63
  return (
55
64
  <StyledHeader>
56
65
  <Box sx={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
@@ -58,7 +67,17 @@ export default function AppHeader({
58
67
  <AppLogo clientLogo={clientLogo} />
59
68
  </Box>
60
69
  <Box className="actions">
61
- <HelpWidgetButton />
70
+ {/* <HelpWidgetButton /> */}
71
+
72
+ <Button
73
+ variant="text"
74
+ color="secondary"
75
+ startIcon={<HelpOutline />}
76
+ onClick={handleOpenFreshDeskWidget}
77
+ sx={{ padding: '20px' }}
78
+ >
79
+ Help
80
+ </Button>
62
81
  {cogWheelMenu?.length ? <CogWheelMenu menu={cogWheelMenu} /> : null}
63
82
  <UserBox fullName={fullName} actions={userBoxActions} />
64
83
  </Box>
@@ -38,16 +38,7 @@ export default function UserBox({
38
38
  )}
39
39
  menu={[
40
40
  ...actions,
41
- {
42
- label: 'My Tickets',
43
- actionType: 'dialog',
44
- content: ({ close }) => <MyTickets close={close} />,
45
- contentTitle: 'My Tickets',
46
- icon: <ConfirmationNumberOutlined />,
47
- dialogProps: {
48
- maxWidth: 'xl',
49
- },
50
- },
41
+
51
42
  {
52
43
  label: 'Change Password',
53
44
  actionType: 'dialog',