MSP-3074 add roles

This commit is contained in:
Anastasiia committed 2024-04-01 18:16:00 +03:00
1 parent 5a29bfc7f6
commit 9c1b859971
36 files changed
+1063 -100

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
declare global {
interface Window {
config?: any;
}
}
export const getConfigProperty = (property: string, defaultValue: any) => {
if (window.config && Object.prototype.hasOwnProperty.call(window.config, property)) {
return window.config[property];
}
return defaultValue;
};
+20
View File
@@ -0,0 +1,20 @@
export const LocalStorage = {
set(key: string, value: any): void {
const item = typeof value === 'string' ? value : JSON.stringify(value);
localStorage.setItem(key, item);
},
get(key: string): any | null {
const value = localStorage.getItem(key);
try {
return value ? JSON.parse(value) : null;
} catch (error) {
return value;
}
},
remove(key: string): void {
localStorage.removeItem(key);
},
clear(): void {
localStorage.clear();
},
};