import React from 'react'; import { Modal, View, Text, TouchableOpacity, StyleSheet, } from 'react-native'; import { KurdistanColors } from '../theme/colors'; import { useTheme } from '../contexts/ThemeContext'; interface FontSizeModalProps { visible: boolean; onClose: () => void; } const FontSizeModal: React.FC = ({ visible, onClose }) => { const { colors, fontSize, setFontSize } = useTheme(); const styles = createStyles(colors); const handleSelectSize = async (size: 'small' | 'medium' | 'large') => { await setFontSize(size); onClose(); }; return ( Font Size Choose your preferred font size for better readability. handleSelectSize('small')} > Small The quick brown fox jumps over the lazy dog {fontSize === 'small' && } handleSelectSize('medium')} > Medium (Default) The quick brown fox jumps over the lazy dog {fontSize === 'medium' && } handleSelectSize('large')} > Large The quick brown fox jumps over the lazy dog {fontSize === 'large' && } ); }; const createStyles = (colors: any) => StyleSheet.create({ overlay: { flex: 1, backgroundColor: 'rgba(0, 0, 0, 0.5)', justifyContent: 'center', alignItems: 'center', }, container: { width: '90%', maxWidth: 400, backgroundColor: colors.surface, borderRadius: 16, overflow: 'hidden', }, header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', padding: 20, borderBottomWidth: 1, borderBottomColor: colors.border, }, headerTitle: { fontSize: 20, fontWeight: 'bold', color: colors.text, }, closeButton: { width: 32, height: 32, borderRadius: 16, backgroundColor: colors.background, justifyContent: 'center', alignItems: 'center', }, closeButtonText: { fontSize: 20, color: colors.textSecondary, }, content: { padding: 20, }, description: { fontSize: 14, color: colors.textSecondary, marginBottom: 20, lineHeight: 20, }, sizeOption: { padding: 16, borderRadius: 12, borderWidth: 2, borderColor: colors.border, marginBottom: 12, position: 'relative', }, sizeOptionSelected: { borderColor: KurdistanColors.kesk, backgroundColor: colors.background, }, sizeLabel: { fontSize: 16, fontWeight: '600', color: colors.text, marginBottom: 8, }, sizeExample: { color: colors.textSecondary, lineHeight: 22, }, checkmark: { position: 'absolute', top: 16, right: 16, fontSize: 24, color: KurdistanColors.kesk, fontWeight: 'bold', }, }); export default FontSizeModal;