mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 06:15:29 -04:00
improve: Move notifications from redux into context
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
b797f07aa5
commit
03d87f59f8
38 changed files with 362 additions and 376 deletions
|
@ -23,7 +23,7 @@ import { LandingLayout } from '../components/landing-layout/landing-layout'
|
|||
import { useRouter } from 'next/router'
|
||||
import type { NextPage } from 'next'
|
||||
import { Redirect } from '../components/common/redirect'
|
||||
import { dispatchUiNotification } from '../redux/ui-notifications/methods'
|
||||
import { useUiNotifications } from '../components/notifications/ui-notification-boundary'
|
||||
|
||||
/**
|
||||
* Renders the registration page with fields for username, display name, password, password retype and information about terms and conditions.
|
||||
|
@ -40,6 +40,8 @@ export const RegisterPage: NextPage = () => {
|
|||
const [passwordAgain, setPasswordAgain] = useState('')
|
||||
const [error, setError] = useState<RegisterErrorType>()
|
||||
|
||||
const { dispatchUiNotification } = useUiNotifications()
|
||||
|
||||
const doRegisterSubmit = useCallback(
|
||||
(event: FormEvent) => {
|
||||
doLocalRegister(username, displayName, password)
|
||||
|
@ -55,7 +57,7 @@ export const RegisterPage: NextPage = () => {
|
|||
})
|
||||
event.preventDefault()
|
||||
},
|
||||
[username, displayName, password, router]
|
||||
[username, displayName, password, dispatchUiNotification, router]
|
||||
)
|
||||
|
||||
const ready = useMemo(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue