@campxdev/shared 1.11.70 → 1.11.72

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.70",
3
+ "version": "1.11.72",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,3 +1,4 @@
1
+ import Cookies from 'js-cookie'
1
2
  import { urlTenantKey } from '../../contexts/Providers'
2
3
  import { InstitutionsStore } from '../../shared-state/InstitutionsStore'
3
4
  import { SearchSingleSelect } from '../Input/SearchSingleSelect'
@@ -8,6 +9,7 @@ export default function SchoolSwitch() {
8
9
  const handleChange = (value) => {
9
10
  if (value) {
10
11
  localStorage.setItem('institution_key', value?.value)
12
+ Cookies.set('campx_institution', value?.value)
11
13
  window.location.replace(
12
14
  `${window.location.origin}/${urlTenantKey}/${value?.value}`,
13
15
  )
@@ -4,3 +4,11 @@ export const isNumber = (value: string) => {
4
4
 
5
5
  return isNum
6
6
  }
7
+
8
+ export const isInteger = (value: string) => {
9
+ const regEx = /^[-+]?\d*\.?\d+$/
10
+
11
+ let isInt = regEx.test(value)
12
+
13
+ return isInt
14
+ }