@asaleh37/ui-base 25.12.172 → 25.12.181

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": "@asaleh37/ui-base",
3
- "version": "25.12.172",
3
+ "version": "25.12.181",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -30,10 +30,10 @@ const AttachmentImageViewer: React.FC<AttachmentImageViewerProps> = (props) => {
30
30
  setImgSrc(imagePath);
31
31
  };
32
32
  useEffect(() => {
33
- if (props?.refKey) {
33
+ if (props?.refKey || props?.attachmentId) {
34
34
  handleImageSrc();
35
35
  }
36
- }, [props.refKey]);
36
+ }, [props.refKey, props?.attachmentId]);
37
37
  {
38
38
  /* </Avatar>
39
39
  src={imgSrc}
@@ -202,35 +202,40 @@ const TopBar: React.FC = () => {
202
202
  : currentOrganization?.organizationArName
203
203
  }`}
204
204
  </Typography>
205
- <Tooltip
206
- title={
207
- AppLayout.themeMode === "light"
208
- ? "Switch Theme to Dark"
209
- : "Switch Theme to Light"
210
- }
211
- >
212
- <IconButton
213
- sx={{ mx: 1 }}
214
- color="inherit"
215
- onClick={() => {
216
- dispatch(
217
- AppLayoutActions.setThemeMode(
218
- AppLayout.themeMode === "light" ? "dark" : "light"
219
- )
220
- );
221
- localStorage.setItem(
222
- "themeMode",
223
- AppLayout.themeMode === "light" ? "dark" : "light"
224
- );
225
- }}
205
+ {AppInfo.allowThemeChange ? (
206
+ <Tooltip
207
+ title={
208
+ AppLayout.themeMode === "light"
209
+ ? "Switch Theme to Dark"
210
+ : "Switch Theme to Light"
211
+ }
226
212
  >
227
- {AppLayout.themeMode === "light" ? (
228
- <FontAwesomeIcon icon="moon" />
229
- ) : (
230
- <FontAwesomeIcon icon={{ prefix: "far", iconName: "sun" }} />
231
- )}
232
- </IconButton>
233
- </Tooltip>
213
+ <IconButton
214
+ sx={{ mx: 1 }}
215
+ color="inherit"
216
+ onClick={() => {
217
+ dispatch(
218
+ AppLayoutActions.setThemeMode(
219
+ AppLayout.themeMode === "light" ? "dark" : "light"
220
+ )
221
+ );
222
+ localStorage.setItem(
223
+ "themeMode",
224
+ AppLayout.themeMode === "light" ? "dark" : "light"
225
+ );
226
+ }}
227
+ >
228
+ {AppLayout.themeMode === "light" ? (
229
+ <FontAwesomeIcon icon="moon" />
230
+ ) : (
231
+ <FontAwesomeIcon icon={{ prefix: "far", iconName: "sun" }} />
232
+ )}
233
+ </IconButton>
234
+ </Tooltip>
235
+ ) : (
236
+ <></>
237
+ )}
238
+
234
239
  {AppInfo.isLocalizationEnabled ? (
235
240
  <Tooltip
236
241
  title={
@@ -21,6 +21,8 @@ export type AppInfo = {
21
21
  ar: { [key: string]: string };
22
22
  en: { [key: string]: string };
23
23
  };
24
+ appThemeMode: "dark" | "light";
25
+ allowThemeChange?: boolean;
24
26
  loginScreenStyle?: {
25
27
  themeMode: "dark" | "light";
26
28
  backgroundImageNameInPublicFolder?: string;
@@ -68,6 +70,8 @@ const initialState: AppInfoProp = {
68
70
  businessNavigationItems: [],
69
71
  businessReduxReducers: {},
70
72
  businessCommonStoresMetaData: {},
73
+ appThemeMode: "light",
74
+ allowThemeChange: true,
71
75
  appTheme: {
72
76
  light: { primaryColor: "#37505C", secondaryColor: "#ff6d00" },
73
77
  dark: { primaryColor: "#ea690e", secondaryColor: "#74776B" },