PWI improvements (#3489)
* Enable home and feeds on the PWI * Add global SigninDialog to drive useRequireAuth() * Tweak desktop styles * Make the logo in leftnav PWI a clickable home link * Add label * Improve dialog on web * Fix query key * Go to home after signout from settings screen * Filter out feeds from the discover listing for logged out users which are known to break without auth * Update profile header follow/subscribe to give signin prompt * Show profile feeds tabs on pwi * Add language selector to account creation footer and pwi left nav desktop --------- Co-authored-by: dan <dan.abramov@gmail.com>
This commit is contained in:
parent
44039c68d6
commit
ec5c4929c1
23 changed files with 519 additions and 478 deletions
|
@ -15,8 +15,8 @@ import {logger} from '#/logger'
|
|||
import {isWeb} from '#/platform/detection'
|
||||
import * as persisted from '#/state/persisted'
|
||||
import {PUBLIC_BSKY_AGENT} from '#/state/queries'
|
||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
import {useCloseAllActiveElements} from '#/state/util'
|
||||
import {useGlobalDialogsControlContext} from '#/components/dialogs/Context'
|
||||
import {IS_DEV} from '#/env'
|
||||
import {emitSessionDropped} from '../events'
|
||||
import {readLabelers} from './agent-config'
|
||||
|
@ -702,8 +702,8 @@ export function useSessionApi() {
|
|||
|
||||
export function useRequireAuth() {
|
||||
const {hasSession} = useSession()
|
||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
const closeAll = useCloseAllActiveElements()
|
||||
const {signinDialogControl} = useGlobalDialogsControlContext()
|
||||
|
||||
return React.useCallback(
|
||||
(fn: () => void) => {
|
||||
|
@ -711,10 +711,10 @@ export function useRequireAuth() {
|
|||
fn()
|
||||
} else {
|
||||
closeAll()
|
||||
setShowLoggedOut(true)
|
||||
signinDialogControl.open()
|
||||
}
|
||||
},
|
||||
[hasSession, setShowLoggedOut, closeAll],
|
||||
[hasSession, signinDialogControl, closeAll],
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue