@equinor/mad-core
Version:
Core library for the Mobile App Delivery team
58 lines (55 loc) • 3.35 kB
JavaScript
import {
getMadCommonBaseUrl
} from "./chunk-ZB37EIZB.js";
import {
useCoreNavigatorType
} from "./chunk-PP74MP4O.js";
import {
useAbout,
useAppVersion,
useEnvironment,
useExperimentalFeatures
} from "./chunk-GEEFQMRN.js";
// src/components/screens/AboutScreen.tsx
import React from "react";
import { Cell, EDSStyleSheet, Typography, useStyles } from "@equinor/mad-components";
import { ScrollView, View } from "react-native";
var AboutScreen = () => {
var _a;
const styles = useStyles(themeStyles);
const environment = useEnvironment();
const environmentName = environment.charAt(0).toUpperCase() + environment.slice(1);
const appVersion = useAppVersion();
const about = useAbout();
const coreNavigatorType = useCoreNavigatorType();
const experimentalFeatures = useExperimentalFeatures();
const authenticationMethod = (experimentalFeatures == null ? void 0 : experimentalFeatures.useExpoAuthSession) ? "Expo" : "MSAL";
const endpoints = [getMadCommonBaseUrl(environment)].concat((_a = about == null ? void 0 : about.endpoints) != null ? _a : []);
return /* @__PURE__ */ React.createElement(
ScrollView,
{
contentInsetAdjustmentBehavior: "automatic",
contentContainerStyle: styles.contentContainer
},
/* @__PURE__ */ React.createElement(Cell, null, /* @__PURE__ */ React.createElement(View, { style: styles.cellContainer }, /* @__PURE__ */ React.createElement(Typography, { variant: "h2" }, "Client"), /* @__PURE__ */ React.createElement(View, { style: styles.rowContainer }, /* @__PURE__ */ React.createElement(View, { style: styles.columnContainer }, /* @__PURE__ */ React.createElement(Typography, null, "Configuration"), /* @__PURE__ */ React.createElement(Typography, null, "BuildNr"), /* @__PURE__ */ React.createElement(Typography, null, "App version"), /* @__PURE__ */ React.createElement(Typography, null, "Authentication"), /* @__PURE__ */ React.createElement(Typography, null, "Core navigator type")), /* @__PURE__ */ React.createElement(View, { style: styles.columnContainer }, /* @__PURE__ */ React.createElement(Typography, null, environmentName), /* @__PURE__ */ React.createElement(Typography, null, about == null ? void 0 : about.buildNumber), /* @__PURE__ */ React.createElement(Typography, null, appVersion), /* @__PURE__ */ React.createElement(Typography, null, authenticationMethod), /* @__PURE__ */ React.createElement(Typography, null, coreNavigatorType))))),
/* @__PURE__ */ React.createElement(Cell, null, /* @__PURE__ */ React.createElement(View, { style: styles.cellContainer }, /* @__PURE__ */ React.createElement(Typography, { variant: "h2" }, "Api"), /* @__PURE__ */ React.createElement(View, { style: styles.columnContainer }, /* @__PURE__ */ React.createElement(Typography, null, "Endpoints"), /* @__PURE__ */ React.createElement(View, null, endpoints.map((endpoint) => /* @__PURE__ */ React.createElement(Typography, { key: endpoint }, endpoint))))))
);
};
var themeStyles = EDSStyleSheet.create((theme) => ({
contentContainer: {
paddingVertical: theme.spacing.container.paddingVertical
},
cellContainer: {
gap: theme.spacing.cell.content.titleDescriptionGap
},
rowContainer: {
flexDirection: "row",
columnGap: theme.spacing.cell.gapHorizontal
},
columnContainer: {
gap: 8
}
}));
export {
AboutScreen
};