stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
78 lines • 2.77 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EmptyList = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactNative = require("react-native");
var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
var _theme = require("../../theme");
var _jsxRuntime = require("react/jsx-runtime");
var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/UIComponents/EmptyList.tsx";
var EmptyList = ({
icon: Icon,
subtitle,
title
}) => {
var _useTheme = (0, _ThemeContext.useTheme)(),
_useTheme$theme = _useTheme.theme,
_useTheme$theme$empty = _useTheme$theme.emptyList,
container = _useTheme$theme$empty.container,
subtitleStyle = _useTheme$theme$empty.subtitle,
titleStyle = _useTheme$theme$empty.title,
semantics = _useTheme$theme.semantics;
return (0, _jsxRuntime.jsxs)(_reactNative.View, {
style: [styles.container, container],
testID: "empty-list",
children: [(0, _jsxRuntime.jsx)(Icon, {
stroke: semantics.textTertiary,
size: 32
}), (0, _jsxRuntime.jsxs)(_reactNative.View, {
style: styles.content,
children: [(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.title, {
color: semantics.textPrimary
}, titleStyle],
children: title
}), subtitle ? (0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.subtitle, {
color: semantics.textSecondary
}, subtitleStyle],
children: subtitle
}) : null]
})]
});
};
exports.EmptyList = EmptyList;
EmptyList.displayName = 'EmptyList{emptyList}';
var styles = _reactNative.StyleSheet.create({
container: {
alignItems: 'center',
gap: _theme.primitives.spacingSm,
height: '100%',
justifyContent: 'center',
paddingHorizontal: _theme.primitives.spacingMd,
paddingVertical: _theme.primitives.spacing3xl,
width: '100%'
},
content: {
alignItems: 'center',
gap: _theme.primitives.spacingXs,
width: '100%'
},
subtitle: {
fontSize: _theme.primitives.typographyFontSizeMd,
fontWeight: _theme.primitives.typographyFontWeightRegular,
lineHeight: _theme.primitives.typographyLineHeightNormal,
textAlign: 'center',
writingDirection: _reactNative.I18nManager.isRTL ? 'rtl' : 'ltr'
},
title: {
fontSize: _theme.primitives.typographyFontSizeMd,
fontWeight: _theme.primitives.typographyFontWeightSemiBold,
lineHeight: _theme.primitives.typographyLineHeightNormal,
textAlign: 'center',
writingDirection: _reactNative.I18nManager.isRTL ? 'rtl' : 'ltr'
}
});
//# sourceMappingURL=EmptyList.js.map