@iterable/react-native-sdk
Version:
Iterable SDK for React Native.
61 lines (59 loc) • 1.82 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.IterableInboxEmptyState = void 0;
var _reactNative = require("react-native");
var _index = require("../constants/index.js");
var _jsxRuntime = require("react/jsx-runtime");
/**
* Props for the IterableInboxEmptyState component.
*/
/**
* A functional component that renders an empty state for the inbox when there are no messages.
*/
const IterableInboxEmptyState = ({
customizations,
tabBarHeight,
tabBarPadding,
navTitleHeight,
height,
isPortrait
}) => {
const defaultTitle = 'No saved messages';
const defaultBody = 'Check again later!';
const emptyStateTitle = customizations.noMessagesTitle;
const emptyStateBody = customizations.noMessagesBody;
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
style: [styles.container, {
height: isPortrait ? height - navTitleHeight - tabBarHeight - tabBarPadding : height - navTitleHeight
}],
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: styles.title,
children: emptyStateTitle ? emptyStateTitle : defaultTitle
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: styles.body,
children: emptyStateBody ? emptyStateBody : defaultBody
})]
});
};
exports.IterableInboxEmptyState = IterableInboxEmptyState;
const styles = _reactNative.StyleSheet.create({
body: {
color: _index.ITERABLE_INBOX_COLORS.TEXT,
fontSize: 15
},
container: {
alignItems: 'center',
backgroundColor: _index.ITERABLE_INBOX_COLORS.CONTAINER_BACKGROUND,
flexDirection: 'column',
height: 0,
justifyContent: 'center'
},
title: {
fontSize: 20,
fontWeight: 'bold',
paddingBottom: 25
}
});
//# sourceMappingURL=IterableInboxEmptyState.js.map