mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -05:00
* Revert "[INJIMOB-3622] Fix alignment in history screen (#2140)" This reverts commita0b08914e5. Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * Revert "Injimob [3622] [3627] - BANNER ISSUE AND BRANDING CHANGES ISSUES (#2130)" This reverts commit522104811c. Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * Revert "[INJIMOB-3633][INJIMOB-3636] fix icon bg color across app (#2134)" This reverts commitd8d718693d. Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * Revert "[INJIMOB-3633] fix search bar clear icon not apperaing (#2133)" This reverts commit6a202b11af. Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * Injimob-3651: revert all the old branding changes and add new changes #2150 Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [INJIMOB-3651]: Update all the test snapshots Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> --------- Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>
97 lines
2.4 KiB
TypeScript
97 lines
2.4 KiB
TypeScript
import {Dimensions, View} from 'react-native';
|
|
import {Column, Row, Text} from '../../ui';
|
|
import {CustomTooltip} from '../../ui/ToolTip';
|
|
import {Theme} from '../../ui/styleUtils';
|
|
import React from 'react';
|
|
import {SvgImage} from '../../ui/svg';
|
|
import {useTranslation} from 'react-i18next';
|
|
import Icon from 'react-native-vector-icons/FontAwesome';
|
|
import {STATUS_FIELD_NAME} from './VCUtils';
|
|
import {StatusTooltipContent} from './VcStatustooTip';
|
|
|
|
export const VCItemFieldName = ({
|
|
fieldName,
|
|
testID,
|
|
fieldNameColor: textColor = Theme.Colors.DetailsLabel,
|
|
isDisclosed = false,
|
|
}: {
|
|
fieldName: string;
|
|
testID: string;
|
|
fieldNameColor?: string;
|
|
isDisclosed?: boolean;
|
|
}) => {
|
|
const {t} = useTranslation('ViewVcModal');
|
|
return (
|
|
<Row>
|
|
{fieldName && (
|
|
<Text
|
|
testID={`${testID}Title`}
|
|
color={textColor}
|
|
style={Theme.Styles.fieldItemTitle}>
|
|
{fieldName === STATUS_FIELD_NAME ? t('VcDetails:status') : fieldName}
|
|
</Text>
|
|
)}
|
|
|
|
{fieldName == STATUS_FIELD_NAME && (
|
|
<CustomTooltip
|
|
testID="statusToolTip"
|
|
width={Dimensions.get('screen').width * 0.8}
|
|
height={Dimensions.get('screen').height * 0.28}
|
|
triggerComponent={SvgImage.info()}
|
|
triggerComponentStyles={{marginLeft: 2, marginTop: 2}}
|
|
toolTipContent={<StatusTooltipContent />}
|
|
/>
|
|
)}
|
|
{isDisclosed && (
|
|
<Icon
|
|
name="share-square-o"
|
|
size={10}
|
|
color="#666"
|
|
style={{marginLeft: 5, marginTop: 3}}
|
|
/>
|
|
)}
|
|
</Row>
|
|
);
|
|
};
|
|
|
|
export const VCItemFieldValue = ({
|
|
fieldValue,
|
|
testID,
|
|
fieldValueColor: textColor = Theme.Colors.Details,
|
|
}: {
|
|
fieldValue: any;
|
|
testID: string;
|
|
fieldValueColor?: string;
|
|
}) => {
|
|
if (React.isValidElement(fieldValue)) {
|
|
return <View testID={`${testID}Value`}>{fieldValue}</View>;
|
|
}
|
|
|
|
return (
|
|
<Text
|
|
testID={`${testID}Value`}
|
|
color={textColor}
|
|
style={Theme.Styles.fieldItemValue}>
|
|
{fieldValue}
|
|
</Text>
|
|
);
|
|
};
|
|
|
|
export const VCItemField: React.FC<VCItemFieldProps> = props => {
|
|
return (
|
|
<Column>
|
|
<VCItemFieldName {...props} />
|
|
<VCItemFieldValue {...props} />
|
|
</Column>
|
|
);
|
|
};
|
|
|
|
interface VCItemFieldProps {
|
|
fieldName: string;
|
|
fieldValue: string;
|
|
testID: string;
|
|
fieldNameColor?: string;
|
|
fieldValueColor?: string;
|
|
isDisclosed?: boolean;
|
|
}
|