Skip to content

Conversation

wobsoriano
Copy link
Member

Description

This PR adds support for custom pages and links in the <OrganizationProfile /> Astro component. It implements the same behavior with the React counterpart:

In a dedicated page:

<OrganizationProfile>
    <!-- Custom page -->
    <OrganizationProfile.Page label="Terms" url="terms">
        <div slot="label-icon">Icon</div>
        <div>
            <h1>Custom Terms Page</h1>
            <p>This is the custom terms page</p>
        </div>
    </OrganizationProfile.Page>
    <!-- Custom link -->
    <OrganizationProfile.Link label="Homepage" url="/">
        <div slot="label-icon">Home</div>
    </OrganizationProfile.Link>
    <!-- Reorder default item -->
    <OrganizationProfile.Page label="members" />
</UserProfile>

Inside <OrganizationSwitcher /> component:

<OrganizationSwitcher>
    <OrganizationSwitcher.OrganizationProfilePage label="Terms" url="terms">
        <div slot="label-icon">Icon</div>
        <div>
            <h1>Custom Terms Page</h1>
            <p>This is the custom terms page</p>
        </div>
    </OrganizationSwitcher.OrganizationProfilePage>
    <OrganizationSwitcher.OrganizationProfileLink label="Homepage" url="/">
        <div slot="label-icon">Icon</div>
    </OrganizationSwitcher.OrganizationProfileLink>
    <OrganizationSwitcher.OrganizationProfilePage label="members" />
</OrganizationSwitcher>

Closes ECO-182

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Sep 4, 2024

🦋 Changeset detected

Latest commit: 6059484

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/astro Minor

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

@wobsoriano wobsoriano marked this pull request as ready for review September 4, 2024 04:47
Copy link
Member Author

Choose a reason for hiding this comment

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

This component serves as the custom profile page renderer for

  • <OrganizationProfile /> (dedicated page)
  • <OrganizationProfile /> (inside <OrganizationSwitcher />)
  • <UserProfile />

@wobsoriano wobsoriano merged commit 1351f2d into main Sep 5, 2024
20 checks passed
@wobsoriano wobsoriano deleted the rob/eco-182-custom-pages-for-organizationprofile-component branch September 5, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants