hedgedoc/src/components/profile-page/profile-page.tsx
mrdrogdrog 0fadc09f2b
Restructure repository (#426)
organized repository 

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Philip Molares <git@molar.es>
2020-08-16 16:02:26 +02:00

34 lines
1.1 KiB
TypeScript

import React from 'react'
import { Col, Row } from 'react-bootstrap'
import { useSelector } from 'react-redux'
import { Redirect } from 'react-router'
import { ApplicationState } from '../../redux'
import { LoginProvider } from '../../redux/user/types'
import { ShowIf } from '../common/show-if/show-if'
import { ProfileAccountManagement } from './settings/profile-account-management'
import { ProfileChangePassword } from './settings/profile-change-password'
import { ProfileDisplayName } from './settings/profile-display-name'
export const ProfilePage: React.FC = () => {
const user = useSelector((state: ApplicationState) => state.user)
if (!user) {
return (
<Redirect to={'/login'}/>
)
}
return (
<div className="my-3">
<Row className="h-100 flex justify-content-center">
<Col lg={6}>
<ProfileDisplayName/>
<ShowIf condition={user.provider === LoginProvider.INTERNAL}>
<ProfileChangePassword/>
</ShowIf>
<ProfileAccountManagement/>
</Col>
</Row>
</div>
)
}