Skip to content

Commit

Permalink
Merge pull request #798 from Marvel-Ib/ch-show-route-hint-if-available
Browse files Browse the repository at this point in the history
Add route hint to copy button on person's profile if available
  • Loading branch information
elraphty committed Oct 27, 2023
2 parents 66c9285 + 584f261 commit d4cedd3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/app/src/people/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ export interface AboutViewProps {
owner_pubkey?: string;
description?: string;
canEdit?: boolean;
owner_route_hint?: string;
}

export interface BlogViewProps {
Expand Down
4 changes: 3 additions & 1 deletion frontend/app/src/people/utils/ConnectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export default function ConnectCard(props: ConnectCardProps) {
const showAssignModal = () => setAssignModal(true);

const qrString = person && person?.owner_pubkey ? makeConnectQR(person?.owner_pubkey) : '';
const ownerPubkey = person && person?.owner_pubkey ? `${person.owner_pubkey}` : '';
const routeHint = person && person?.owner_route_hint ? `:${person.owner_route_hint}` : '';

return (
<div onClick={(e: any) => e.stopPropagation()}>
Expand Down Expand Up @@ -124,7 +126,7 @@ export default function ConnectCard(props: ConnectCardProps) {

<>
{person?.owner_pubkey && (
<QrBar value={person?.owner_pubkey} simple style={{ marginTop: 11 }} />
<QrBar value={`${ownerPubkey}${routeHint}`} simple style={{ marginTop: 11 }} />
)}
</>
<Button
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/src/people/widgetViews/AboutView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const Img = styled.div<ImageProps>`
`;
export const AboutView = observer((props: AboutViewProps) => {
const history = useHistory();
const { price_to_meet, extras, twitter_confirmed, owner_pubkey } = props;
const { price_to_meet, extras, twitter_confirmed, owner_pubkey, owner_route_hint } = props;
const { twitter, github, coding_languages, tribes, repos, lightning, amboss, email } =
extras || {};

Expand Down Expand Up @@ -264,7 +264,7 @@ export const AboutView = observer((props: AboutViewProps) => {

<Divider />

{owner_pubkey && <QrBar value={owner_pubkey} />}
{owner_pubkey && <QrBar value={`${owner_pubkey}:${owner_route_hint}`} />}

{tag && (
<>
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/store/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface MeInfo {
pubkey: string;
uuid?: string;
owner_pubkey?: string;
owner_route_hint?: string;
photo_url: string;
alias: string;
img?: string;
Expand Down

0 comments on commit d4cedd3

Please sign in to comment.