mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-07 20:53:54 -05:00
* [INJIMOB-3622]: add the new branding changes Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [INJIMOB-3651]: update the new branding changes Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [INJIMOB-3651]: update the new snapshots Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [INJIMOB-3651]: update the changes mentioned deskcheck Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> --------- Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> Signed-off-by: jaswanthkumartw <jaswanthkumar.p@thoughtworks.com>
57 lines
1.5 KiB
TypeScript
57 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'
|
|
| 'medium'
|
|
| 'mediumExtraSmall';
|
|
lineHeight?: number;
|
|
numLines?: number;
|
|
ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
|
|
style?: StyleProp<TextStyle>;
|
|
accessible?: boolean | true;
|
|
onPress?: () => void;
|
|
onTextLayout?: (e: any) => void;
|
|
}
|