mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2025-08-27 04:59:22 +00:00
Update CONTEXT.md about new LoginArea
This commit is contained in:
parent
04673a276a
commit
7a8da77d69
@ -152,23 +152,23 @@ The `useCurrentUser` hook should be used to ensure that the user is logged in be
|
|||||||
|
|
||||||
### Nostr Login
|
### Nostr Login
|
||||||
|
|
||||||
To enable login with Nostr, simply include the `AccountSwitcher` component already included in this project.
|
To enable login with Nostr, simply use the `LoginArea` component already included in this project.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { AccountSwitcher } from "@/components/auth/AccountSwitcher";
|
import { LoginArea } from "@/components/auth/LoginArea";
|
||||||
|
|
||||||
function MyComponent() {
|
function MyComponent() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{/* other components ... */}
|
{/* other components ... */}
|
||||||
|
|
||||||
<AccountSwitcher />
|
<LoginArea />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `AccountSwitcher` component displays a "Log in" button when the user is logged out, and changes to an account switcher once the user is logged in.
|
The `LoginArea` component displays a "Log in" button when the user is logged out, and changes to an account switcher once the user is logged in. It handles all the login-related UI and interactions internally, including displaying login dialogs and switching between accounts.
|
||||||
|
|
||||||
## Development Practices
|
## Development Practices
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user