feat(clerk-js): Support open userProfile and organizationProfile modals to specific navitems - #3732
Conversation
🦋 Changeset detectedLatest commit: e92ffe0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…dal on specific page
e5a8015 to
5953bb2
Compare
| const router = useRouter(); | ||
| const navigateToFlowStart = async () => { | ||
| const to = '/' + router.basePath + router.flowStartPath; | ||
| const to = router.indexPath; |
There was a problem hiding this comment.
Could you briefly, our discoveries and why this is a "safe" change ?
There was a problem hiding this comment.
In the current modal setup, the first element is associated with the '/' path. Previously, clicking the back button in the modal's sidebar navigation would navigate back to the path constructed by '/' + router.basePath + router.flowStartPath, since the modal always opened with the first element selected.
Now, with the ability to open the modal on a specific element, the router.flowStartPath is not necessarily the path for the first element anymore. That's why we should now navigate to router.indexPath instead of the previously used router.flowStartPath.
|
@EmmanouelaPothitou can we have an example code snippet of how this will be used by the users? |
@anagstef This function will not be used directly by the user. Instead, it will be utilized by custom menu items, which will be introduced in another PR that Nikos will open in the next days. Therefore, I do not have an example code snippet at this time. |
| } | ||
| openUserProfile({ | ||
| ...opts.userProfileProps, | ||
| ...(__experimental_startPath && { __experimental_startPath }), |
There was a problem hiding this comment.
❓Shouldn't we update the types of UserProfileModalProps and OrgProfileModalProps to include __experimental_startPath ?
…izationSwitcherPopover.tsx Co-authored-by: panteliselef <panteliselef@outlook.com>
Co-authored-by: panteliselef <panteliselef@outlook.com>
Co-authored-by: panteliselef <panteliselef@outlook.com>
f3b0b4c to
a642fce
Compare
| void preloadComponent(preloadHint); | ||
| } | ||
| componentsControlsResolver = import('./lazyModules/common').then(({ createRoot }) => { | ||
| createRoot(clerkRoot!).render( |
There was a problem hiding this comment.
Is this changed by mistake from the linter or it's a conscious change?
There was a problem hiding this comment.
Linter changed it.
|
!preview |
|
Hey @octoper, your preview is available.
|
octoper
left a comment
There was a problem hiding this comment.
💯 Good job @EmmanouelaPothitou!
Co-authored-by: Vaggelis Yfantis <me@octoper.me>
Co-authored-by: Stefanos Anagnostou <anagstef@users.noreply.github.com>
…ls to specific navitems (#3732) Co-authored-by: panteliselef <panteliselef@outlook.com> Co-authored-by: Vaggelis Yfantis <me@octoper.me> Co-authored-by: Stefanos Anagnostou <anagstef@users.noreply.github.com>
Description
Support opening the userProfileModal and organizationProfileModal to specific navigation items through the userButton and organizationSwitcher.
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change