mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
refactor: use showif instead of ternary operator
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
472e775fd2
commit
6ca0bd0668
1 changed files with 6 additions and 1 deletions
|
@ -4,12 +4,15 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { createNote } from '../api/notes'
|
||||
import type { Note } from '../api/notes/types'
|
||||
import { LoadingScreen } from '../components/application-loader/loading-screen/loading-screen'
|
||||
import { CustomAsyncLoadingBoundary } from '../components/common/async-loading-boundary/custom-async-loading-boundary'
|
||||
import { Redirect } from '../components/common/redirect'
|
||||
import { ShowIf } from '../components/common/show-if/show-if'
|
||||
import { CommonErrorPage } from '../components/error-pages/common-error-page'
|
||||
import { useSingleStringUrlParameter } from '../hooks/common/use-single-string-url-parameter'
|
||||
import type { NextPage } from 'next'
|
||||
import React from 'react'
|
||||
import { useAsync } from 'react-use'
|
||||
|
||||
/**
|
||||
|
@ -33,7 +36,9 @@ export const NewNotePage: NextPage = () => {
|
|||
descriptionI18nKey={'errors.noteCreationFailed.description'}
|
||||
/>
|
||||
}>
|
||||
{value ? <Redirect to={`/n/${value.metadata.primaryAddress}`} /> : null}
|
||||
<ShowIf condition={!!value}>
|
||||
<Redirect to={`/n/${(value as Note).metadata.primaryAddress}`} />
|
||||
</ShowIf>
|
||||
</CustomAsyncLoadingBoundary>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue