@campxdev/shared 0.2.8 → 0.2.10

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": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -22,8 +22,8 @@ const imageMap = {
22
22
  const isDev = process.env.NODE_ENV === 'development'
23
23
 
24
24
  export default function AppHeader({title}: {title?: string}) {
25
- const originSubdomain = `https://www.exams.ums.in`.split('.')?.slice(-3)[0]
26
- console.log(originSubdomain)
25
+ const originSubdomain =
26
+ window.location.origin.split('.')?.slice(-3)[0] ?? 'ums'
27
27
  const currentApp =
28
28
  applications.find((item) => item.key === originSubdomain)?.key ?? 'local'
29
29
 
@@ -38,15 +38,9 @@ export default function AppHeader({title}: {title?: string}) {
38
38
  ) : (
39
39
  <StyledImageWrapper>
40
40
  {isDev ? (
41
- <Typography variant='h6'>CampX</Typography>
41
+ <img src={imageMap.ums} />
42
42
  ) : (
43
- <img
44
- src={imageMap[currentApp]}
45
- style={{
46
- width: '200px',
47
- height: 'auto',
48
- }}
49
- />
43
+ <img src={imageMap[currentApp]} />
50
44
  )}
51
45
  </StyledImageWrapper>
52
46
  )}
@@ -1,48 +1,47 @@
1
- import { AppBar, Box, ListItemText, styled } from '@mui/material'
1
+ import {AppBar, Box, ListItemText, styled} from '@mui/material'
2
2
 
3
3
  export const StyledImageWrapper = styled('div')`
4
- width: auto;
5
- height: 24px;
6
- & img {
7
- width: 100%;
8
- height: 100%;
9
- object-fit: contain;
10
- }
4
+ width: 140px;
5
+ & img {
6
+ width: 100%;
7
+ height: 100%;
8
+ object-fit: contain;
9
+ }
11
10
  `
12
11
 
13
- export const StyledItemText = styled(ListItemText)(({ theme }) => ({
14
- color: theme.palette.text.primary,
15
- transition: '0.2s ease',
12
+ export const StyledItemText = styled(ListItemText)(({theme}) => ({
13
+ color: theme.palette.text.primary,
14
+ transition: '0.2s ease',
16
15
  }))
17
16
 
18
- export const StyledAppBar = styled(AppBar)(({ theme }) => ({
19
- backgroundColor: 'white',
20
- boxShadow: '0px 8px 28px rgb(136,136,136, 0.3)',
17
+ export const StyledAppBar = styled(AppBar)(({theme}) => ({
18
+ backgroundColor: 'white',
19
+ boxShadow: '0px 8px 28px rgb(136,136,136, 0.3)',
21
20
  }))
22
21
 
23
- export const StyledHeader = styled(Box)(({ theme }) => ({
24
- boxShadow: '0px 2px 10px #0000001a',
25
- // padding: '0 1rem',
26
- backgroundColor: 'white',
27
- display: 'flex',
28
- alignItems: 'center',
29
- justifyContent: 'space-between',
30
- '& .actions': {
31
- display: 'flex',
32
- alignItems: 'center',
33
- gap: '14px',
34
- },
22
+ export const StyledHeader = styled(Box)(({theme}) => ({
23
+ boxShadow: '0px 2px 10px #0000001a',
24
+ // padding: '0 1rem',
25
+ backgroundColor: 'white',
26
+ display: 'flex',
27
+ alignItems: 'center',
28
+ justifyContent: 'space-between',
29
+ '& .actions': {
30
+ display: 'flex',
31
+ alignItems: 'center',
32
+ gap: '14px',
33
+ },
35
34
  }))
36
35
 
37
- export const StyledUser = styled(Box)(({ theme }) => ({
38
- cursor: 'pointer',
39
- borderRadius: '5px',
40
- transition: 'background 0.2s ease',
41
- padding: '5px 10px',
42
- display: 'flex',
43
- alignItems: 'center',
44
- gap: '10px',
45
- '&:hover': {
46
- background: theme.palette.secondary.light,
47
- },
36
+ export const StyledUser = styled(Box)(({theme}) => ({
37
+ cursor: 'pointer',
38
+ borderRadius: '5px',
39
+ transition: 'background 0.2s ease',
40
+ padding: '5px 10px',
41
+ display: 'flex',
42
+ alignItems: 'center',
43
+ gap: '10px',
44
+ '&:hover': {
45
+ background: theme.palette.secondary.light,
46
+ },
48
47
  }))
@@ -4,7 +4,9 @@ import {toast} from 'react-toastify'
4
4
  import {globalStore} from '../shared-state/GlobalStore'
5
5
  import Cookies from 'js-cookie'
6
6
 
7
- const isDevelopment = process.env.NODE_ENV === 'development'
7
+ const isDevelopment =
8
+ process.env.NODE_ENV === 'development' ||
9
+ window.location.origin.split('.').slice(-2).join('.') === 'campx.dev'
8
10
  const sessionKey = Cookies.get('campx_session_key')
9
11
 
10
12
  const formatParams = (params) => {