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] [docs] Add custom user details example #4227

Open
wants to merge 65 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
  • Add useSession docs pages

Screenshot 2024-10-13 at 4 32 35 PM

https://deploy-preview-4227--mui-toolpad-docs.netlify.app/toolpad/core/react-use-session/

@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
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 17, 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 18, 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 18, 2024
@bharatkashyap bharatkashyap removed the request for review from Janpot October 18, 2024 19:47
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 18, 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, really easy to understand!
Added some small documentation suggestions.

const session = useSession();
```

If your session has additional data which you want to display in the account popover, you an create custom components for user information display with the session object:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If your session has additional data which you want to display in the account popover, you an create custom components for user information display with the session object:
If your session has additional data which you want to display in the account popover, you can create custom components for user information display with the session object:

}
```

The following example demonstrates this behaviour clearly:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The following example demonstrates this behaviour clearly:
The following example demonstrates this behavior:

"behavior" for American english as I guess that's the one we use?

The `session` can be created using any authentication provider of your choice. You can access the current value of the `SessionContext` inside Toolpad Core components by invoking the hook:

```js
const session = useSession();
Copy link
Member

Choose a reason for hiding this comment

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

Should we show where to import it from here too?

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