Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INJIMOB-2525]: Fix help button design consistentcy across different screens #1753

Merged
merged 5 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions components/ui/HelpIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import {View} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import { Theme } from './styleUtils';
import { SvgImage } from './svg';

export const HelpIcon = () => {
return (
<LinearGradient
style={{borderRadius: 8, marginRight: 4}}
colors={Theme.Colors.GradientColorsLight}
start={Theme.LinearGradientDirection.start}
end={Theme.LinearGradientDirection.end}>
<View testID="help"></View>
<View style={Theme.Styles.IconContainer}>{SvgImage.questionIcon()}</View>
</LinearGradient>
);
};
10 changes: 5 additions & 5 deletions components/ui/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export const DefaultTheme = {
padding: 6,
width: 25,
marginRight: 4,
marginLeft: 10,
marginLeft: 4,
alignItems: 'center',
justifyContent: 'center',
height: 36,
Expand Down Expand Up @@ -1597,10 +1597,10 @@ export const DefaultTheme = {
borderRadius: 8,
justifyContent: 'center',
alignItems: 'center',
paddingLeft: 16,
paddingRight: 16,
paddingBottom: 10,
paddingTop: 10,
paddingLeft: 7,
paddingRight: 7,
paddingBottom: 7,
paddingTop: 7,
},
rowStyle: {
justifyContent: 'space-between',
Expand Down
10 changes: 5 additions & 5 deletions components/ui/themes/PurpleTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ export const PurpleTheme = {
alignItems: 'center',
justifyContent: 'center',
marginRight: 4,
marginLeft: 10,
marginLeft: 4,
height: 36,
borderRadius: 10,
backgroundColor: Colors.LightPurple,
Expand Down Expand Up @@ -1605,10 +1605,10 @@ export const PurpleTheme = {
backgroundColor: Colors.LightPurple,
justifyContent: 'center',
alignItems: 'center',
paddingLeft: 16,
paddingRight: 16,
paddingBottom: 10,
paddingTop: 10,
paddingLeft: 7,
paddingRight: 7,
paddingBottom: 7,
paddingTop: 7,
},
rowStyle: {
justifyContent: 'space-between',
Expand Down
15 changes: 3 additions & 12 deletions screens/Home/ViewVcModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
BannerStatus,
} from '../../components/BannerNotification';
import {VCProcessor} from '../../components/VC/common/VCProcessor';
import { HelpIcon } from '../../components/ui/HelpIcon';

export const ViewVcModal: React.FC<ViewVcModalProps> = props => {
const {t} = useTranslation('ViewVcModal');
Expand Down Expand Up @@ -90,18 +91,8 @@ export const ViewVcModal: React.FC<ViewVcModalProps> = props => {
return flow === 'downloadedVc' ? (
<Row align="space-between">
<HelpScreen
triggerComponent={
<LinearGradient
style={{borderRadius: 8, marginRight: 4}}
colors={Theme.Colors.GradientColorsLight}
start={Theme.LinearGradientDirection.start}
end={Theme.LinearGradientDirection.end}>
<View testID="help"></View>
<View style={Theme.Styles.IconContainer}>
{SvgImage.questionIcon()}
</View>
</LinearGradient>
}
source={'Inji'}
triggerComponent={HelpIcon()}
/>
{isVCLoaded(verifiableCredential, fields) ? (
<Pressable
Expand Down
15 changes: 4 additions & 11 deletions screens/Settings/KeyManagementScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import {
} from '../../shared/telemetry/TelemetryUtils';
import {TelemetryConstants} from '../../shared/telemetry/TelemetryConstants';
import {SUPPORTED_KEY_TYPES} from '../../shared/constants';
import {SvgImage} from '../../components/ui/svg';
import LinearGradient from 'react-native-linear-gradient';
import { HelpIcon } from '../../components/ui/HelpIcon';

const {RNSecureKeystoreModule} = NativeModules;

Expand Down Expand Up @@ -128,17 +131,7 @@ export const KeyManagementScreen: React.FC<KeyManagementScreenProps> = () => {
</Text>
<HelpScreen
source={'keyManagement'}
triggerComponent={
<Icon
testID="keyManagementHelpIcon"
accessible={true}
name="question"
type="font-awesome"
size={21}
style={Theme.Styles.IconContainer}
color={Theme.Colors.Icon}
/>
}
triggerComponent={ HelpIcon() }
/>
</View>
<BannerNotificationContainer />
Expand Down
24 changes: 2 additions & 22 deletions screens/backupAndRestore/BackupAndRestoreScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import testIDProps, {
import {HelpScreen} from '../../components/HelpScreen';
import {isAndroid, isIOS} from '../../shared/constants';
import LinearGradient from 'react-native-linear-gradient';
import { HelpIcon } from '../../components/ui/HelpIcon';

const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
const backupController = useBackupScreen();
Expand Down Expand Up @@ -211,28 +212,7 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
headerRight={
<HelpScreen
source={'BackUp'}
triggerComponent={
<LinearGradient
style={{borderRadius: 8}}
colors={Theme.Colors.GradientColorsLight}
start={Theme.LinearGradientDirection.start}
end={Theme.LinearGradientDirection.end}>
<View testID="help" style={Theme.HelpScreenStyle.viewStyle}>
<Row crossAlign="center" style={Theme.HelpScreenStyle.rowStyle}>
<View
testID="helpIcon"
style={Theme.HelpScreenStyle.iconStyle}>
{SvgImage.info()}
</View>
<Text
testID="helpText"
style={Theme.HelpScreenStyle.labelStyle}>
{t('help')}
</Text>
</Row>
</View>
</LinearGradient>
}
triggerComponent={HelpIcon()}
/>
}
onDismiss={props.onBackPress}>
Expand Down
Loading