mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-28 22:15:12 -04:00
Adapt react-client to use the real backend API (#1545)
Co-authored-by: Philip Molares <philip.molares@udo.edu> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
3399ed2023
commit
26f90505ff
227 changed files with 4726 additions and 2310 deletions
|
@ -7,7 +7,6 @@
|
|||
import React from 'react'
|
||||
import { Col, Row } from 'react-bootstrap'
|
||||
import { useApplicationState } from '../hooks/common/use-application-state'
|
||||
import { LoginProvider } from '../redux/user/types'
|
||||
import { ShowIf } from '../components/common/show-if/show-if'
|
||||
import { ProfileAccessTokens } from '../components/profile-page/access-tokens/profile-access-tokens'
|
||||
import { ProfileAccountManagement } from '../components/profile-page/account-management/profile-account-management'
|
||||
|
@ -15,13 +14,14 @@ import { ProfileChangePassword } from '../components/profile-page/settings/profi
|
|||
import { ProfileDisplayName } from '../components/profile-page/settings/profile-display-name'
|
||||
import { LandingLayout } from '../components/landing-layout/landing-layout'
|
||||
import { Redirect } from '../components/common/redirect'
|
||||
import { AuthProviderType } from '../api/config/types'
|
||||
|
||||
/**
|
||||
* Profile page that includes forms for changing display name, password (if internal login is used),
|
||||
* managing access tokens and deleting the account.
|
||||
*/
|
||||
export const ProfilePage: React.FC = () => {
|
||||
const userProvider = useApplicationState((state) => state.user?.provider)
|
||||
const userProvider = useApplicationState((state) => state.user?.authProvider)
|
||||
|
||||
if (!userProvider) {
|
||||
return <Redirect to={'/login'} />
|
||||
|
@ -33,7 +33,7 @@ export const ProfilePage: React.FC = () => {
|
|||
<Row className='h-100 flex justify-content-center'>
|
||||
<Col lg={6}>
|
||||
<ProfileDisplayName />
|
||||
<ShowIf condition={userProvider === LoginProvider.LOCAL}>
|
||||
<ShowIf condition={userProvider === AuthProviderType.LOCAL}>
|
||||
<ProfileChangePassword />
|
||||
</ShowIf>
|
||||
<ProfileAccessTokens />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue