@canmingir/link 1.2.26 → 1.2.27

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": "@canmingir/link",
3
- "version": "1.2.26",
3
+ "version": "1.2.27",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
package/src/Platform.jsx CHANGED
@@ -51,6 +51,7 @@ const Platform = ({ routes }) => {
51
51
  themeLayout: "vertical",
52
52
  themeColorPresets: template.theme.colorPresets || "default",
53
53
  themeStretch: false,
54
+ beta: false,
54
55
  }}
55
56
  >
56
57
  <ThemeProvider>
@@ -1,2 +1,3 @@
1
1
  import useApi from "./useApi";
2
- export { useApi };
2
+ import useBeta from "./use-beta";
3
+ export { useApi, useBeta };
@@ -0,0 +1,8 @@
1
+ import { useSettingsContext } from "../components/settings/context";
2
+
3
+ const useBeta = () => {
4
+ const { beta } = useSettingsContext();
5
+ return beta;
6
+ };
7
+
8
+ export default useBeta;
@@ -2,6 +2,7 @@ import Iconify from "../components/Iconify";
2
2
  import config from "../config/config";
3
3
  import { useEvent } from "@nucleoidai/react-event";
4
4
  import useSettings from "../hooks/useSettings";
5
+ import { useSettingsContext } from "../components/settings/context";
5
6
  import { useUser } from "../hooks/use-user";
6
7
 
7
8
  import {
@@ -20,6 +21,7 @@ import {
20
21
  ListItemText,
21
22
  NativeSelect,
22
23
  Stack,
24
+ Switch,
23
25
  Tab,
24
26
  Tabs,
25
27
  TextField,
@@ -282,6 +284,7 @@ const Permission = () => {
282
284
  const Settings = () => {
283
285
  const projectId = localStorage.getItem("projectId");
284
286
  const { settings, updateSettings } = useSettings(projectId);
287
+ const { beta, onUpdate } = useSettingsContext();
285
288
 
286
289
  const timeZones = [
287
290
  "Asia/Kolkata",
@@ -333,6 +336,20 @@ const Settings = () => {
333
336
  </NativeSelect>
334
337
  </FormControl>
335
338
  </ListItem>
339
+ <ListItem
340
+ sx={{
341
+ backgroundColor: "background.paper",
342
+ boxShadow: 1,
343
+ borderRadius: 1,
344
+ m: 1,
345
+ p: 2,
346
+ ":hover": { boxShadow: 3 },
347
+ transition: "all 0.2s ease-in-out",
348
+ }}
349
+ >
350
+ <ListItemText primary="Beta" secondary="Enable beta features" />
351
+ <Switch checked={beta} onChange={() => onUpdate("beta", !beta)} />
352
+ </ListItem>
336
353
  </List>
337
354
  </Stack>
338
355
  );