@campxdev/shared 0.5.5 → 0.5.7

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.5.5",
3
+ "version": "0.5.7",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -79,7 +79,7 @@ const MenuItem = ({data}) => {
79
79
  return (
80
80
  <StyledMenuItem>
81
81
  <Box>
82
- <img src={data.icon} style={{width: '28px', height: '28px'}} />
82
+ <img src={data.icon} style={{width: '32px', height: '32px'}} />
83
83
  </Box>
84
84
  <Box>
85
85
  <Typography variant='h1' sx={{marginBottom: '7px'}}>
@@ -0,0 +1,85 @@
1
+ import {isDevelopment} from '../../../constants'
2
+ import {
3
+ campxSquareSmall,
4
+ examsSmall,
5
+ hostelSmall,
6
+ paySmall,
7
+ peopleSmall,
8
+ } from './assets'
9
+
10
+ const origins = {
11
+ ums: {
12
+ dev: 'https://ums.campx.dev',
13
+ prod: 'https://ums.campx.in',
14
+ },
15
+ payments: {
16
+ dev: 'https://payments.campx.dev',
17
+ prod: 'https://payments.campx.in',
18
+ },
19
+ exams: {
20
+ dev: 'https://exams.campx.dev',
21
+ prod: 'https://exams.campx.in',
22
+ },
23
+ people: {
24
+ dev: 'https://people.campx.dev',
25
+ prod: 'https://people.campx.in',
26
+ },
27
+ hostel: {
28
+ dev: 'https://hostel.campx.dev',
29
+ prod: 'https://hostel.campx.in',
30
+ },
31
+ commute: {
32
+ dev: 'https://commute.campx.dev',
33
+ prod: 'https://commute.campx.in',
34
+ },
35
+ }
36
+
37
+ export const applications = [
38
+ {
39
+ title: 'CollegeX',
40
+ path: isDevelopment ? origins.ums.dev : origins.ums.prod,
41
+ icon: campxSquareSmall,
42
+ key: 'ums',
43
+ description: 'Manage Complete Campus Activities',
44
+ },
45
+ {
46
+ title: 'ExamX',
47
+ key: 'exams',
48
+ path: isDevelopment ? origins.exams.dev : origins.exams.prod,
49
+ icon: examsSmall,
50
+ description: 'Manage all Examinations in the Campus',
51
+ },
52
+ {
53
+ title: 'PayX',
54
+ key: 'payments',
55
+ path: isDevelopment ? origins.payments.dev : origins.payments.prod,
56
+ icon: paySmall,
57
+ description: 'Manage Online Payments in the Campus',
58
+ },
59
+ ...(isDevelopment && [
60
+ {
61
+ title: 'PeopleX',
62
+ path: isDevelopment ? origins.people.dev : origins.people.prod,
63
+ icon: peopleSmall,
64
+ description: 'Manage People in the Campus',
65
+ },
66
+ {
67
+ title: 'HostelX',
68
+ path: isDevelopment ? origins.hostel.dev : origins.hostel.prod,
69
+ icon: hostelSmall,
70
+ description: 'Manage Hostels in the Campus',
71
+ },
72
+ {
73
+ title: 'CommuteX',
74
+ path: isDevelopment ? origins.commute.dev : origins.commute.prod,
75
+ icon: hostelSmall,
76
+ description: 'Manage Commute in the Campus',
77
+ },
78
+ ]),
79
+ // {
80
+ // title: 'EnrollX',
81
+ // path: '/hostel',
82
+ // icon: enrollHeaderLogo,
83
+ // // description: 'Manage Admissions in the Campus',
84
+ // },
85
+ ]
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="320" height="320.001" viewBox="0 0 320 320.001">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#596e79"/>
5
+ <stop offset="1" stop-color="#7c909b"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <path id="Subtraction_37" data-name="Subtraction 37" d="M2495-5403H2175v-320h320v320Zm-260-260v200h200v-200Z" transform="translate(-2175 5723)" fill="url(#linear-gradient)"/>
9
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="310.624" height="320" viewBox="0 0 310.624 320">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#d86b00"/>
5
+ <stop offset="1" stop-color="#ed9035"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_4477" data-name="Group 4477" transform="translate(-342.295 -263.508)">
9
+ <path id="Subtraction_34" data-name="Subtraction 34" d="M310.612,320H233.034l-.016-.023L.015,320,0,319.977,38.785,266.6l.015.019L116.266,160,38.8,53.383l-.015.022L0,.024.015,0H310.609l.015.024L271.837,53.4l-.016-.022L194.354,160l77.467,106.615.016-.019,38.788,53.38-.016.022Zm-155.3-106.994-32.527,44.782,65-.04-32.476-44.742ZM122.788,62.154l32.525,44.783,32.476-44.742-65-.041Z" transform="translate(342.295 263.508)" fill="url(#linear-gradient)"/>
10
+ <rect id="Rectangle_4307" data-name="Rectangle 4307" width="3.696" height="133.935" transform="translate(495.759 356.565)" fill="#fff"/>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="464.103" height="320" viewBox="0 0 464.103 320">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#573dab"/>
5
+ <stop offset="1" stop-color="#7251dd"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_4511" data-name="Group 4511" transform="translate(-270.758 -251.98)">
9
+ <path id="Subtraction_9" data-name="Subtraction 9" d="M79.763,164.484H.016L0,164.46l39.875-54.878.015.021L118.681,1.165,157.727,54.9l.015-.021.827,1.138L79.763,164.483ZM198.442,1.137h0L197.615,0h.431l.8.58-.4.555Z" transform="translate(384.15 407.496)" fill="url(#linear-gradient)"/>
10
+ <path id="Union_40" data-name="Union 40" d="M79.765,320H.017L0,319.974,39.878,265.1l.013.019,78.793-108.439.185.253,34.4-47.349.016.022,78.79-108.44.389.534.239-.333L350.791,163.9l-.077.058,73.5,101.155.016-.019L464.1,319.974l-.017.023H384.339L305.533,211.531l.031-.042L265.677,156.63l-.014.019,0,0v0l-.4-.554.02-.014-7.844-10.789.1.016-25.226-34.717-39.155,53.891h-.379l-35.728,49.138L79.765,320v0ZM152.94,1.392l-1-1.367L151.96,0h1.991L152.94,1.392v0Zm158.893-.256L311.008,0h.431l.8.583-.4.554Z" transform="translate(270.757 251.98)" fill="url(#linear-gradient)"/>
11
+ <path id="Subtraction_10" data-name="Subtraction 10" d="M198.046,164.484h-78.52L40.883,56.246,80.756,1.366,198.845,163.9l-.8.58ZM1,1.393h0L0,.024.015,0H2.006L1,1.392Z" transform="translate(422.701 407.495)" fill="url(#linear-gradient)"/>
12
+ </g>
13
+ </svg>
@@ -1,25 +1,23 @@
1
- import collegex from "./campx.png";
2
- const enrollx = require("./enrollx.png");
3
- import examx from "./newexamx.png";
4
- import payx from "./newpayx.png";
5
- const peoplex = require("./peoplex.png");
6
- import campxHeaderlogo from "./CampxHeader.svg";
7
- import examHeaderLogo from "./examxHeader.svg";
8
- import peopleHeaderLogo from "./peoplexHeader.svg";
9
- import payHeaderLogo from "./payxHeader.svg";
10
- import enrollHeaderLogo from "./enrollxHeader.svg";
11
- import hostelHeaderLogo from "./hostelxHeader.svg";
1
+ import collegex from './campx.png'
2
+ const enrollx = require('./enrollx.png')
3
+ import examx from './newexamx.png'
4
+ import payx from './newpayx.png'
5
+ const peoplex = require('./peoplex.png')
6
+ import campxSquareSmall from './campx_square_small.svg'
7
+ import examsSmall from './exams_small.svg'
8
+ import paySmall from './pay_small.svg'
9
+ import peopleSmall from './people_small.svg'
10
+ import hostelSmall from './hostel_small.svg'
12
11
 
13
12
  export {
14
- collegex,
15
- enrollx,
16
- examx,
17
- payx,
18
- peoplex,
19
- campxHeaderlogo,
20
- examHeaderLogo,
21
- peopleHeaderLogo,
22
- payHeaderLogo,
23
- enrollHeaderLogo,
24
- hostelHeaderLogo,
25
- };
13
+ collegex,
14
+ enrollx,
15
+ examx,
16
+ payx,
17
+ peoplex,
18
+ campxSquareSmall,
19
+ examsSmall,
20
+ paySmall,
21
+ peopleSmall,
22
+ hostelSmall,
23
+ }
@@ -0,0 +1,16 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="225.228" height="320" viewBox="0 0 225.228 320">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.222" y1="1" x2="0.787" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#88b053"/>
5
+ <stop offset="1" stop-color="#50840b"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_4464" data-name="Group 4464" transform="translate(-1597.6 -781.55)">
9
+ <g id="Group_4461" data-name="Group 4461" transform="translate(1597.6 781.55)">
10
+ <g id="Group_4460" data-name="Group 4460" transform="translate(0 0)">
11
+ <path id="Subtraction_8" data-name="Subtraction 8" d="M79.79,164.485,198.873.58l-.8-.58H119.553L39.916,109.605l-.015-.022L.026,164.462l.015.023H79.79Z" transform="translate(26.355 155.515)" fill="url(#linear-gradient)"/>
12
+ <path id="Subtraction_8-2" data-name="Subtraction 8" d="M119.109,0,.026,163.9l.8.58H79.346L158.983,54.88,159,54.9,198.873.023,198.858,0H119.109Z" transform="translate(-0.026 0)" fill="url(#linear-gradient)"/>
13
+ </g>
14
+ </g>
15
+ </g>
16
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="426.29" height="320.001" viewBox="0 0 426.29 320.001">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#d0002b"/>
5
+ <stop offset="1" stop-color="#ea4a6b"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <path id="Union_42" data-name="Union 42" d="M-1429.646-7174l-50.322-69.259-9.444,13,40.5,55.514-1.027.747h-182.829l-.021-.03,40.96-56.372-9.342-12.857L-1651.493-7174h-102.486l-.021-.03,51.243-70.524.019.026,101.257-139.358.5.683,0,0,60.424,82.832,60.775-82.837.006.008.306-.421,151.761,208.879-1.027.747Zm-92.314-279.665v0A40.334,40.334,0,0,1-1481.627-7494a40.335,40.335,0,0,1,40.334,40.334v0a40.335,40.335,0,0,1-40.334,40.333A40.333,40.333,0,0,1-1521.96-7453.664Zm-119.905,0v0A40.334,40.334,0,0,1-1601.532-7494a40.335,40.335,0,0,1,40.334,40.334v0a40.335,40.335,0,0,1-40.334,40.333A40.333,40.333,0,0,1-1641.865-7453.664Z" transform="translate(1753.999 7494)" fill="url(#linear-gradient)"/>
9
+ </svg>
@@ -15,7 +15,8 @@ import {
15
15
  StyledChevronIcon,
16
16
  StyledListItemButton,
17
17
  } from './ListItemButton'
18
- const accessIfNoKey = process.env.NODE_ENV === 'development' ? true : false
18
+ const accessIfNoKey = process.env.NODE_ENV === 'development' ? false : false
19
+
19
20
  const StyledLink = styled(Link)({
20
21
  textDecoration: 'none',
21
22
  })
@@ -100,11 +101,7 @@ const DropDownMenu = ({path, title, icon, menuItems, permissionKey}) => {
100
101
  return arr.includes(true)
101
102
  }
102
103
 
103
- const hasAccess = permissionKey ? permissions[permissionKey] : accessIfNoKey
104
-
105
- const dropdownAccess = menuItems?.length
106
- ? validateDropdownAccess()
107
- : hasAccess
104
+ const dropdownAccess = validateDropdownAccess()
108
105
 
109
106
  if (!dropdownAccess) return null
110
107
  return (
@@ -1,74 +0,0 @@
1
- import GiteTwoToneIcon from "@mui/icons-material/GiteTwoTone";
2
- import SchoolRoundedIcon from "@mui/icons-material/SchoolRounded";
3
- import AssignmentRoundedIcon from "@mui/icons-material/AssignmentRounded";
4
- import AccountBalanceWalletRoundedIcon from "@mui/icons-material/AccountBalanceWalletRounded";
5
- import PersonRoundedIcon from "@mui/icons-material/PersonRounded";
6
- import {
7
- campxHeaderlogo,
8
- enrollHeaderLogo,
9
- hostelHeaderLogo,
10
- payHeaderLogo,
11
- examHeaderLogo,
12
- peopleHeaderLogo,
13
- } from "./assets";
14
-
15
- const isDev =
16
- process.env.NODE_ENV === "development" ||
17
- window.location.origin.split(".").slice(-2).join(".") === "campx.dev";
18
-
19
- const origins = {
20
- ums: {
21
- dev: "https://ums.campx.dev",
22
- prod: "https://ums.campx.in",
23
- },
24
- payments: {
25
- dev: "https://payments.campx.dev",
26
- prod: "https://payments.campx.in",
27
- },
28
- exams: {
29
- dev: "https://exams.campx.dev",
30
- prod: "https://exams.campx.in",
31
- },
32
- };
33
-
34
- export const applications = [
35
- {
36
- title: "CollegeX",
37
- path: isDev ? origins.ums.dev : origins.ums.prod,
38
- icon: campxHeaderlogo,
39
- key: "ums",
40
- description: "Manage Complete Campus Activities",
41
- },
42
- {
43
- title: "ExamX",
44
- key: "exams",
45
- path: isDev ? origins.exams.dev : origins.exams.prod,
46
- icon: examHeaderLogo,
47
- description: "Manage all Examinations in the Campus",
48
- },
49
- {
50
- title: "PayX",
51
- key: "payments",
52
- path: isDev ? origins.payments.dev : origins.payments.prod,
53
- icon: payHeaderLogo,
54
- description: "Manage Online Payments in the Campus",
55
- },
56
- // {
57
- // title: 'PeopleX',
58
- // path: '/people',
59
- // icon: peopleHeaderLogo,
60
- // // description: 'Manage People in the Campus',
61
- // },
62
- // {
63
- // title: 'HostelX',
64
- // path: '/hostel',
65
- // icon: hostelHeaderLogo,
66
- // // description: 'Manage Hostels in the Campus',
67
- // },
68
- // {
69
- // title: 'EnrollX',
70
- // path: '/hostel',
71
- // icon: enrollHeaderLogo,
72
- // // description: 'Manage Admissions in the Campus',
73
- // },
74
- ];
@@ -1,14 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40">
2
- <defs>
3
- <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
- <stop offset="0" stop-color="#596e79"/>
5
- <stop offset="1" stop-color="#7c909b"/>
6
- </linearGradient>
7
- </defs>
8
- <g id="Group_4497" data-name="Group 4497" transform="translate(-325 -234.99)">
9
- <g id="Group_4480" data-name="Group 4480" transform="translate(325 234.99)">
10
- <path id="Subtraction_36" data-name="Subtraction 36" d="M40,40H34.286V38.857h4.571V1.143H34.286V0H5.714V1.143H1.143V38.857H5.714V40H0V0H40V40Z" fill="#121212"/>
11
- </g>
12
- <path id="Subtraction_37" data-name="Subtraction 37" d="M22.857,22.857H0V0H22.857V22.856ZM4.571,4.571V18.286H18.285V4.571Z" transform="translate(333.571 243.563)" fill="url(#linear-gradient)"/>
13
- </g>
14
- </svg>
@@ -1,14 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40">
2
- <defs>
3
- <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
- <stop offset="0" stop-color="#007ab1"/>
5
- <stop offset="1" stop-color="#149ecd"/>
6
- </linearGradient>
7
- </defs>
8
- <g id="Group_4502" data-name="Group 4502" transform="translate(-325 -234.99)">
9
- <path id="Union_6" data-name="Union 6" d="M0,22.857H0v0l2.771-3.813v0L8.3,11.429h5.456l.056.04L5.542,22.857Zm10.238-4.581,4.975-6.848h5.456l.055.04-4.946,6.807Zm10.431-6.848h0Zm0,0H15.213L10.23,4.571h5.541l4.953,6.817Zm-12.364,0L2.772,3.813h0L0,0V0H5.542l8.274,11.388-.056.04ZM12.452,0h0ZM12.452,0ZM6.909,0h0V0H12.45l0,0H6.909ZM0,0H0Z" transform="translate(334.695 243.514)" fill="url(#linear-gradient)"/>
10
- <g id="Group_4480" data-name="Group 4480" transform="translate(325 234.99)">
11
- <path id="Subtraction_36" data-name="Subtraction 36" d="M40,40H34.286V38.857h4.571V1.143H34.286V0H5.714V1.143H1.143V38.857H5.714V40H0V0H40V40Z" fill="#121212"/>
12
- </g>
13
- </g>
14
- </svg>
@@ -1,17 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40">
2
- <defs>
3
- <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
- <stop offset="0" stop-color="#d86b00"/>
5
- <stop offset="1" stop-color="#ed9035"/>
6
- </linearGradient>
7
- </defs>
8
- <g id="Group_4499" data-name="Group 4499" transform="translate(-325 -234.99)">
9
- <g id="Group_4480" data-name="Group 4480" transform="translate(325 234.99)">
10
- <path id="Subtraction_36" data-name="Subtraction 36" d="M40,40H34.286V38.857h4.571V1.143H34.286V0H5.714V1.143H1.143V38.857H5.714V40H0V0H40V40Z" fill="#121212"/>
11
- <g id="Group_4477" data-name="Group 4477" transform="translate(8.906 8.571)">
12
- <path id="Subtraction_34" data-name="Subtraction 34" d="M22.187,22.857H16.645v0L0,22.857v0l2.77-3.813h0L8.3,11.429,2.772,3.813v0L0,0V0H22.186V0L19.417,3.815v0l-5.533,7.615,5.533,7.615h0l2.771,3.813v0ZM11.094,15.215l-2.323,3.2,4.643,0-2.32-3.2ZM8.771,4.44l2.323,3.2,2.32-3.2-4.643,0Z" fill="url(#linear-gradient)"/>
13
- <rect id="Rectangle_4307" data-name="Rectangle 4307" width="0.264" height="9.567" transform="translate(10.962 6.647)" fill="#fff"/>
14
- </g>
15
- </g>
16
- </g>
17
- </svg>
@@ -1,18 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40">
2
- <defs>
3
- <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
- <stop offset="0" stop-color="#25009f"/>
5
- <stop offset="1" stop-color="#573dab"/>
6
- </linearGradient>
7
- </defs>
8
- <g id="Group_4501" data-name="Group 4501" transform="translate(-325 -234.99)">
9
- <g id="Group_4479" data-name="Group 4479" transform="translate(330.082 244.583)">
10
- <path id="Subtraction_9" data-name="Subtraction 9" d="M5.128,10.574H0L2.563,7.045h0L7.63.075l2.51,3.454h0l.053.073L5.128,10.574ZM12.757.073h0L12.7,0h.028l.051.037-.026.036Z" transform="translate(7.29 9.998)" fill="url(#linear-gradient)"/>
11
- <path id="Union_18" data-name="Union 18" d="M24.708,20.571,19.642,13.6l0,0-2.564-3.527h0l-.026-.036h0l-.5-.694h.007L14.934,7.109l-2.517,3.465h-.024L9.928,13.965l-4.8,6.606H0l2.563-3.528h0L7.63,10.073l.012.016L9.853,7.045h0L14.919.075l.025.034.015-.021,7.592,10.449-.005,0,4.725,6.5h0l2.563,3.528H24.708ZM9.768,0H9.9L9.832.09ZM20.047.073,19.994,0h.028l.052.037-.026.036Z" transform="translate(0)" fill="url(#linear-gradient)"/>
12
- <path id="Subtraction_10" data-name="Subtraction 10" d="M12.732,10.574H7.684L2.628,3.616,5.191.088l7.592,10.449-.051.037ZM.064.09h0L0,0V0H.129L.064.089Z" transform="translate(9.768 9.998)" fill="url(#linear-gradient)"/>
13
- </g>
14
- <g id="Group_4480" data-name="Group 4480" transform="translate(325 234.99)">
15
- <path id="Subtraction_36" data-name="Subtraction 36" d="M40,40H34.286V38.857h4.571V1.143H34.286V0H5.714V1.143H1.143V38.857H5.714V40H0V0H40V40Z" fill="#121212"/>
16
- </g>
17
- </g>
18
- </svg>