
* fix views & date layout * handle auth modal calling on required actions & fix minor ui bugs * fix eslint errors * refactor auth modals for non sessioned & implement callback triggering after sign in * refactor handlers with requireAuth
17 lines
536 B
TypeScript
17 lines
536 B
TypeScript
import { useRouter } from '../stores/router'
|
|
import type { AuthModalSearchParams } from '../components/Nav/AuthModal/types'
|
|
import { useLocalize } from '../context/localize'
|
|
|
|
export const generateModalTitleFromSource = (modalType: 'login' | 'register') => {
|
|
const { searchParams } = useRouter<AuthModalSearchParams>()
|
|
const { t } = useLocalize()
|
|
|
|
const { source } = searchParams()
|
|
|
|
let title = modalType === 'login' ? 'Enter the Discours' : 'Create account'
|
|
|
|
if (source) title = `${title} from ${source}`
|
|
|
|
return t(title)
|
|
}
|