@equinor/mad-core
Version:
Core library for the Mobile App Delivery team
44 lines (41 loc) • 1.61 kB
JavaScript
import {
CoreRoutes
} from "./chunk-UKAZW3CQ.js";
// src/utils/getPremadeSettings.ts
var getReleaseNotesConfig = (dictionary) => ({
name: "navigation",
iconName: "format-list-bulleted",
title: dictionary.releaseNotes.releaseNotes,
onPress: (navigation) => navigation.navigate(CoreRoutes.RELEASE_NOTES)
});
var getAboutConfig = (dictionary) => ({
name: "navigation",
iconName: "information-outline",
title: dictionary.settings.aboutApp,
onPress: (navigation) => navigation.navigate(CoreRoutes.ABOUT)
});
var getServiceNowConfig = (dictionary) => ({
name: "navigation",
iconName: "chat-alert-outline",
title: dictionary.settings.feedback,
onPress: (navigation) => navigation.navigate(CoreRoutes.FEEDBACK)
});
var getLanguageConfig = (dictionary) => ({
name: "navigation",
iconName: "chat-processing-outline",
title: dictionary.settings.language,
onPress: (navigation) => navigation.navigate(CoreRoutes.SELECT_LANGUAGE)
});
var getPremadeSettings = (config, dictionary) => {
const premadeCommonNavigationItems = [getReleaseNotesConfig(dictionary)];
if (config.about) premadeCommonNavigationItems.push(getAboutConfig(dictionary));
if (config.serviceNow) premadeCommonNavigationItems.push(getServiceNowConfig(dictionary));
const premadeLanguageSection = config.language.supportedLanguages.length >= 2 ? { items: [getLanguageConfig(dictionary)] } : void 0;
const premadeCommonNavigationSection = {
items: premadeCommonNavigationItems
};
return { language: premadeLanguageSection, common: premadeCommonNavigationSection };
};
export {
getPremadeSettings
};