Matiks-UI / src /components /MathProblem.tsx
Abhisingh-18's picture
Mirror of github.com/Abhisingh18/Matiks-UI
0bedb61 verified
Raw
History Blame Contribute Delete
1.45 kB
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { COLORS } from '../constants/colors';
interface MathProblemProps {
num1: number;
num2: number;
operator: string;
}
export const MathProblem: React.FC<MathProblemProps> = ({ num1, num2, operator }) => {
return (
<View style={styles.container}>
<Text style={styles.text}>
<Text style={styles.number}>{num1}</Text>
<Text style={styles.operator}> {operator} </Text>
<Text style={styles.number}>{num2}</Text>
<Text style={styles.equals}> = </Text>
<Text style={styles.questionMark}>?</Text>
</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
backgroundColor: COLORS.surface,
borderRadius: 16,
borderWidth: 1,
borderColor: COLORS.border,
paddingVertical: 28,
paddingHorizontal: 40,
marginVertical: 16,
alignItems: 'center',
},
text: {
flexDirection: 'row',
alignItems: 'center',
},
number: {
fontSize: 44,
fontWeight: '800',
color: COLORS.text,
fontVariant: ['tabular-nums'],
},
operator: {
fontSize: 36,
fontWeight: '600',
color: COLORS.primary,
},
equals: {
fontSize: 36,
fontWeight: '600',
color: COLORS.textDim,
},
questionMark: {
fontSize: 44,
fontWeight: '800',
color: COLORS.accent,
},
});