Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[account] Export AccountUserDetails component #4227

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

bharatkashyap
Copy link
Member

@bharatkashyap bharatkashyap commented Oct 7, 2024

To Do

  • We will export a useSession() hook for user to be able to extend it
  • Add custom session account example
Screenshot 2024-10-07 at 2 16 07 PM

@bharatkashyap bharatkashyap added docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature labels Oct 7, 2024
@bharatkashyap bharatkashyap changed the title Enh/account 4 [account] Add userDetailsContainer slot Oct 7, 2024
@bharatkashyap bharatkashyap changed the title [account] Add userDetailsContainer slot [account] ExportAccountUserDetails component Oct 7, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 7, 2024
Copy link
Member

@apedroferreira apedroferreira left a comment

Choose a reason for hiding this comment

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

Looks great!
Other than what I added in #4181 just added some opinions on naming and docs feedback.

slotProps={{
userDetailsContainer: {
Copy link
Member

Choose a reason for hiding this comment

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

What about calling it just userDetails?

}),
slots: PropTypes.shape({
menuItems: PropTypes.elementType,
content: PropTypes.elementType,
Copy link
Member

@apedroferreira apedroferreira Oct 7, 2024

Choose a reason for hiding this comment

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

Maybe the name content is too generic? But it's just my opinion, I don't mind it.

display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
padding: theme.spacing(2),
Copy link
Member

Choose a reason for hiding this comment

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

Is using a simple 2 here not the same thing? (not sure though)

By passing a custom component to the `userDetailsContainer` slot, you can override the section which displays the signed-in user's details. The custom component receives a `session` prop which contains the current authentication session:

```tsx
// ...
Copy link
Member

Choose a reason for hiding this comment

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

This example doesn't immediately make sense to me: where is the CustomSession being used?

@bharatkashyap bharatkashyap changed the title [account] ExportAccountUserDetails component [account] Export AccountUserDetails component Oct 9, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customize user details section in <Account/>
2 participants