mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -04:00
Move and rename files (2/4) (#987)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
1b7abf9f27
commit
123f959fb3
145 changed files with 586 additions and 301 deletions
66
src/components/document-read-only-page/document-infobar.tsx
Normal file
66
src/components/document-read-only-page/document-infobar.tsx
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { DateTime } from 'luxon'
|
||||
import React from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { InternalLink } from '../common/links/internal-link'
|
||||
import { ShowIf } from '../common/show-if/show-if'
|
||||
import {
|
||||
DocumentInfoLineWithTimeMode,
|
||||
DocumentInfoTimeLine
|
||||
} from '../editor-page/document-bar/document-info/document-info-time-line'
|
||||
import './document-infobar.scss'
|
||||
|
||||
export interface DocumentInfobarProps {
|
||||
changedAuthor: string
|
||||
changedTime: DateTime
|
||||
createdAuthor: string
|
||||
createdTime: DateTime
|
||||
editable: boolean
|
||||
noteId: string
|
||||
viewCount: number
|
||||
}
|
||||
|
||||
export const DocumentInfobar: React.FC<DocumentInfobarProps> = ({
|
||||
changedAuthor,
|
||||
changedTime,
|
||||
createdAuthor,
|
||||
createdTime,
|
||||
editable,
|
||||
noteId,
|
||||
viewCount
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<div className={'d-flex flex-row my-3 document-infobar'}>
|
||||
<div className={'col-md'}> </div>
|
||||
<div className={'d-flex flex-fill'}>
|
||||
<div className={'d-flex flex-column'}>
|
||||
<DocumentInfoTimeLine
|
||||
mode={DocumentInfoLineWithTimeMode.CREATED}
|
||||
time={createdTime}
|
||||
userName={createdAuthor}
|
||||
profileImageSrc={'/img/avatar.png'}/>
|
||||
<DocumentInfoTimeLine
|
||||
mode={DocumentInfoLineWithTimeMode.EDITED}
|
||||
time={changedTime}
|
||||
userName={changedAuthor}
|
||||
profileImageSrc={'/img/avatar.png'}/>
|
||||
<hr/>
|
||||
</div>
|
||||
<span className={'ml-auto'}>
|
||||
{ viewCount } <Trans i18nKey={'views.readOnly.viewCount'}/>
|
||||
<ShowIf condition={editable}>
|
||||
<InternalLink text={''} href={`/n/${noteId}`} icon={'pencil'} className={'text-primary text-decoration-none mx-1'} title={t('views.readOnly.editNote')}/>
|
||||
</ShowIf>
|
||||
</span>
|
||||
</div>
|
||||
<div className={'col-md'}> </div>
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue