@applicaster/zapp-react-native-utils
Version:
Applicaster Zapp React Native utilities package
305 lines (303 loc) • 9.2 kB
JavaScript
const generalContent = () => ({
general: {
fields: [
{
key: "identifier",
type: "text_input",
disableField: true,
},
{
key: "nav_bar_id",
type: "nav_bar_selector",
label: "Navigation Bar",
placeholder: "Choose Nav Bar",
},
],
},
styles: {
fields: [
{
type: "color_picker_rgba",
label: "Screen background color",
key: "screen_background_color",
label_tooltip:
"This will override the background color set in the theme",
initial_value: null,
},
{
group: true,
label: "Mobile styles",
tooltip:
"The following styles apply to mobile and tablet (unless specific tablet values are specified). They will override the theme values for this screen", // eslint-disable-line max-len
folded: true,
fields: [
{
type: "number_input",
label: "Screen Padding Top",
key: "screen_padding_top",
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Bottom",
key: "screen_padding_bottom",
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Left",
key: "screen_padding_left",
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Right",
key: "screen_padding_right",
initial_value: null,
},
],
},
{
group: true,
label: "Tablet specific styles",
tooltip:
"If you want to have specific values for your tablet layout, you can use the fields in this section. Otherwise, the app will use the default fields", // eslint-disable-line max-len
folded: true,
fields: [
{
type: "switch",
label: "Enable tablet specific theme values",
key: "tablet_theme",
initial_value: false,
},
{
type: "number_input",
label: "Screen Padding Top",
key: "tablet_screen_padding_top",
conditional_fields: [
{
key: "styles/tablet_theme",
condition_value: true,
},
],
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Bottom",
key: "tablet_screen_padding_bottom",
conditional_fields: [
{
key: "styles/tablet_theme",
condition_value: true,
},
],
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Left",
key: "tablet_screen_padding_left",
conditional_fields: [
{
key: "styles/tablet_theme",
condition_value: true,
},
],
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Right",
key: "tablet_screen_padding_right",
conditional_fields: [
{
key: "styles/tablet_theme",
condition_value: true,
},
],
initial_value: null,
},
],
},
{
group: true,
label: "TV Styles",
tooltip:
"These styles apply only to TV, and will overide the values set in the theme for this specific screen",
folded: true,
fields: [
{
type: "number_input",
label: "Screen Margin Top",
key: "screen_margin_top",
initial_value: null,
},
{
type: "number_input",
label: "Screen Margin Bottom",
key: "screen_margin_bottom",
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Top",
key: "screen_padding_top",
initial_value: null,
},
{
type: "number_input",
label: "Screen Padding Bottom",
key: "screen_padding_bottom",
initial_value: null,
},
],
},
{
group: true,
label: "Pull to refresh Styles",
folded: true,
fields: [
{
type: "color_picker_rgba",
label: "Indicator color",
key: "pull_to_refresh_indicator_color",
conditional_fields: [
{
key: "rules/pull_to_refresh_enabled",
condition_value: true,
},
],
initial_value: null,
},
{
type: "color_picker",
label: "Indicator background color (only Android)",
key: "pull_to_refresh_indicator_bg_color",
conditional_fields: [
{
key: "rules/pull_to_refresh_enabled",
condition_value: true,
},
],
initial_value: null,
},
{
type: "select",
label: "Indicator size (only Android)",
key: "pull_to_refresh_indicator_size",
options: ["default", "large"],
conditional_fields: [
{
key: "rules/pull_to_refresh_enabled",
condition_value: true,
},
],
initial_value: "default",
},
{
type: "switch",
label: "Display title under indicator (only IOS)",
key: "pull_to_refresh_display_title_ios",
conditional_fields: [
{
key: "rules/pull_to_refresh_enabled",
condition_value: true,
},
],
initial_value: false,
},
{
type: "color_picker_rgba",
label: "Title color under indicator (only IOS)",
key: "pull_to_refresh_title_color_under_indicator",
conditional_fields: [
{
key: "rules/pull_to_refresh_enabled",
condition_value: true,
},
{
key: "styles/pull_to_refresh_display_title_ios",
condition_value: true,
},
],
initial_value: null,
},
],
},
],
},
localizations: {
fields: [
{
type: "text_input",
label: "Pull to refresh title under indicator (only IOS)",
key: "pull_to_refresh_title_under_indicator",
conditional_fields: [
{
key: "rules/pull_to_refresh_enabled",
condition_value: true,
},
{
key: "styles/pull_to_refresh_display_title_ios",
condition_value: true,
},
],
initial_value: "reloading...",
},
{
type: "text_input",
label: "Navigation Bar Screen Title",
key: "screen_title",
initial_value: null,
},
],
},
advertising: {
fields: [
{
key: "banner_ad_unit_id",
type: "text_input",
label: "Bottom Banner Ad Unit",
label_tooltip:
"Ad Units entered here will be 'fixed' or 'sticky' to the bottom of the screen. Please make sure the provided Ad Unit is configured to match Standard Banner or Smart Banner ad sizes.", // eslint-disable-line max-len
},
{
key: "interstitial_ad_unit_id",
type: "text_input",
label: "Interstitial Ad Unit",
label_tooltip:
"Enter DFP Ad Unit for an interstitial here. The associated interstitial will be served on this screen when the screen first begins to load", // eslint-disable-line max-len
},
{
key: "display_interstitial_once",
type: "switch",
initial_value: true,
label: "Display Interstitial Once",
label_tooltip:
"If toggled on, the interstitial will only be displayed to users the first time they load this screen. If toggled off, it will display the interstitial every time the screen loads, including when users back into the screen. We recommend leaving it on as overuse of interstitials has been shown to lead to user churn and provide diminishing returns on revenue", // eslint-disable-line max-len
},
{
key: "skip_if_deep_link",
type: "switch",
initial_value: false,
label: "Skip if deep link",
label_tooltip:
"If toggled on, interstitial will be skipped in case of opening screen through the deep link.",
},
],
},
rules: {
fields: [
{
type: "switch",
label: "Enable pull to refresh feature",
key: "pull_to_refresh_enabled",
initial_value: false,
},
],
},
});
module.exports = {
generalContent,
};