mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
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>
This commit is contained in:
parent
66258ca615
commit
0fadc09f2b
254 changed files with 384 additions and 403 deletions
47
src/components/landing-layout/navigation/user-dropdown.tsx
Normal file
47
src/components/landing-layout/navigation/user-dropdown.tsx
Normal file
|
@ -0,0 +1,47 @@
|
|||
import React from 'react'
|
||||
import { Dropdown } from 'react-bootstrap'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { LinkContainer } from 'react-router-bootstrap'
|
||||
import { ApplicationState } from '../../../redux'
|
||||
import { clearUser } from '../../../redux/user/methods'
|
||||
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||
import { UserAvatar } from '../../common/user-avatar/user-avatar'
|
||||
|
||||
export const UserDropdown: React.FC = () => {
|
||||
useTranslation()
|
||||
const user = useSelector((state: ApplicationState) => state.user)
|
||||
|
||||
if (!user) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Dropdown alignRight>
|
||||
<Dropdown.Toggle size="sm" variant="dark" id="dropdown-user" className={'d-flex align-items-center'}>
|
||||
<UserAvatar name={user.name} photo={user.photo}/>
|
||||
</Dropdown.Toggle>
|
||||
|
||||
<Dropdown.Menu className='text-start'>
|
||||
<LinkContainer to={'/n/features'}>
|
||||
<Dropdown.Item dir='auto'>
|
||||
<ForkAwesomeIcon icon="bolt" fixedWidth={true} className="mx-2"/>
|
||||
<Trans i18nKey="editor.help.documents.features"/>
|
||||
</Dropdown.Item>
|
||||
</LinkContainer>
|
||||
<LinkContainer to={'/profile'}>
|
||||
<Dropdown.Item dir='auto'>
|
||||
<ForkAwesomeIcon icon="user" fixedWidth={true} className="mx-2"/>
|
||||
<Trans i18nKey="profile.userProfile"/>
|
||||
</Dropdown.Item>
|
||||
</LinkContainer>
|
||||
<Dropdown.Item dir='auto'
|
||||
onClick={() => {
|
||||
clearUser()
|
||||
}}>
|
||||
<ForkAwesomeIcon icon="sign-out" fixedWidth={true} className="mx-2"/>
|
||||
<Trans i18nKey="login.signOut"/>
|
||||
</Dropdown.Item>
|
||||
</Dropdown.Menu>
|
||||
</Dropdown>)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue