@campxdev/shared 0.2.14 → 0.2.15
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
|
@@ -2,6 +2,7 @@ import {Box, styled, Typography} from '@mui/material'
|
|
|
2
2
|
import {ReactNode} from 'react'
|
|
3
3
|
import {Link} from 'react-router-dom'
|
|
4
4
|
import {campxLogoPrimary} from '../../../assets/images'
|
|
5
|
+
import {isDevelopment} from '../../../constants/isDevelopment'
|
|
5
6
|
import {applications} from './applications'
|
|
6
7
|
import AppsMenu from './AppsMenu'
|
|
7
8
|
import {collegex, enrollx, examx, payx, peoplex} from './assets'
|
|
@@ -49,8 +50,6 @@ interface AppHeaderProps {
|
|
|
49
50
|
cogWheelMenu?: {label: string; path: string}[]
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
const isDev = process.env.NODE_ENV === 'development'
|
|
53
|
-
|
|
54
53
|
export default function AppHeader({
|
|
55
54
|
clientLogo = imageMap.campx,
|
|
56
55
|
username,
|
|
@@ -68,7 +67,7 @@ export default function AppHeader({
|
|
|
68
67
|
<Box className='actions'>
|
|
69
68
|
<FreshDeskHelpButton />
|
|
70
69
|
<Notification />
|
|
71
|
-
{cogWheelMenu?.length
|
|
70
|
+
{cogWheelMenu?.length ? <CogWheelMenu menu={cogWheelMenu} /> : null}
|
|
72
71
|
<UserBox
|
|
73
72
|
username={username}
|
|
74
73
|
profileIcon={profileIcon}
|
|
@@ -80,16 +79,17 @@ export default function AppHeader({
|
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
const AppLogo = ({clientLogo}) => {
|
|
83
|
-
const originSubdomain =
|
|
84
|
-
window.location.origin.split('.')?.slice(-3)[0] ?? 'ums'
|
|
82
|
+
const originSubdomain = window.location.host.split('.')?.slice(-3)[0] ?? 'ums'
|
|
85
83
|
const currentApp =
|
|
86
|
-
applications.find((item) => item.key === originSubdomain)?.key ?? '
|
|
84
|
+
applications.find((item) => item.key === originSubdomain)?.key ?? 'campx'
|
|
85
|
+
|
|
86
|
+
console.log('App Name', currentApp)
|
|
87
87
|
|
|
88
88
|
return (
|
|
89
89
|
<StyledLink to={'/'}>
|
|
90
90
|
<StyledLogosWrapper>
|
|
91
91
|
<StyledImageWrapper>
|
|
92
|
-
{
|
|
92
|
+
{isDevelopment ? (
|
|
93
93
|
<img src={imageMap.campx} />
|
|
94
94
|
) : (
|
|
95
95
|
<img src={imageMap[currentApp]} />
|
|
@@ -103,7 +103,7 @@ const AppLogo = ({clientLogo}) => {
|
|
|
103
103
|
}}
|
|
104
104
|
></Box>
|
|
105
105
|
<StyledImageWrapper>
|
|
106
|
-
{
|
|
106
|
+
{isDevelopment ? (
|
|
107
107
|
<Typography variant='h1'>Developer</Typography>
|
|
108
108
|
) : (
|
|
109
109
|
<img
|