fastcomments-react-native-sdk
Version:
React Native FastComments Components. Add live commenting to any React Native application.
17 lines (16 loc) • 1.7 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { StyleSheet, TouchableOpacity, View } from "react-native";
export function EditorToolbar({ config }) {
return _jsxs(View, { style: styles.root, children: [config.boldButton && config.toggleBold && _jsx(TouchableOpacity, { onPress: () => config.toggleBold(config.getCurrentNode()), style: styles.button, children: config.boldButton }), config.italicButton && config.toggleItalic && _jsx(TouchableOpacity, { onPress: () => config.toggleItalic(config.getCurrentNode()), style: styles.button, children: config.italicButton }), config.underlineButton && config.toggleUnderline && _jsx(TouchableOpacity, { onPress: () => config.toggleUnderline(config.getCurrentNode()), style: styles.button, children: config.underlineButton }), config.strikethroughButton && config.toggleStrikethrough && _jsx(TouchableOpacity, { onPress: () => config.toggleStrikethrough(config.getCurrentNode()), style: styles.button, children: config.strikethroughButton }), config.imageButton && config.selectAndInsertImageAfterCurrentNode && _jsx(TouchableOpacity, { onPress: () => config.selectAndInsertImageAfterCurrentNode(config.getCurrentNode()), style: styles.button, children: config.imageButton }), config.gifPickerButton && config.selectAndInsertGIFAfterCurrentNode && _jsx(TouchableOpacity, { onPress: () => config.selectAndInsertGIFAfterCurrentNode(config.getCurrentNode()), style: styles.button, children: config.gifPickerButton })] });
}
const styles = StyleSheet.create({
root: {
flexDirection: 'row',
alignItems: 'center',
height: 25,
padding: 5,
},
button: {
marginRight: 10
}
});