Files
inji-wallet/components/ui/Text.tsx
abhip2565 bd90b342e0 [INJIMOB-3193]add preauth and credential offer support (#1949)
[INJIMOB-3058]temp commit2



[INJIMOB-3058]temp commit2



[INJIMOB-3058] add support for pre-auth flow by credential-offer



[INJIMOB-3187] animo working chcekpoint

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
2025-06-04 14:46:07 +05:30

50 lines
1.5 KiB
TypeScript

import React from 'react';
import {StyleProp, Text as RNText, TextStyle} from 'react-native';
import {Spacing, Theme} from './styleUtils';
import testIDProps from '../../shared/commonUtil';
export const Text: React.FC<TextProps> = (props: TextProps) => {
const weight = props.weight || 'regular';
const textStyles: StyleProp<TextStyle> = [
Theme.TextStyles.base,
Theme.TextStyles[weight],
props.color ? {color: props.color} : null,
props.align ? {textAlign: props.align} : {textAlign: 'left'},
props.margin ? Theme.spacing('margin', props.margin) : null,
props.size ? Theme.TextStyles[props.size] : null,
props.style ? props.style : null,
];
return (
<RNText
{...testIDProps(props.testID)}
style={textStyles}
numberOfLines={props.numLines}
onTextLayout={props.onTextLayout}
ellipsizeMode={props.ellipsizeMode}
accessible={props.accessible}
onPress={props.onPress}>
{props.children}
</RNText>
);
};
interface TextProps {
testID?: string;
children: React.ReactNode;
color?: string;
weight?: 'regular' | 'semibold' | 'bold';
align?: TextStyle['textAlign'];
margin?: Spacing;
size?: 'small' | 'extraSmall' | 'smaller' | 'regular' | 'large' | 'mediumSmall';
lineHeight?: number;
numLines?: number;
ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
style?: StyleProp<TextStyle>;
accessible?: boolean | true;
onPress?: () => void;
onTextLayout?: (e: any) => void;
}