@sendbird/uikit-react-native
Version:
Sendbird UIKit for React Native: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.
71 lines • 2.01 kB
JavaScript
import React from 'react';
import { Box, Icon, PressBox, createStyleSheet, useHeaderStyle, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
import { useSafeAreaPadding } from '@sendbird/uikit-utils';
const FileViewerFooter = ({
bottomInset,
deleteShown,
onPressDelete,
onPressDownload
}) => {
const {
palette
} = useUIKitTheme();
const {
defaultHeight
} = useHeaderStyle();
const safeArea = useSafeAreaPadding(['left', 'right']);
return /*#__PURE__*/React.createElement(Box, {
style: [styles.container, {
paddingStart: styles.container.paddingHorizontal + safeArea.paddingStart,
paddingEnd: styles.container.paddingHorizontal + safeArea.paddingEnd,
paddingBottom: bottomInset,
height: defaultHeight + bottomInset,
backgroundColor: palette.overlay01
}]
}, /*#__PURE__*/React.createElement(PressBox, {
activeOpacity: 0.75,
onPress: onPressDownload,
style: styles.buttonContainer
}, /*#__PURE__*/React.createElement(Icon, {
icon: 'download',
size: 24,
color: palette.onBackgroundDark01
})), /*#__PURE__*/React.createElement(Box, {
style: styles.titleContainer
}), /*#__PURE__*/React.createElement(PressBox, {
activeOpacity: 0.75,
onPress: onPressDelete,
style: styles.buttonContainer,
disabled: !deleteShown
}, deleteShown && /*#__PURE__*/React.createElement(Icon, {
icon: 'delete',
size: 24,
color: palette.onBackgroundDark01
})));
};
const styles = createStyleSheet({
container: {
zIndex: 1,
position: 'absolute',
start: 0,
end: 0,
bottom: 0,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
paddingHorizontal: 12
},
buttonContainer: {
width: 32,
height: 32,
alignItems: 'center',
justifyContent: 'center'
},
titleContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center'
}
});
export default FileViewerFooter;
//# sourceMappingURL=FileViewerFooter.js.map