mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00
Adjust editor config (#976)
* Adjust editor config Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
0180c75e55
commit
e12dc523f8
301 changed files with 4393 additions and 3741 deletions
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React, { Fragment } from 'react'
|
||||
import { Navbar } from 'react-bootstrap'
|
||||
|
@ -31,19 +31,19 @@ const HeaderBar: React.FC = () => {
|
|||
</HeaderNavLink>
|
||||
</div>
|
||||
<div className="d-inline-flex">
|
||||
{!userExists
|
||||
{ !userExists
|
||||
? <Fragment>
|
||||
<span className={'mx-1 d-flex'}>
|
||||
<span className={ 'mx-1 d-flex' }>
|
||||
<NewGuestNoteButton/>
|
||||
</span>
|
||||
<SignInButton size="sm"/>
|
||||
</Fragment>
|
||||
<SignInButton size="sm"/>
|
||||
</Fragment>
|
||||
: <Fragment>
|
||||
<span className={'mx-1 d-flex'}>
|
||||
<span className={ 'mx-1 d-flex' }>
|
||||
<NewUserNoteButton/>
|
||||
</span>
|
||||
<UserDropdown/>
|
||||
</Fragment>
|
||||
<UserDropdown/>
|
||||
</Fragment>
|
||||
}
|
||||
</div>
|
||||
</Navbar>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { Nav } from 'react-bootstrap'
|
||||
|
@ -16,8 +16,8 @@ export interface HeaderNavLinkProps {
|
|||
export const HeaderNavLink: React.FC<HeaderNavLinkProps> = ({ to, id, children }) => {
|
||||
return (
|
||||
<Nav.Item>
|
||||
<LinkContainer to={to}>
|
||||
<Nav.Link id={id} className="text-light" href={to}>{children}</Nav.Link>
|
||||
<LinkContainer to={ to }>
|
||||
<Nav.Link id={ id } className="text-light" href={ to }>{ children }</Nav.Link>
|
||||
</LinkContainer>
|
||||
</Nav.Item>
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { Button } from 'react-bootstrap'
|
||||
|
@ -13,7 +13,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
|||
export const NewGuestNoteButton: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<LinkContainer to={'/new'} title={t('landing.navigation.newGuestNote')}>
|
||||
<LinkContainer to={ '/new' } title={ t('landing.navigation.newGuestNote') }>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { Button } from 'react-bootstrap'
|
||||
|
@ -13,7 +13,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
|||
export const NewUserNoteButton: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<LinkContainer to={'/new'} title={t('landing.navigation.newNote')}>
|
||||
<LinkContainer to={ '/new' } title={ t('landing.navigation.newNote') }>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { Button } from 'react-bootstrap'
|
||||
|
@ -14,18 +14,19 @@ import { ApplicationState } from '../../../redux'
|
|||
import { ShowIf } from '../../common/show-if/show-if'
|
||||
|
||||
type SignInButtonProps = {
|
||||
className?: string
|
||||
} & Omit<ButtonProps, 'href'>
|
||||
className?: string
|
||||
} & Omit<ButtonProps, 'href'>
|
||||
|
||||
export const SignInButton: React.FC<SignInButtonProps> = ({ variant, ...props }) => {
|
||||
const { t } = useTranslation()
|
||||
const anyAuthProviderActive = useSelector((state: ApplicationState) => Object.values(state.config.authProviders).includes(true))
|
||||
const anyAuthProviderActive = useSelector((state: ApplicationState) => Object.values(state.config.authProviders)
|
||||
.includes(true))
|
||||
return (
|
||||
<ShowIf condition={anyAuthProviderActive}>
|
||||
<LinkContainer to="/login" title={t('login.signIn')}>
|
||||
<ShowIf condition={ anyAuthProviderActive }>
|
||||
<LinkContainer to="/login" title={ t('login.signIn') }>
|
||||
<Button
|
||||
variant={variant || 'success'}
|
||||
{...props}
|
||||
variant={ variant || 'success' }
|
||||
{ ...props }
|
||||
>
|
||||
<Trans i18nKey="login.signIn"/>
|
||||
</Button>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import equal from 'fast-deep-equal'
|
||||
import React from 'react'
|
||||
|
@ -25,28 +25,28 @@ export const UserDropdown: React.FC = () => {
|
|||
|
||||
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 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'}>
|
||||
<LinkContainer to={ '/n/features' }>
|
||||
<Dropdown.Item dir='auto'>
|
||||
<ForkAwesomeIcon icon="bolt" fixedWidth={true} className="mx-2"/>
|
||||
<ForkAwesomeIcon icon="bolt" fixedWidth={ true } className="mx-2"/>
|
||||
<Trans i18nKey="editor.help.documents.features"/>
|
||||
</Dropdown.Item>
|
||||
</LinkContainer>
|
||||
<LinkContainer to={'/profile'}>
|
||||
<LinkContainer to={ '/profile' }>
|
||||
<Dropdown.Item dir='auto'>
|
||||
<ForkAwesomeIcon icon="user" fixedWidth={true} className="mx-2"/>
|
||||
<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"/>
|
||||
onClick={ () => {
|
||||
clearUser()
|
||||
} }>
|
||||
<ForkAwesomeIcon icon="sign-out" fixedWidth={ true } className="mx-2"/>
|
||||
<Trans i18nKey="login.signOut"/>
|
||||
</Dropdown.Item>
|
||||
</Dropdown.Menu>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue