@oxyhq/services
Version:
Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀
85 lines (84 loc) • 2.49 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _vectorIcons = require("@expo/vector-icons");
var _jsxRuntime = require("react/jsx-runtime");
const QuickActions = ({
actions,
theme
}) => {
const isDarkTheme = theme === 'dark';
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
const secondaryBackgroundColor = isDarkTheme ? '#222222' : '#FFFFFF';
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
style: [styles.quickActionsContainer, styles.firstGroupedItem, styles.lastGroupedItem, {
backgroundColor: secondaryBackgroundColor
}],
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
style: styles.quickActionsRow,
children: actions.map(action => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
style: styles.quickActionItem,
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
style: [styles.quickActionCircle, {
backgroundColor: isDarkTheme ? 'rgba(255,255,255,0.08)' : 'rgba(0,0,0,0.03)'
}],
onPress: action.onPress,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
name: action.icon,
size: 24,
color: action.iconColor
})
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.quickActionText, {
color: textColor
}],
children: action.title
})]
}, action.id))
})
});
};
const styles = _reactNative.StyleSheet.create({
quickActionsContainer: {
padding: 16,
marginBottom: 8
},
firstGroupedItem: {
borderTopLeftRadius: 24,
borderTopRightRadius: 24
},
lastGroupedItem: {
borderBottomLeftRadius: 24,
borderBottomRightRadius: 24,
marginBottom: 8
},
quickActionsRow: {
flexDirection: 'row',
alignItems: 'flex-start',
justifyContent: 'space-around',
flexWrap: 'wrap'
},
quickActionItem: {
alignItems: 'center',
minWidth: 70,
marginBottom: 8
},
quickActionCircle: {
width: 50,
height: 50,
borderRadius: 25,
alignItems: 'center',
justifyContent: 'center',
marginBottom: 8
},
quickActionText: {
fontSize: 12,
fontWeight: '500',
textAlign: 'center'
}
});
var _default = exports.default = QuickActions;
//# sourceMappingURL=QuickActions.js.map