@campxdev/shared 1.11.18 → 1.11.20

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.11.18",
3
+ "version": "1.11.20",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -36,6 +36,7 @@ interface AppHeaderProps {
36
36
  clientLogo: string
37
37
  fullName: string
38
38
  profileUrl?: string
39
+ actions?: ReactNode[]
39
40
  userBoxActions: {
40
41
  label: ReactNode
41
42
  icon?: ReactNode
@@ -52,6 +53,7 @@ export default function AppHeader({
52
53
  cogWheelMenu = [],
53
54
  customHeaderActions,
54
55
  profileUrl,
56
+ actions = [],
55
57
  }: AppHeaderProps) {
56
58
  return (
57
59
  <StyledHeader>
@@ -68,6 +70,7 @@ export default function AppHeader({
68
70
  fullName={fullName}
69
71
  userBoxActions={userBoxActions}
70
72
  profileUrl={profileUrl}
73
+ actions={actions}
71
74
  />
72
75
  )}
73
76
  </Box>
@@ -1,8 +1,10 @@
1
1
  import HelpOutlineIcon from '@mui/icons-material/HelpOutline'
2
2
  import { IconButton, Stack } from '@mui/material'
3
+ import { ReactNode } from 'react'
3
4
  import { useNavigate } from 'react-router-dom'
4
- import { CareerIcon, ExamResultIcon } from '../../../../assets/icons'
5
+ import { IMenuItemProps } from '../../../DropDownButton/DropdownMenuItem'
5
6
  import InstitutionsDropDown from '../../../Institutions/InstitutionsDropdown'
7
+ import CogWheelMenu from './CogWheelMenu'
6
8
  import UserBox from './UserBox'
7
9
 
8
10
  const profileMenu = [
@@ -15,6 +17,13 @@ export default function HeaderActions({
15
17
  fullName,
16
18
  userBoxActions,
17
19
  profileUrl = '',
20
+ actions = [],
21
+ }: {
22
+ cogWheelMenu?: any[]
23
+ fullName: string
24
+ userBoxActions: IMenuItemProps[] | []
25
+ profileUrl: string
26
+ actions?: ReactNode[]
18
27
  }) {
19
28
  const navigate = useNavigate()
20
29
  return (
@@ -30,21 +39,9 @@ export default function HeaderActions({
30
39
  >
31
40
  <HelpOutlineIcon />
32
41
  </IconButton>
33
- <IconButton
34
- onClick={() => {
35
- navigate('/careers')
36
- }}
37
- >
38
- <CareerIcon />
39
- </IconButton>
40
- <IconButton
41
- onClick={() => {
42
- navigate('/results')
43
- }}
44
- >
45
- <ExamResultIcon />
46
- </IconButton>
47
- {/* {cogWheelMenu?.length ? <CogWheelMenu menu={cogWheelMenu} /> : null} */}
42
+
43
+ {actions.map((action, index) => action)}
44
+ {cogWheelMenu?.length ? <CogWheelMenu menu={cogWheelMenu} /> : null}
48
45
  <UserBox
49
46
  fullName={fullName}
50
47
  actions={userBoxActions}
@@ -87,7 +87,6 @@ const MyProfile = ({ close }) => {
87
87
  ''
88
88
  }
89
89
  }
90
- console.log(userProfile)
91
90
 
92
91
  return (
93
92
  <>
@@ -1,39 +0,0 @@
1
- export const ExamResultIcon = () => {
2
- return (
3
- <>
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- width="15.3"
7
- height="20.3"
8
- viewBox="0 0 15.3 20.3"
9
- >
10
- <path
11
- id="mobile"
12
- d="M13.833,0H7.167A4.172,4.172,0,0,0,3,4.167V15.833A4.172,4.172,0,0,0,7.167,20h6.667A4.172,4.172,0,0,0,18,15.833V4.167A4.172,4.172,0,0,0,13.833,0Zm2.5,15.833a2.5,2.5,0,0,1-2.5,2.5h-2.5V17.5a.833.833,0,1,0-1.667,0v.833h-2.5a2.5,2.5,0,0,1-2.5-2.5V4.167a2.5,2.5,0,0,1,2.5-2.5h6.667a2.5,2.5,0,0,1,2.5,2.5Zm-2.5-2.5a.833.833,0,0,1-.833.833H8A.833.833,0,1,1,8,12.5h5A.833.833,0,0,1,13.833,13.333Zm-5-2.5A.833.833,0,0,0,9.667,10V9.167h1.667V10A.833.833,0,0,0,13,10V6.667a2.5,2.5,0,1,0-5,0V10A.833.833,0,0,0,8.833,10.833Zm1.667-5a.833.833,0,0,1,.833.833V7.5H9.667V6.667A.833.833,0,0,1,10.5,5.833Z"
13
- transform="translate(-2.85 0.15)"
14
- stroke="#fff"
15
- stroke-width="0.3"
16
- />
17
- </svg>
18
- </>
19
- )
20
- }
21
-
22
- export const CareerIcon = () => {
23
- return (
24
- <svg
25
- xmlns="http://www.w3.org/2000/svg"
26
- width="20.3"
27
- height="20.3"
28
- viewBox="0 0 20.3 20.3"
29
- >
30
- <path
31
- id="briefcase"
32
- d="M15.833,3.333h-.917A4.174,4.174,0,0,0,10.833,0H9.167A4.174,4.174,0,0,0,5.083,3.333H4.167A4.172,4.172,0,0,0,0,7.5v8.333A4.172,4.172,0,0,0,4.167,20H15.833A4.172,4.172,0,0,0,20,15.833V7.5a4.172,4.172,0,0,0-4.167-4.167ZM9.167,1.667h1.667A2.5,2.5,0,0,1,13.18,3.333H6.82A2.5,2.5,0,0,1,9.167,1.667ZM4.167,5H15.833a2.5,2.5,0,0,1,2.5,2.5V10H1.667V7.5A2.5,2.5,0,0,1,4.167,5ZM15.833,18.333H4.167a2.5,2.5,0,0,1-2.5-2.5V11.667h7.5V12.5a.833.833,0,0,0,1.667,0v-.833h7.5v4.167A2.5,2.5,0,0,1,15.833,18.333Z"
33
- transform="translate(0.15 0.15)"
34
- stroke="#fff"
35
- stroke-width="0.3"
36
- />
37
- </svg>
38
- )
39
- }