feature:基本功能
This commit is contained in:
30
client/components/onboarding/SerifText.tsx
Normal file
30
client/components/onboarding/SerifText.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
import { Text, TextProps, Platform, StyleSheet } from 'react-native';
|
||||
import { OnboardingColors } from '@/constants/OnboardingTheme';
|
||||
|
||||
interface SerifTextProps extends TextProps {
|
||||
weight?: 'regular' | 'bold';
|
||||
}
|
||||
|
||||
export function SerifText({ style, weight = 'regular', ...otherProps }: SerifTextProps) {
|
||||
return (
|
||||
<Text
|
||||
style={[
|
||||
styles.text,
|
||||
weight === 'bold' && styles.bold,
|
||||
style,
|
||||
]}
|
||||
{...otherProps}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
text: {
|
||||
fontFamily: Platform.select({ ios: 'Georgia', android: 'serif', default: 'serif' }),
|
||||
color: OnboardingColors.textPrimary,
|
||||
},
|
||||
bold: {
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user