Skip to content

Commit

Permalink
On click profile pic or name from send SOL screen navigate to user pr…
Browse files Browse the repository at this point in the history
…ofile (coral-xyz#3140)
  • Loading branch information
Kritik-J authored Mar 3, 2023
1 parent fe2910f commit c2a5cab
Showing 1 changed file with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ETH_NATIVE_MINT,
explorerUrl,
NATIVE_ACCOUNT_RENT_EXEMPTION_LAMPORTS,
NAV_COMPONENT_MESSAGE_PROFILE,
SOL_NATIVE_MINT,
toDisplayBalance,
toTitleCase,
Expand Down Expand Up @@ -73,6 +74,7 @@ const useStyles = styles((theme) => ({
borderRadius: "50%",
display: "inline-block",
overflow: "hidden",
cursor: "pointer",
},
horizontalCenter: {
display: "flex",
Expand Down Expand Up @@ -519,6 +521,21 @@ function SendV2({
const isDarkMode = useDarkMode();
const [tooltipOpen, setTooltipOpen] = useState(false);
const [_amount, _setAmount] = useState<string>("");
const { push } = useNavigation();

const openProfilePage = (props: { uuid: string }) => {
if (uuid === props.uuid) {
return;
}

push({
title: `@${to.username}`,
componentId: NAV_COMPONENT_MESSAGE_PROFILE,
componentProps: {
userId: props.uuid,
},
});
};

return (
<>
Expand All @@ -530,7 +547,12 @@ function SendV2({
>
<div>
<div className={classes.horizontalCenter} style={{ marginBottom: 6 }}>
<div className={classes.topImageOuter}>
<div
className={classes.topImageOuter}
onClick={() => {
if (to?.uuid) openProfilePage({ uuid: to.uuid });
}}
>
<LocalImage
className={classes.topImage}
src={
Expand All @@ -548,6 +570,10 @@ function SendV2({
color: theme.custom.colors.fontColor,
fontSize: 16,
fontWeight: 500,
cursor: "pointer",
}}
onClick={() => {
openProfilePage({ uuid: to.uuid });
}}
>
@{`${to.username}`}
Expand Down

0 comments on commit c2a5cab

Please sign in to comment.