mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 06:15:29 -04:00
docs: consolidate docs (#2182)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8d46d7e39e
commit
ecffebc43c
307 changed files with 1474 additions and 487 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -9,6 +9,9 @@ import { LanguagePicker } from './language-picker'
|
|||
import { PoweredByLinks } from './powered-by-links'
|
||||
import { SocialLink } from './social-links'
|
||||
|
||||
/**
|
||||
* Renders the footer.
|
||||
*/
|
||||
export const Footer: React.FC = () => {
|
||||
return (
|
||||
<footer className='text-light-50 small'>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -47,16 +47,20 @@ const languages = {
|
|||
* This function checks if the wanted language code is supported by our translations.
|
||||
* The language code that is provided by the browser can (but don't need to) contain the region.
|
||||
* Some of our translations are region dependent (e.g. chinese-traditional and chinese-simplified).
|
||||
* Therefore we first need to check if the complete wanted language code is supported by our translations.
|
||||
* Therefore, we first need to check if the complete wanted language code is supported by our translations.
|
||||
* If not, then we look if we at least have a region independent translation.
|
||||
*
|
||||
* @param wantedLanguage an ISO 639-1 standard language code
|
||||
* @return The supported language code
|
||||
*/
|
||||
const findLanguageCode = (wantedLanguage: string): string =>
|
||||
Object.keys(languages).find((supportedLanguage) => wantedLanguage === supportedLanguage) ??
|
||||
Object.keys(languages).find((supportedLanguage) => wantedLanguage.slice(0, 2) === supportedLanguage) ??
|
||||
''
|
||||
|
||||
/**
|
||||
* Renders the language picker.
|
||||
*/
|
||||
export const LanguagePicker: React.FC = () => {
|
||||
const { i18n } = useTranslation()
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -13,6 +13,9 @@ import { TranslatedInternalLink } from '../../common/links/translated-internal-l
|
|||
import { VersionInfoLink } from './version-info/version-info-link'
|
||||
import { useApplicationState } from '../../../hooks/common/use-application-state'
|
||||
|
||||
/**
|
||||
* Renders a powered-by link.
|
||||
*/
|
||||
export const PoweredByLinks: React.FC = () => {
|
||||
useTranslation()
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -9,6 +9,9 @@ import { Trans, useTranslation } from 'react-i18next'
|
|||
import links from '../../../links.json'
|
||||
import { ExternalLink } from '../../common/links/external-link'
|
||||
|
||||
/**
|
||||
* Renders links to the social networks.
|
||||
*/
|
||||
export const SocialLink: React.FC = () => {
|
||||
useTranslation()
|
||||
return (
|
||||
|
|
|
@ -10,6 +10,9 @@ import { VersionInfoModal } from './version-info-modal'
|
|||
import { cypressId } from '../../../../utils/cypress-attribute'
|
||||
import { useBooleanState } from '../../../../hooks/common/use-boolean-state'
|
||||
|
||||
/**
|
||||
* Renders a link for the version info and the {@link VersionInfoModal}.
|
||||
*/
|
||||
export const VersionInfoLink: React.FC = () => {
|
||||
const [modalVisibility, showModal, closeModal] = useBooleanState()
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -18,6 +18,15 @@ export interface VersionInfoModalColumnProps {
|
|||
issueTrackerLink: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a column in the {@link VersionInfoModal}.
|
||||
*
|
||||
* @param titleI18nKey
|
||||
* @param issueTrackerLink
|
||||
* @param sourceCodeLink
|
||||
* @param version
|
||||
* @constructor
|
||||
*/
|
||||
export const VersionInfoModalColumn: React.FC<VersionInfoModalColumnProps> = ({
|
||||
titleI18nKey,
|
||||
issueTrackerLink,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -15,6 +15,12 @@ import type { BackendVersion } from '../../../../api/config/types'
|
|||
import { useApplicationState } from '../../../../hooks/common/use-application-state'
|
||||
import { cypressId } from '../../../../utils/cypress-attribute'
|
||||
|
||||
/**
|
||||
* Renders a modal with the version information.
|
||||
*
|
||||
* @param onHide The callback to call if the modal should be closed
|
||||
* @param show If the modal should be shown.
|
||||
*/
|
||||
export const VersionInfoModal: React.FC<CommonModalProps> = ({ onHide, show }) => {
|
||||
const serverVersion: BackendVersion = useApplicationState((state) => state.config.version)
|
||||
const backendVersion = useMemo(() => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -12,6 +12,11 @@ import { Footer } from './footer/footer'
|
|||
import { HeaderBar } from './navigation/header-bar/header-bar'
|
||||
import { UiNotifications } from '../notifications/ui-notifications'
|
||||
|
||||
/**
|
||||
* Renders the layout for both intro and history page.
|
||||
*
|
||||
* @param children The children that should be rendered on the page.
|
||||
*/
|
||||
export const LandingLayout: React.FC<PropsWithChildren<unknown>> = ({ children }) => {
|
||||
return (
|
||||
<Fragment>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -15,6 +15,9 @@ import { SignInButton } from '../sign-in-button'
|
|||
import { UserDropdown } from '../user-dropdown'
|
||||
import { cypressId } from '../../../../utils/cypress-attribute'
|
||||
|
||||
/**
|
||||
* Renders a header bar for the intro and history page.
|
||||
*/
|
||||
const HeaderBar: React.FC = () => {
|
||||
useTranslation()
|
||||
const userExists = useApplicationState((state) => !!state.user)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -11,6 +11,9 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
|||
import { cypressId } from '../../../utils/cypress-attribute'
|
||||
import Link from 'next/link'
|
||||
|
||||
/**
|
||||
* Renders a button to create a new note as a guest.
|
||||
*/
|
||||
export const NewGuestNoteButton: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -11,6 +11,9 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
|||
import { cypressId } from '../../../utils/cypress-attribute'
|
||||
import Link from 'next/link'
|
||||
|
||||
/**
|
||||
* Renders a button to create a new note as a logged in user.
|
||||
*/
|
||||
export const NewUserNoteButton: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -18,7 +18,9 @@ import { getOneClickProviderMetadata } from '../../login-page/auth/utils/get-one
|
|||
export type SignInButtonProps = Omit<ButtonProps, 'href'>
|
||||
|
||||
/**
|
||||
* Renders a sign-in button if auth providers are defined. It links to either the login page or if only a single one-click provider is configured, to this one.
|
||||
* Renders a sign-in button if auth providers are defined.
|
||||
* It links to either the login page or if only a single one-click provider is configured, to that one.
|
||||
*
|
||||
* @param variant The style variant as inferred from the common button component.
|
||||
* @param props Further props inferred from the common button component.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -14,6 +14,9 @@ import { cypressId } from '../../../utils/cypress-attribute'
|
|||
import { SignOutDropdownButton } from './sign-out-dropdown-button'
|
||||
import Link from 'next/link'
|
||||
|
||||
/**
|
||||
* Renders a dropdown menu with user-relevant actions.
|
||||
*/
|
||||
export const UserDropdown: React.FC = () => {
|
||||
useTranslation()
|
||||
const user = useApplicationState((state) => state.user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue