UNPKG

react-onboarding-sdk

Version:

A TypeScript SDK for fetching onboarding data from backend APIs with React hooks support

15 lines 1.46 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; export default function BannerScreen({ content, actions, onAction }) { return (_jsxs(View, { style: [styles.container, { backgroundColor: content.background }], children: [_jsxs(View, { style: styles.center, children: [_jsx(Text, { style: [styles.title, { color: content.color }], children: content.title }), content.subtitle ? (_jsx(Text, { style: [styles.subtitle, { color: content.color }], children: content.subtitle })) : null] }), _jsx(View, { style: styles.actions, children: actions.map((a, idx) => (_jsx(TouchableOpacity, { style: [styles.button, { backgroundColor: a.background }], onPress: () => onAction(a), children: _jsx(Text, { style: [styles.buttonText, { color: a.color }], children: a.label }) }, idx))) })] })); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'space-between', padding: 20 }, center: { flex: 1, alignItems: 'center', justifyContent: 'center' }, title: { fontSize: 26, fontWeight: '700', textAlign: 'center', marginBottom: 12 }, subtitle: { fontSize: 16, textAlign: 'center' }, actions: { flexDirection: 'row', justifyContent: 'space-around', paddingBottom: 32 }, button: { paddingHorizontal: 24, paddingVertical: 12, borderRadius: 8 }, buttonText: { fontSize: 16, fontWeight: '600' }, }); //# sourceMappingURL=BannerScreen.js.map