mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
Sort components (#163)
* Move common components to the `common` directory * rename style directory * Move ForkAwesome to common * Move initializers and restructure application-loader.tsx
This commit is contained in:
parent
f2e273fc40
commit
c949b6950e
125 changed files with 104 additions and 103 deletions
|
@ -1,33 +1,29 @@
|
||||||
import React, { Fragment, useEffect, useState } from 'react'
|
import React, { Fragment, useCallback, useEffect, useState } from 'react'
|
||||||
import { useLocation } from 'react-router'
|
import { useLocation } from 'react-router'
|
||||||
import { InitTask, setUp } from '../../initializers'
|
|
||||||
import './application-loader.scss'
|
import './application-loader.scss'
|
||||||
|
import { createSetUpTaskList, InitTask } from './initializers'
|
||||||
|
|
||||||
import { LoadingScreen } from './loading-screen'
|
import { LoadingScreen } from './loading-screen'
|
||||||
|
|
||||||
export const ApplicationLoader: React.FC = ({ children }) => {
|
export const ApplicationLoader: React.FC = ({ children }) => {
|
||||||
|
const { pathname } = useLocation()
|
||||||
|
|
||||||
|
const setUpTasks = useCallback(() => {
|
||||||
|
const baseUrl: string = window.location.pathname.replace(pathname, '') + '/'
|
||||||
|
console.debug('Base URL is', baseUrl)
|
||||||
|
return createSetUpTaskList(baseUrl)
|
||||||
|
}, [pathname])
|
||||||
|
|
||||||
const [failedTitle, setFailedTitle] = useState<string>('')
|
const [failedTitle, setFailedTitle] = useState<string>('')
|
||||||
const [doneTasks, setDoneTasks] = useState<number>(0)
|
const [doneTasks, setDoneTasks] = useState<number>(0)
|
||||||
const [initTasks, setInitTasks] = useState<InitTask[]>([])
|
const [initTasks] = useState<InitTask[]>(setUpTasks)
|
||||||
const { pathname } = useLocation()
|
|
||||||
const [tasksAlreadyTriggered, setTasksAlreadyTriggered] = useState<boolean>(false)
|
|
||||||
|
|
||||||
const runTask = async (task: Promise<void>): Promise<void> => {
|
const runTask = useCallback(async (task: Promise<void>): Promise<void> => {
|
||||||
await task
|
await task
|
||||||
setDoneTasks(prevDoneTasks => {
|
setDoneTasks(prevDoneTasks => {
|
||||||
return prevDoneTasks + 1
|
return prevDoneTasks + 1
|
||||||
})
|
})
|
||||||
}
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (tasksAlreadyTriggered) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setTasksAlreadyTriggered(true)
|
|
||||||
const baseUrl: string = window.location.pathname.replace(pathname, '') + '/'
|
|
||||||
console.debug('Base URL is', baseUrl)
|
|
||||||
setInitTasks(setUp(baseUrl))
|
|
||||||
}, [tasksAlreadyTriggered, pathname])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
for (const task of initTasks) {
|
for (const task of initTasks) {
|
||||||
|
@ -36,7 +32,7 @@ export const ApplicationLoader: React.FC = ({ children }) => {
|
||||||
setFailedTitle(task.name)
|
setFailedTitle(task.name)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [initTasks])
|
}, [initTasks, runTask])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
doneTasks < initTasks.length || initTasks.length === 0
|
doneTasks < initTasks.length || initTasks.length === 0
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { getBackendConfig } from '../api/backend-config'
|
import { getBackendConfig } from '../../../api/backend-config'
|
||||||
import { getFrontendConfig } from '../api/frontend-config'
|
import { getFrontendConfig } from '../../../api/frontend-config'
|
||||||
import { setBackendConfig } from '../redux/backend-config/methods'
|
import { setBackendConfig } from '../../../redux/backend-config/methods'
|
||||||
import { setFrontendConfig } from '../redux/frontend-config/methods'
|
import { setFrontendConfig } from '../../../redux/frontend-config/methods'
|
||||||
import { getAndSetUser } from '../utils/apiUtils'
|
import { getAndSetUser } from '../../../utils/apiUtils'
|
||||||
|
|
||||||
export const loadAllConfig: (baseUrl: string) => Promise<void> = async (baseUrl) => {
|
export const loadAllConfig: (baseUrl: string) => Promise<void> = async (baseUrl) => {
|
||||||
const frontendConfig = await getFrontendConfig(baseUrl)
|
const frontendConfig = await getFrontendConfig(baseUrl)
|
|
@ -1,7 +1,6 @@
|
||||||
import i18n from 'i18next'
|
import i18n from 'i18next'
|
||||||
import Backend from 'i18next-http-backend'
|
|
||||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||||
import { initReactI18next } from 'react-i18next'
|
import Backend from 'i18next-http-backend'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import 'moment/locale/ar'
|
import 'moment/locale/ar'
|
||||||
import 'moment/locale/ca'
|
import 'moment/locale/ca'
|
||||||
|
@ -30,6 +29,7 @@ import 'moment/locale/uk'
|
||||||
import 'moment/locale/vi'
|
import 'moment/locale/vi'
|
||||||
import 'moment/locale/zh-cn'
|
import 'moment/locale/zh-cn'
|
||||||
import 'moment/locale/zh-tw'
|
import 'moment/locale/zh-tw'
|
||||||
|
import { initReactI18next } from 'react-i18next'
|
||||||
|
|
||||||
export const setUpI18n = async (): Promise<void> => {
|
export const setUpI18n = async (): Promise<void> => {
|
||||||
await i18n
|
await i18n
|
|
@ -14,7 +14,7 @@ export interface InitTask {
|
||||||
task: Promise<void>
|
task: Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setUp = (baseUrl: string): InitTask[] => {
|
export const createSetUpTaskList = (baseUrl: string): InitTask[] => {
|
||||||
return [{
|
return [{
|
||||||
name: 'Load Translations',
|
name: 'Load Translations',
|
||||||
task: setUpI18n()
|
task: setUpI18n()
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Alert } from 'react-bootstrap'
|
import { Alert } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../common/fork-awesome/fork-awesome-icon'
|
||||||
import { ShowIf } from '../common/show-if'
|
import { ShowIf } from '../common/show-if/show-if'
|
||||||
|
|
||||||
export interface LoadingScreenProps {
|
export interface LoadingScreenProps {
|
||||||
failedTitle: string
|
failedTitle: string
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
import { ShowIf } from '../common/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
|
|
||||||
export interface ElementSeparatorProps {
|
export interface ElementSeparatorProps {
|
||||||
separator: React.ReactElement
|
separator: React.ReactElement
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
import { Modal } from 'react-bootstrap'
|
import { Modal } from 'react-bootstrap'
|
||||||
import { Trans } from 'react-i18next'
|
import { Trans } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon, IconName } from '../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon, IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export interface ErrorModalProps {
|
export interface ErrorModalProps {
|
||||||
show: boolean
|
show: boolean
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import './icon-button.scss'
|
|
||||||
import { Button, ButtonProps } from 'react-bootstrap'
|
import { Button, ButtonProps } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon, IconName } from '../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon, IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
|
import './icon-button.scss'
|
||||||
|
|
||||||
export interface SocialButtonProps extends ButtonProps {
|
export interface SocialButtonProps extends ButtonProps {
|
||||||
icon: IconName
|
icon: IconName
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ForkAwesomeIcon, IconName } from '../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon, IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
import { ShowIf } from '../common/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import { LinkWithTextProps } from './types'
|
import { LinkWithTextProps } from './types'
|
||||||
|
|
||||||
export const ExternalLink: React.FC<LinkWithTextProps> = ({ href, text, icon, className = 'text-light' }) => {
|
export const ExternalLink: React.FC<LinkWithTextProps> = ({ href, text, icon, className = 'text-light' }) => {
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { ForkAwesomeIcon, IconName } from '../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon, IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
import { ShowIf } from '../common/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import { LinkWithTextProps } from './types'
|
import { LinkWithTextProps } from './types'
|
||||||
|
|
||||||
export const InternalLink: React.FC<LinkWithTextProps> = ({ href, text, icon, className = 'text-light' }) => {
|
export const InternalLink: React.FC<LinkWithTextProps> = ({ href, text, icon, className = 'text-light' }) => {
|
|
@ -1,5 +1,5 @@
|
||||||
import { StringMap, TOptionsBase } from 'i18next'
|
import { StringMap, TOptionsBase } from 'i18next'
|
||||||
import { IconName } from '../../fork-awesome/fork-awesome-icon'
|
import { IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export interface GeneralLinkProp {
|
export interface GeneralLinkProp {
|
||||||
href: string;
|
href: string;
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { Pagination } from 'react-bootstrap'
|
import { Pagination } from 'react-bootstrap'
|
||||||
import { ShowIf } from '../common/show-if'
|
import { ShowIf } from '../show-if/show-if'
|
||||||
import { PagerItem } from './pager-item'
|
import { PagerItem } from './pager-item'
|
||||||
|
|
||||||
export interface PaginationProps {
|
export interface PaginationProps {
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ButtonProps } from 'react-bootstrap'
|
import { ButtonProps } from 'react-bootstrap'
|
||||||
import { IconName } from '../../fork-awesome/fork-awesome-icon'
|
import { IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
import { IconButton } from '../icon-button/icon-button'
|
import { IconButton } from '../icon-button/icon-button'
|
||||||
|
|
||||||
export enum SortModeEnum {
|
export enum SortModeEnum {
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { useParams } from 'react-router'
|
import { useParams } from 'react-router'
|
||||||
import { ApplicationState } from '../../redux'
|
import { ApplicationState } from '../../redux'
|
||||||
import { ShowIf } from '../common/show-if'
|
import { ShowIf } from '../common/show-if/show-if'
|
||||||
import { EditorWindow } from './editor-window/editor-window'
|
import { EditorWindow } from './editor-window/editor-window'
|
||||||
import { MarkdownPreview } from './markdown-preview/markdown-preview'
|
import { MarkdownPreview } from './markdown-preview/markdown-preview'
|
||||||
import { EditorMode } from './task-bar/editor-view-mode'
|
import { EditorMode } from './task-bar/editor-view-mode'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Dropdown } from 'react-bootstrap'
|
import { Dropdown } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { ActiveIndicatorStatus } from './active-indicator'
|
import { ActiveIndicatorStatus } from './active-indicator'
|
||||||
import './connection-indicator.scss'
|
import './connection-indicator.scss'
|
||||||
import { UserLine } from './user-line'
|
import { UserLine } from './user-line'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { ToggleButton, ToggleButtonGroup } from 'react-bootstrap'
|
import { ToggleButton, ToggleButtonGroup } from 'react-bootstrap'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
const DarkModeButton: React.FC = () => {
|
const DarkModeButton: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Dropdown } from 'react-bootstrap'
|
import { Dropdown } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
const EditorMenu: React.FC = () => {
|
const EditorMenu: React.FC = () => {
|
||||||
useTranslation()
|
useTranslation()
|
||||||
|
|
|
@ -2,9 +2,9 @@ import React from 'react'
|
||||||
import { ToggleButton, ToggleButtonGroup } from 'react-bootstrap'
|
import { ToggleButton, ToggleButtonGroup } from 'react-bootstrap'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { ForkAwesomeIcon } from '../../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { ApplicationState } from '../../../redux'
|
import { ApplicationState } from '../../../redux'
|
||||||
import { setEditorModeConfig } from '../../../redux/editor/methods'
|
import { setEditorModeConfig } from '../../../redux/editor/methods'
|
||||||
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export enum EditorMode {
|
export enum EditorMode {
|
||||||
PREVIEW,
|
PREVIEW,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { Fragment, useState } from 'react'
|
import React, { Fragment, useState } from 'react'
|
||||||
import { Button, Card, Col, Modal, Row, Table } from 'react-bootstrap'
|
import { Button, Card, Col, Modal, Row, Table } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { TranslatedExternalLink } from '../../links/translated-external-link'
|
import { TranslatedExternalLink } from '../../common/links/translated-external-link'
|
||||||
|
|
||||||
export const HelpButton: React.FC = () => {
|
export const HelpButton: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
|
||||||
import { Button, Nav, Navbar } from 'react-bootstrap'
|
import { Button, Nav, Navbar } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { DarkModeButton } from './dark-mode-button'
|
|
||||||
import { EditorViewMode } from './editor-view-mode'
|
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { EditorMenu } from './editor-menu'
|
import { Link } from 'react-router-dom'
|
||||||
|
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { ConnectionIndicator } from './connection-indicator'
|
import { ConnectionIndicator } from './connection-indicator'
|
||||||
|
import { DarkModeButton } from './dark-mode-button'
|
||||||
|
import { EditorMenu } from './editor-menu'
|
||||||
|
import { EditorViewMode } from './editor-view-mode'
|
||||||
import { HelpButton } from './help-button'
|
import { HelpButton } from './help-button'
|
||||||
|
|
||||||
const TaskBar: React.FC = () => {
|
const TaskBar: React.FC = () => {
|
||||||
|
|
|
@ -2,9 +2,9 @@ import React, { Fragment } from 'react'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { ApplicationState } from '../../../../redux'
|
import { ApplicationState } from '../../../../redux'
|
||||||
import { ExternalLink } from '../../../links/external-link'
|
import { ExternalLink } from '../../../common/links/external-link'
|
||||||
import { TranslatedExternalLink } from '../../../links/translated-external-link'
|
import { TranslatedExternalLink } from '../../../common/links/translated-external-link'
|
||||||
import { TranslatedInternalLink } from '../../../links/translated-internal-link'
|
import { TranslatedInternalLink } from '../../../common/links/translated-internal-link'
|
||||||
import { VersionInfo } from '../version-info/version-info'
|
import { VersionInfo } from '../version-info/version-info'
|
||||||
|
|
||||||
export const PoweredByLinks: React.FC = () => {
|
export const PoweredByLinks: React.FC = () => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ExternalLink } from '../../../links/external-link'
|
import { ExternalLink } from '../../../common/links/external-link'
|
||||||
|
|
||||||
const SocialLink: React.FC = () => {
|
const SocialLink: React.FC = () => {
|
||||||
useTranslation()
|
useTranslation()
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { LinkContainer } from 'react-router-bootstrap'
|
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../fork-awesome/fork-awesome-icon'
|
import { LinkContainer } from 'react-router-bootstrap'
|
||||||
|
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export const NewGuestNoteButton: React.FC = () => {
|
export const NewGuestNoteButton: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { LinkContainer } from 'react-router-bootstrap'
|
|
||||||
import { Button } from 'react-bootstrap'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { Button } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../fork-awesome/fork-awesome-icon'
|
import { LinkContainer } from 'react-router-bootstrap'
|
||||||
|
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export const NewUserNoteButton: React.FC = () => {
|
export const NewUserNoteButton: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { LinkContainer } from 'react-router-bootstrap'
|
import { LinkContainer } from 'react-router-bootstrap'
|
||||||
import { ApplicationState } from '../../../../redux'
|
import { ApplicationState } from '../../../../redux'
|
||||||
import { ShowIf } from '../../../common/show-if'
|
import { ShowIf } from '../../../common/show-if/show-if'
|
||||||
|
|
||||||
type SignInButtonProps = {
|
type SignInButtonProps = {
|
||||||
className?: string
|
className?: string
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { Dropdown } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { LinkContainer } from 'react-router-bootstrap'
|
import { LinkContainer } from 'react-router-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { ApplicationState } from '../../../../../redux'
|
import { ApplicationState } from '../../../../../redux'
|
||||||
import { clearUser } from '../../../../../redux/user/methods'
|
import { clearUser } from '../../../../../redux/user/methods'
|
||||||
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { UserAvatar } from '../../user-avatar/user-avatar'
|
import { UserAvatar } from '../../user-avatar/user-avatar'
|
||||||
|
|
||||||
export const UserDropdown: React.FC = () => {
|
export const UserDropdown: React.FC = () => {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { useSelector } from 'react-redux'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { ApplicationState } from '../../../../redux'
|
import { ApplicationState } from '../../../../redux'
|
||||||
import frontendVersion from '../../../../version.json'
|
import frontendVersion from '../../../../version.json'
|
||||||
import { ShowIf } from '../../../common/show-if'
|
import { TranslatedExternalLink } from '../../../common/links/translated-external-link'
|
||||||
import { TranslatedExternalLink } from '../../../links/translated-external-link'
|
import { ShowIf } from '../../../common/show-if/show-if'
|
||||||
import { VersionInputField } from './version-input-field'
|
import { VersionInputField } from './version-input-field'
|
||||||
|
|
||||||
export const VersionInfo: React.FC = () => {
|
export const VersionInfo: React.FC = () => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Fragment, useRef, useState } from 'react'
|
import React, { Fragment, useRef, useState } from 'react'
|
||||||
import { Button, FormControl, InputGroup, Overlay, Tooltip } from 'react-bootstrap'
|
import { Button, FormControl, InputGroup, Overlay, Tooltip } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export interface VersionInputFieldProps {
|
export interface VersionInputFieldProps {
|
||||||
version: string
|
version: string
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import './close-button.scss'
|
import './close-button.scss'
|
||||||
|
|
||||||
export interface CloseButtonProps {
|
export interface CloseButtonProps {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import './pin-button.scss'
|
import './pin-button.scss'
|
||||||
|
|
||||||
export interface PinButtonProps {
|
export interface PinButtonProps {
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { Location } from '../history'
|
import { HistoryEntryOrigin } from '../history'
|
||||||
import './sync-status.scss'
|
import './sync-status.scss'
|
||||||
|
|
||||||
export interface SyncStatusProps {
|
export interface SyncStatusProps {
|
||||||
isDark: boolean
|
isDark: boolean
|
||||||
location: Location
|
location: HistoryEntryOrigin
|
||||||
onSync: () => void
|
onSync: () => void
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SyncStatus: React.FC<SyncStatusProps> = ({ isDark, location, onSync, className }) => {
|
export const SyncStatus: React.FC<SyncStatusProps> = ({ isDark, location, onSync, className }) => {
|
||||||
const icon = location === Location.REMOTE ? 'cloud' : 'laptop'
|
const icon = location === HistoryEntryOrigin.REMOTE ? 'cloud' : 'laptop'
|
||||||
return (
|
return (
|
||||||
<Button variant={isDark ? 'secondary' : 'light'} onClick={onSync} className={`sync-icon ${className || ''}`}>
|
<Button variant={isDark ? 'secondary' : 'light'} onClick={onSync} className={`sync-icon ${className || ''}`}>
|
||||||
<ForkAwesomeIcon icon={icon}/>
|
<ForkAwesomeIcon icon={icon}/>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Row } from 'react-bootstrap'
|
import { Row } from 'react-bootstrap'
|
||||||
import { Pager } from '../../../../pagination/pager'
|
import { Pager } from '../../../../common/pagination/pager'
|
||||||
import { HistoryEntriesProps } from '../history-content/history-content'
|
import { HistoryEntriesProps } from '../history-content/history-content'
|
||||||
import { HistoryCard } from './history-card'
|
import { HistoryCard } from './history-card'
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Badge, Card } from 'react-bootstrap'
|
import { Badge, Card } from 'react-bootstrap'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { formatHistoryDate } from '../../../../../utils/historyUtils'
|
import { formatHistoryDate } from '../../../../../utils/historyUtils'
|
||||||
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { CloseButton } from '../common/close-button'
|
import { CloseButton } from '../common/close-button'
|
||||||
import { PinButton } from '../common/pin-button'
|
import { PinButton } from '../common/pin-button'
|
||||||
import { SyncStatus } from '../common/sync-status'
|
import { SyncStatus } from '../common/sync-status'
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { Fragment, useState } from 'react'
|
import React, { Fragment, useState } from 'react'
|
||||||
import { Alert, Row } from 'react-bootstrap'
|
import { Alert, Row } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { PagerPagination } from '../../../../pagination/pager-pagination'
|
|
||||||
import { LocatedHistoryEntry } from '../history'
|
import { LocatedHistoryEntry } from '../history'
|
||||||
|
import { PagerPagination } from '../../../../common/pagination/pager-pagination'
|
||||||
import { HistoryCardList } from '../history-card/history-card-list'
|
import { HistoryCardList } from '../history-card/history-card-list'
|
||||||
import { HistoryTable } from '../history-table/history-table'
|
import { HistoryTable } from '../history-table/history-table'
|
||||||
import { ViewStateEnum } from '../history-toolbar/history-toolbar'
|
import { ViewStateEnum } from '../history-toolbar/history-toolbar'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Table } from 'react-bootstrap'
|
import { Table } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { Pager } from '../../../../pagination/pager'
|
import { Pager } from '../../../../common/pagination/pager'
|
||||||
import { HistoryEntriesProps } from '../history-content/history-content'
|
import { HistoryEntriesProps } from '../history-content/history-content'
|
||||||
import { HistoryTableRow } from './history-table-row'
|
import { HistoryTableRow } from './history-table-row'
|
||||||
import './history-table.scss'
|
import './history-table.scss'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState, Fragment } from 'react'
|
import React, { Fragment, useState } from 'react'
|
||||||
import { Button, Modal } from 'react-bootstrap'
|
import { Button, Modal } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export interface ClearHistoryButtonProps {
|
export interface ClearHistoryButtonProps {
|
||||||
onClearHistory: () => void
|
onClearHistory: () => void
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export interface ExportHistoryButtonProps {
|
export interface ExportHistoryButtonProps {
|
||||||
onExportHistory: () => void
|
onExportHistory: () => void
|
||||||
|
|
|
@ -2,8 +2,8 @@ import React, { ChangeEvent, useEffect, useState } from 'react'
|
||||||
import { Button, Form, FormControl, InputGroup, ToggleButton, ToggleButtonGroup } from 'react-bootstrap'
|
import { Button, Form, FormControl, InputGroup, ToggleButton, ToggleButtonGroup } from 'react-bootstrap'
|
||||||
import { Typeahead } from 'react-bootstrap-typeahead'
|
import { Typeahead } from 'react-bootstrap-typeahead'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { SortButton, SortModeEnum } from '../../../../sort-button/sort-button'
|
import { SortButton, SortModeEnum } from '../../../../common/sort-button/sort-button'
|
||||||
import { HistoryEntry } from '../history'
|
import { HistoryEntry } from '../history'
|
||||||
import { ClearHistoryButton } from './clear-history-button'
|
import { ClearHistoryButton } from './clear-history-button'
|
||||||
import { ExportHistoryButton } from './export-history-button'
|
import { ExportHistoryButton } from './export-history-button'
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React, { useRef, useState } from 'react'
|
import React, { useRef, useState } from 'react'
|
||||||
import { Button } from 'react-bootstrap'
|
import { Button } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { convertV1History, V1HistoryEntry } from '../../../../../utils/historyUtils'
|
import { convertV1History, V1HistoryEntry } from '../../../../../utils/historyUtils'
|
||||||
import { ErrorModal } from '../../../../error-modal/error-modal'
|
import { ErrorModal } from '../../../../common/error-modal/error-modal'
|
||||||
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { HistoryEntry, HistoryJson } from '../history'
|
import { HistoryEntry, HistoryJson } from '../history'
|
||||||
|
|
||||||
export interface ImportHistoryButtonProps {
|
export interface ImportHistoryButtonProps {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
setHistoryToLocalStore,
|
setHistoryToLocalStore,
|
||||||
sortAndFilterEntries
|
sortAndFilterEntries
|
||||||
} from '../../../../utils/historyUtils'
|
} from '../../../../utils/historyUtils'
|
||||||
import { ErrorModal } from '../../../error-modal/error-modal'
|
import { ErrorModal } from '../../../common/error-modal/error-modal'
|
||||||
import { HistoryContent } from './history-content/history-content'
|
import { HistoryContent } from './history-content/history-content'
|
||||||
import { HistoryToolbar, HistoryToolbarState, initState as toolbarInitState } from './history-toolbar/history-toolbar'
|
import { HistoryToolbar, HistoryToolbarState, initState as toolbarInitState } from './history-toolbar/history-toolbar'
|
||||||
|
|
||||||
|
@ -32,10 +32,10 @@ export interface HistoryJson {
|
||||||
export type LocatedHistoryEntry = HistoryEntry & HistoryEntryLocation
|
export type LocatedHistoryEntry = HistoryEntry & HistoryEntryLocation
|
||||||
|
|
||||||
export interface HistoryEntryLocation {
|
export interface HistoryEntryLocation {
|
||||||
location: Location
|
location: HistoryEntryOrigin
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Location {
|
export enum HistoryEntryOrigin {
|
||||||
LOCAL = 'local',
|
LOCAL = 'local',
|
||||||
REMOTE = 'remote'
|
REMOTE = 'remote'
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { ApplicationState } from '../../../../../redux'
|
import { ApplicationState } from '../../../../../redux'
|
||||||
import { ShowIf } from '../../../../common/show-if'
|
import { ShowIf } from '../../../../common/show-if/show-if'
|
||||||
import { SignInButton } from '../../../layout/navigation/sign-in-button'
|
import { SignInButton } from '../../../layout/navigation/sign-in-button'
|
||||||
import './cover-buttons.scss'
|
import './cover-buttons.scss'
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
|
||||||
import { Col, Row } from 'react-bootstrap'
|
import { Col, Row } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { ForkAwesomeIcon } from '../../../../fork-awesome/fork-awesome-icon'
|
import { Link } from 'react-router-dom'
|
||||||
|
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export const FeatureLinks: React.FC = () => {
|
export const FeatureLinks: React.FC = () => {
|
||||||
useTranslation()
|
useTranslation()
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ForkAwesomeIcon } from '../../../../fork-awesome/fork-awesome-icon'
|
|
||||||
import screenshot from './img/screenshot.png'
|
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { FeatureLinks } from './feature-links'
|
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { CoverButtons } from './cover-buttons/cover-buttons'
|
import { CoverButtons } from './cover-buttons/cover-buttons'
|
||||||
|
import { FeatureLinks } from './feature-links'
|
||||||
|
import screenshot from './img/screenshot.png'
|
||||||
|
|
||||||
const Intro: React.FC = () => {
|
const Intro: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { ForkAwesomeIcon, IconName } from '../../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import './social-link-button.scss'
|
import './social-link-button.scss'
|
||||||
import { ForkAwesomeIcon, IconName } from '../../../../../../fork-awesome/fork-awesome-icon'
|
|
||||||
|
|
||||||
export interface SocialButtonProps {
|
export interface SocialButtonProps {
|
||||||
backgroundClass: string,
|
backgroundClass: string,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { IconName } from '../../../../../fork-awesome/fork-awesome-icon'
|
import { IconName } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
import { SocialLinkButton } from './social-link-button/social-link-button'
|
import { SocialLinkButton } from './social-link-button/social-link-button'
|
||||||
|
|
||||||
export enum OneClickType {
|
export enum OneClickType {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { Redirect } from 'react-router'
|
import { Redirect } from 'react-router'
|
||||||
import { ApplicationState } from '../../../../redux'
|
import { ApplicationState } from '../../../../redux'
|
||||||
import { ShowIf } from '../../../common/show-if'
|
import { ShowIf } from '../../../common/show-if/show-if'
|
||||||
import { ViaEMail } from './auth/via-email'
|
import { ViaEMail } from './auth/via-email'
|
||||||
import { ViaLdap } from './auth/via-ldap'
|
import { ViaLdap } from './auth/via-ldap'
|
||||||
import { OneClickType, ViaOneClick } from './auth/via-one-click'
|
import { OneClickType, ViaOneClick } from './auth/via-one-click'
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useSelector } from 'react-redux'
|
||||||
import { Redirect } from 'react-router'
|
import { Redirect } from 'react-router'
|
||||||
import { ApplicationState } from '../../../../redux'
|
import { ApplicationState } from '../../../../redux'
|
||||||
import { LoginProvider } from '../../../../redux/user/types'
|
import { LoginProvider } from '../../../../redux/user/types'
|
||||||
import { ShowIf } from '../../../common/show-if'
|
import { ShowIf } from '../../../common/show-if/show-if'
|
||||||
import { ProfileAccountManagement } from './settings/profile-account-management'
|
import { ProfileAccountManagement } from './settings/profile-account-management'
|
||||||
import { ProfileChangePassword } from './settings/profile-change-password'
|
import { ProfileChangePassword } from './settings/profile-change-password'
|
||||||
import { ProfileDisplayName } from './settings/profile-display-name'
|
import { ProfileDisplayName } from './settings/profile-display-name'
|
||||||
|
|
|
@ -2,9 +2,9 @@ import React, { Fragment, useEffect, useRef, useState } from 'react'
|
||||||
import { Button, Card, Modal } from 'react-bootstrap'
|
import { Button, Card, Modal } from 'react-bootstrap'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { deleteUser } from '../../../../../api/me'
|
import { deleteUser } from '../../../../../api/me'
|
||||||
import { ForkAwesomeIcon } from '../../../../../fork-awesome/fork-awesome-icon'
|
|
||||||
import { clearUser } from '../../../../../redux/user/methods'
|
import { clearUser } from '../../../../../redux/user/methods'
|
||||||
import { getBackendUrl } from '../../../../../utils/apiUtils'
|
import { getBackendUrl } from '../../../../../utils/apiUtils'
|
||||||
|
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
export const ProfileAccountManagement: React.FC = () => {
|
export const ProfileAccountManagement: React.FC = () => {
|
||||||
useTranslation()
|
useTranslation()
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue