UNPKG

@equinor/mad-core

Version:

Core library for the Mobile App Delivery team

51 lines (48 loc) 1.93 kB
import { useSignOut } from "./chunk-HVZWOPNE.js"; import { SettingsSection } from "./chunk-YKLMUKP4.js"; import { getFinalSettingsConfig } from "./chunk-QLL6LKDN.js"; import { useScreenTitleFromDictionary } from "./chunk-U5IJVQDO.js"; import { useAccountOrDemoAccount } from "./chunk-WWF7QKDX.js"; import { useDictionary, useSettingsScreenPremadeConfig } from "./chunk-GEEFQMRN.js"; import { __spreadValues } from "./chunk-CWMXXUWU.js"; // src/components/screens/settings/SettingsScreen.tsx import React from "react"; import { Button, Spacer, Typography } from "@equinor/mad-components"; import { View, ScrollView } from "react-native"; var SettingsScreen = ({ config = [], clean = false }) => { useScreenTitleFromDictionary((dic) => dic.settings.title); const dictionary = useDictionary(); const signOut = useSignOut(); const premadeConfig = useSettingsScreenPremadeConfig(); const account = useAccountOrDemoAccount(); const finalSettingsConfig = getFinalSettingsConfig(config, premadeConfig, clean); return /* @__PURE__ */ React.createElement(ScrollView, { contentInsetAdjustmentBehavior: "automatic" }, /* @__PURE__ */ React.createElement(Spacer, null), finalSettingsConfig.map((section, index) => /* @__PURE__ */ React.createElement(SettingsSection, __spreadValues({ key: index }, section))), /* @__PURE__ */ React.createElement(View, { style: { padding: 30 } }, /* @__PURE__ */ React.createElement(Typography, { bold: true }, dictionary.settings.loggedInAs), /* @__PURE__ */ React.createElement(Typography, null, account == null ? void 0 : account.username)), /* @__PURE__ */ React.createElement(View, { style: { flexDirection: "row-reverse" } }, /* @__PURE__ */ React.createElement( Button, { title: dictionary.settings.logOut, onPress: () => void signOut(), style: { marginHorizontal: 30, width: 100 } } ))); }; export { SettingsScreen };