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

feat: display the dapp icon when connecting with sdk #7876

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default class ExpandedMessage extends PureComponent {
const { currentPageInformation, renderMessage, toggleExpandedMessage } =
this.props;
const url = currentPageInformation.url;
const icon = currentPageInformation.icon;
const title = getHost(url);
const colors = this.context.colors || mockTheme.colors;
const styles = createStyles(colors);
Expand All @@ -113,7 +114,12 @@ export default class ExpandedMessage extends PureComponent {
<View style={styles.iconHidden} />
</TouchableOpacity>
<View style={styles.messageIntroWrapper}>
<WebsiteIcon style={styles.domainLogo} title={title} url={url} />
<WebsiteIcon
style={styles.domainLogo}
title={title}
url={url}
icon={icon}
/>
<Text style={styles.messageFromLabel}>
{strings('signature_request.message_from')} {title}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,46 +387,7 @@ exports[`Root should match snapshot 1`] = `
}
}
>
<View>
<View
style={
Array [
Object {
"alignContent": "center",
"backgroundColor": "#FFFFFF",
"borderRadius": 27,
"height": 54,
"justifyContent": "center",
"width": 54,
},
Object {
"borderRadius": 20,
"height": 40,
"marginRight": 8,
"width": 40,
},
]
}
>
<Text
style={
Array [
Object {
"color": "#24272A",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 24,
"fontWeight": "400",
"textAlign": "center",
"textTransform": "uppercase",
},
undefined,
]
}
>
m
</Text>
</View>
</View>
<View />
<View
style={
Object {
Expand Down
8 changes: 7 additions & 1 deletion app/components/UI/SignatureRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class SignatureRequest extends PureComponent {
} = this.props;
const styles = this.getStyles();
const url = currentPageInformation.url;
const icon = currentPageInformation.icon;
const title = getHost(url);
const arrowIcon = truncateMessage ? this.renderArrowIcon() : null;
return (
Expand All @@ -258,7 +259,12 @@ class SignatureRequest extends PureComponent {
style={styles.children}
onPress={truncateMessage ? toggleExpandedMessage : null}
>
<WebsiteIcon style={styles.domainLogo} title={title} url={url} />
<WebsiteIcon
style={styles.domainLogo}
title={title}
url={url}
icon={icon}
/>
<View style={styles.messageColumn}>
<Text style={styles.messageLabelText}>
{strings('signature_request.message')}:
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/TransactionHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const TransactionHeader = (props) => {
const renderTopIcon = () => {
const { currentEnsName, icon, origin } = props.currentPageInformation;
let url = props.currentPageInformation.url;
if (originIsDeeplink) {
if (originIsDeeplink && !icon) {
return (
<View style={styles.deeplinkIconContainer}>
<FontAwesome
Expand All @@ -170,7 +170,7 @@ const TransactionHeader = (props) => {
viewStyle={styles.assetLogo}
title={iconTitle}
url={currentEnsName || url}
icon={icon?.uri}
icon={typeof icon === 'string' ? icon : icon?.uri}
/>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/core/SDKConnect/Connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ export class Connection extends EventEmitter2 {
title: {
current: originatorInfo?.title,
},
icon: { current: undefined },
icon: { current: originatorInfo?.icon },
// Bookmarks
isHomepage: () => false,
// Show autocomplete
Expand Down
Loading