@equinor/mad-core 0.3.7 → 0.3.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @equinor/mad-core
2
2
 
3
+ ## 0.3.8
4
+
5
+ ### Patch Changes
6
+
7
+ - ea920f3: feat: you're now able to add custom settings
8
+
3
9
  ## 0.3.7
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -285,6 +285,15 @@ export const SampleSettingsScreen = () => {
285
285
  isActive: true,
286
286
  iconName: "abacus",
287
287
  },
288
+ {
289
+ name: "custom",
290
+ key: "Custom",
291
+ component: () => (
292
+ <Cell>
293
+ <Typography>This is a custom setting</Typography>
294
+ </Cell>
295
+ ),
296
+ },
288
297
  ],
289
298
  },
290
299
  ];
@@ -293,6 +302,8 @@ export const SampleSettingsScreen = () => {
293
302
  };
294
303
  ```
295
304
 
305
+ _note: Remember to put your content in a `Cell` when adding custom settings_
306
+
296
307
  #### Step 4: replace `createStackNavigator`/`createNativeStackNavigator`/`createBottomTabsNavigator`/`NavigationContainer` imports
297
308
 
298
309
  In order for us to display environment banners and service messages on all screens, you need to
@@ -1,7 +1,6 @@
1
1
  // src/components/screens/settings/renderCell.tsx
2
2
  import React from "react";
3
- import { Cell, Icon } from "@equinor/mad-components";
4
- import { View } from "react-native";
3
+ import { Cell } from "@equinor/mad-components";
5
4
  var renderCell = (item, navigation) => {
6
5
  switch (item.name) {
7
6
  case "navigation":
@@ -15,7 +14,7 @@ var renderCell = (item, navigation) => {
15
14
  }
16
15
  );
17
16
  case "custom":
18
- return /* @__PURE__ */ React.createElement(Cell, { key: item.title, onPress: () => null }, /* @__PURE__ */ React.createElement(View, { style: { justifyContent: "center" } }, /* @__PURE__ */ React.createElement(Icon, { name: item.iconName })));
17
+ return /* @__PURE__ */ React.createElement(item.component, { key: item.key });
19
18
  case "button":
20
19
  return /* @__PURE__ */ React.createElement(
21
20
  Cell.Button,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-4IS74K75.js";
4
4
  import {
5
5
  SettingsSection
6
- } from "./chunk-DWAJZVKH.js";
6
+ } from "./chunk-YKLMUKP4.js";
7
7
  import {
8
8
  getFinalSettingsConfig
9
9
  } from "./chunk-7SJM4NDH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderCell
3
- } from "./chunk-DOHQX5XC.js";
3
+ } from "./chunk-3OKLIPZ5.js";
4
4
  import {
5
5
  useCoreStackNavigation
6
6
  } from "./chunk-BIMOM43W.js";
@@ -3,10 +3,10 @@ import "../chunk-AK7PA4BE.js";
3
3
  import "../chunk-5GBNULIT.js";
4
4
  import {
5
5
  SettingsScreen
6
- } from "../chunk-5XZ4EIWK.js";
6
+ } from "../chunk-CYXQE32M.js";
7
7
  import "../chunk-4IS74K75.js";
8
- import "../chunk-DWAJZVKH.js";
9
- import "../chunk-DOHQX5XC.js";
8
+ import "../chunk-YKLMUKP4.js";
9
+ import "../chunk-3OKLIPZ5.js";
10
10
  import "../chunk-7SJM4NDH.js";
11
11
  import {
12
12
  ErrorBoundary
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SettingsSection
3
- } from "../../../chunk-DWAJZVKH.js";
4
- import "../../../chunk-DOHQX5XC.js";
3
+ } from "../../../chunk-YKLMUKP4.js";
4
+ import "../../../chunk-3OKLIPZ5.js";
5
5
  import "../../../chunk-GUKC6UGZ.js";
6
6
  import "../../../chunk-EQYL7INQ.js";
7
7
  import "../../../chunk-BIMOM43W.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  SettingsScreen
3
- } from "../../../chunk-5XZ4EIWK.js";
3
+ } from "../../../chunk-CYXQE32M.js";
4
4
  import "../../../chunk-4IS74K75.js";
5
- import "../../../chunk-DWAJZVKH.js";
6
- import "../../../chunk-DOHQX5XC.js";
5
+ import "../../../chunk-YKLMUKP4.js";
6
+ import "../../../chunk-3OKLIPZ5.js";
7
7
  import "../../../chunk-7SJM4NDH.js";
8
8
  import "../../../chunk-GUKC6UGZ.js";
9
9
  import "../../../chunk-EQYL7INQ.js";
@@ -2,10 +2,10 @@ import "../../../chunk-AK7PA4BE.js";
2
2
  import "../../../chunk-5GBNULIT.js";
3
3
  import {
4
4
  SettingsScreen
5
- } from "../../../chunk-5XZ4EIWK.js";
5
+ } from "../../../chunk-CYXQE32M.js";
6
6
  import "../../../chunk-4IS74K75.js";
7
- import "../../../chunk-DWAJZVKH.js";
8
- import "../../../chunk-DOHQX5XC.js";
7
+ import "../../../chunk-YKLMUKP4.js";
8
+ import "../../../chunk-3OKLIPZ5.js";
9
9
  import "../../../chunk-7SJM4NDH.js";
10
10
  import "../../../chunk-GUKC6UGZ.js";
11
11
  import "../../../chunk-EQYL7INQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderCell
3
- } from "../../../chunk-DOHQX5XC.js";
3
+ } from "../../../chunk-3OKLIPZ5.js";
4
4
  import "../../../chunk-WEAGW6MQ.js";
5
5
  export {
6
6
  renderCell
@@ -1,6 +1,7 @@
1
- import { IconName, NavigationCellProps, ButtonCellProps, SwitchCellProps } from "@equinor/mad-components";
1
+ import { NavigationCellProps, ButtonCellProps, SwitchCellProps } from "@equinor/mad-components";
2
2
  import { NavigationProp } from "@react-navigation/native";
3
3
  import { CoreStackParamListBase } from "../../../types";
4
+ import { ReactNode } from "react";
4
5
  export type SettingsScreenCellConfigurationItem = ({
5
6
  name: "navigation";
6
7
  } & Omit<NavigationCellProps, "onPress"> & {
@@ -11,9 +12,8 @@ export type SettingsScreenCellConfigurationItem = ({
11
12
  name: "switch";
12
13
  } & SwitchCellProps) | {
13
14
  name: "custom";
14
- title: string;
15
- iconName: IconName;
16
- param: unknown;
15
+ key: string;
16
+ component: () => ReactNode;
17
17
  };
18
18
  export type SettingsScreenSectionProps = {
19
19
  title?: string;
package/dist/index.js CHANGED
@@ -4,10 +4,10 @@ import "./chunk-AK7PA4BE.js";
4
4
  import "./chunk-5GBNULIT.js";
5
5
  import {
6
6
  SettingsScreen
7
- } from "./chunk-5XZ4EIWK.js";
7
+ } from "./chunk-CYXQE32M.js";
8
8
  import "./chunk-4IS74K75.js";
9
- import "./chunk-DWAJZVKH.js";
10
- import "./chunk-DOHQX5XC.js";
9
+ import "./chunk-YKLMUKP4.js";
10
+ import "./chunk-3OKLIPZ5.js";
11
11
  import "./chunk-7SJM4NDH.js";
12
12
  import {
13
13
  ErrorBoundary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/mad-core",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Core library for the Mobile App Delivery team",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -37,8 +37,8 @@
37
37
  "zustand": "^4.4.1",
38
38
  "@equinor/mad-auth": "0.1.7",
39
39
  "@equinor/mad-components": "0.11.0",
40
- "@equinor/mad-insights": "0.1.1",
41
- "@equinor/mad-navigation": "0.2.1"
40
+ "@equinor/mad-navigation": "0.2.1",
41
+ "@equinor/mad-insights": "0.1.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@babel/core": "^7.21.4",