Skip to content

Conversation

@pory-gone
Copy link
Contributor

@pory-gone pory-gone commented Sep 23, 2025

Description

fix #2573

Added a profile sharing feature that allows users to share profile links across all platforms.

  • Share button in the user header component visible on all user profiles
  • Share option in the action dropdown menu for viewing other users' profiles
  • Smart referral logic that adds referral links (/r/{username}) only when sharing via mobile Web Share API
  • Cross-platform compatibility with Web Share API on touch devices and clipboard copy fallback on desktop

Screenshots

Screenshot_2025-09-23_11_33_34 localhost_3000_(iPhone 14 Pro Max) localhost_3000_(iPhone 14 Pro Max) (1) localhost_3000_(iPhone 14 Pro Max) (2)

Additional Context

The implementation reuses existing share infrastructure from share.js for consistency

Checklist

Are your changes backward compatible? Please answer below:
Yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:
7/10

For frontend changes: Tested on mobile, light and dark mode? Please answer below:
Yes

Did you introduce any new environment variables? If so, call them out explicitly here:
NaN

Did you use AI for this? If so, how much did it assist you?
i used AI to check if a share-logic was already implemented

@pory-gone pory-gone changed the title adding profile share button on mobile adding profile share button Sep 23, 2025
@pory-gone pory-gone marked this pull request as ready for review September 23, 2025 09:39
@Soxasora
Copy link
Member

I personally don't like having two share buttons, have you considered getting inspiration from posts?
So something like this, but maybe you can find a better placement:
image

You can just re-use the Share component instead of repeating the logic this way.

Copy link
Member

@Soxasora Soxasora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to request changes, you can boil this down to a bunch of lines

}
}

const referrurl = (ipath, me, isMobile = false) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repeats what is already done in the Share component and share function, kewl name though

@pory-gone
Copy link
Contributor Author

pory-gone commented Oct 12, 2025

I understand! With this new implementation I reuse the share component and I eliminated the share profile button stand-alone, adding the button for the function in the drop-down menu. If you prefer something more similar to what you recommended, I'll get to work.
screenshot

@Soxasora
Copy link
Member

It's pretty good, I don't know how to feel about the icon in the dropdown but it's okay.
What about your own profile? This way the user can't share their profile (unless they grab the URL)

@pory-gone
Copy link
Contributor Author

okok i get the point, i'll try a different idea

1 similar comment
@pory-gone
Copy link
Contributor Author

okok i get the point, i'll try a different idea

@pory-gone
Copy link
Contributor Author

pory-gone commented Oct 23, 2025

I've updated the implementation. I was thinking of a mix of what you showed me and the one similar to the one on posts, I'm not sure about the icon yet.

  • Removed the duplicated logic in ShareProfileDropdownItem
  • Reused the existing Share component instead of repeating code
  • Added a share button next to "edit nym" so users can share their own profile
  • Kept the dropdown option for sharing other users' profiles

The share button now works consistently with how it's implemented for posts. Let me know if you want any other changes.

Istantanea_2025-10-23_19-27-17 Istantanea_2025-10-23_19-27-43

@pory-gone pory-gone requested a review from Soxasora October 23, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add button to share profile

2 participants